Published
Edited
Aug 14, 2019
6 forks
18 stars
Insert cell
Insert cell
Insert cell
Insert cell
geojson = {
let gj = { type: "FeatureCollection", features: [] };
for (let file of kml) {
let text = await read(file);
let dom = new DOMParser().parseFromString(text, "application/xml");
let error = dom.querySelector("parsererror");
if (error) throw new Error(error.innerText);
gj.features.push(...toGeoJSON.kmlGen(dom));
}

return gj;
}
Insert cell
Insert cell
Insert cell
Insert cell
toGeoJSON = import("@tmcw/togeojson")
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