Public
Edited
Sep 13, 2023
Insert cell
Insert cell
Insert cell
{
const iters = 10000
const geometry = data[0].geometry
const buf = toBuffer(new Uint8Array(geometry.data))
const parseBuf = () => {
return wkx.Geometry.parse(toBuffer(new Uint8Array(geometry.data)))
}
const wkxObj = parseBuf()
const wktToGeojson = () => wkxObj.toGeoJSON()
let t0 = performance.now()
for (let i=0; i<iters;i++) parseBuf()
const timeBuf = performance.now() - t0

t0 = performance.now()
for (let i=0; i<iters;i++) wktToGeojson()
const timeWkx = performance.now() - t0

return {
timeBuf,
timeWkx
}
}
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