Public
Edited
Mar 11, 2023
Insert cell
Insert cell
d3.geoMercator()
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
grasslandImage = await bigHornMontanaWebMercator.getImage()
Insert cell
grasslandImage.pixelIsArea()
Insert cell
width = grasslandImage.getWidth()
Insert cell
height = grasslandImage.getHeight()
Insert cell
grasslandImage.getOrigin()
Insert cell
p = [Math.floor(width / 2), Math.floor(height/2)]
Insert cell
coords = [origin[0] / width + p[0] / width, origin[1]/height + p[1] / height]
Insert cell
grasslandImage.getBoundingBox()
Insert cell
grasslandImage.dataView
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
fd.GeoAsciiParams
Insert cell
grasslandImage.fileDirectory
Insert cell
origin = grasslandImage.getOrigin()
Insert cell
GeoTIFF = require("geotiff")
Insert cell
plottyRenderer(values, 0, 255, "greys")
Insert cell
image.getResolution()
Insert cell
values = (
await image.readRasters()
)[0]
Insert cell
u = _.uniq(values)
Insert cell
c = _.countBy(values, d => d)
Insert cell
sqm_176 = c[176] * 900
Insert cell
acre_176 = 0.000247105 * sqm_176
Insert cell
e = d3.extent(values)
Insert cell
values.length / (imageWidth / 6)
Insert cell
imageHeight
Insert cell
xmin = 0
Insert cell
xmax = imageWidth / image.getTileWidth()
Insert cell
ymin = 0
Insert cell
th = image.getTileHeight()
Insert cell
nh = imageHeight / th
Insert cell
image.getResolution()
Insert cell
image.getGDALNoData()
Insert cell
image.geoKeys.ProjectionGeoKey
Insert cell
bbox = image.getBoundingBox()
Insert cell
bboxWidth = bbox[2] - bbox[0]
Insert cell
bboxHeight = bbox[3] - bbox[1]
Insert cell
x0 = 0 * bboxWidth + bbox[0]
Insert cell
image.geoKeys.GeogEllipsoidGeoKey
Insert cell
fd = image.getFileDirectory()
Insert cell
fd.GDAL_METADATA
Insert cell
image.getGDALMetadata()
Insert cell
image.geoKeys
Insert cell
minVal = d3.min(values)
Insert cell
image.getBytesPerPixel()
Insert cell
imageWidth = image.getWidth()
Insert cell
imageHeight = image.getHeight()
Insert cell
point = image
Insert cell
values[0]
Insert cell
image = bigHornMontana.getImage()
Insert cell
bigHornMontana = FileAttachment("big-horn-montana.tiff")
.arrayBuffer()
.then((buffer) => GeoTIFF.fromArrayBuffer(buffer))
Insert cell
plotty = require("plotty@0.3.1/dist/plotty.js")
Insert cell
import { plottyRenderer } from "@jbaba/display-a-geotiff-file"
Insert cell
bigHornMontanaWebMercator = FileAttachment("big-horn-montana-web-mercator.TIF").arrayBuffer().then(buffer => GeoTIFF.fromArrayBuffer(buffer))
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more