Add properties to centerpoints

This commit is contained in:
pietervdvn 2022-01-15 03:10:06 +01:00
parent 4f7f93e9c1
commit 4a8823af4b
3 changed files with 235486 additions and 3 deletions

View file

@ -662,13 +662,16 @@ function createMiscGraphs(allFeatures: ChangeSetData[], emptyCS: ChangeSetData[]
}).render()
const geojson = {
type: "FeatureCollection",
features: allFeatures.map(f => {
features: Utils.NoNull(allFeatures.map(f => {
try {
return GeoOperations.centerpoint(f.geometry);
const point = GeoOperations.centerpoint(f.geometry);
point.properties = f.properties
return point
} catch (e) {
console.error("Could not create center point: ", e, f)
return undefined
}
})
}))
}
writeFileSync("centerpoints.geojson", JSON.stringify(geojson, undefined, 2))
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,3 @@
{
}