Public
Edited
Jan 19
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
viewof fileInput = Inputs.file({label: "Input GeoJSON file", accept: ".geojson,.json"})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
outJson = new Object({type: "FeatureCollection", name: "transformed layer", features: transformedFeatures})
Insert cell
Insert cell
Insert cell
function invertY(obj) {
if (Array.isArray(obj) && obj.length === 2 && obj.every(num => typeof num === 'number')) {
return [obj[0], obj[1] * -1];
} else if (Array.isArray(obj)) {
return obj.map(item => invertY(item));
} else if (typeof obj === 'object' && obj !== null) {
return Object.fromEntries(
Object.entries(obj).map(([key, value]) => [key, invertY(value)])
);
}
return obj;
}
Insert cell
Insert cell
transformer = new transform.GcpTransformer(
annotationData.items[0].body.features.map(d => { return { resource: d.properties.resourceCoords, geo: d.geometry.coordinates} }),
transformType,
{differentHandedness: dh}
)
Insert cell
Insert cell
Insert cell
transform = import('https://cdn.jsdelivr.net/npm/@allmaps/transform/+esm')
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