Public
Edited
Feb 1, 2023
2 forks
7 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
db = FileAttachment("buildings.gpkg")
.arrayBuffer()
// Enable GPKG mode
.then((b) =>
spl.db(b).read(`select enablegpkgmode();
select initspatialmetadata(1);`)
)
Insert cell
Insert cell
sampleQuery = db.exec(`SELECT b.fid AS id, b.geom AS geometry FROM buildings b LIMIT 10`)
.get.objs
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
runway_buffer = geotoolbox.buffer(hal_runway, {
dist: buffer_metre / 1000,
merge: true
})
Insert cell
Insert cell
Insert cell
Insert cell
bufferGeomJson = JSON.stringify(runway_buffer.features[0].geometry)
Insert cell
buildings = db
.exec(
`SELECT
JSON_OBJECT('id', b.fid) AS properties, b.geom AS geometry
FROM
buildings b
WHERE
b.geom IS NOT NULL
AND
Intersects(b.geom, GeomFromGeoJSON('${bufferGeomJson}'))`
)
.get.objs.then((d) => ({ type: "FeatureCollection", features: d }))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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