Add properties to centerpoints
This commit is contained in:
parent
4f7f93e9c1
commit
4a8823af4b
3 changed files with 235486 additions and 3 deletions
|
@ -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
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
|
||||
}
|
Loading…
Reference in a new issue