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()
|
}).render()
|
||||||
const geojson = {
|
const geojson = {
|
||||||
type: "FeatureCollection",
|
type: "FeatureCollection",
|
||||||
features: allFeatures.map(f => {
|
features: Utils.NoNull(allFeatures.map(f => {
|
||||||
try {
|
try {
|
||||||
return GeoOperations.centerpoint(f.geometry);
|
const point = GeoOperations.centerpoint(f.geometry);
|
||||||
|
point.properties = f.properties
|
||||||
|
return point
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Could not create center point: ", e, f)
|
console.error("Could not create center point: ", e, f)
|
||||||
|
return undefined
|
||||||
}
|
}
|
||||||
})
|
}))
|
||||||
}
|
}
|
||||||
writeFileSync("centerpoints.geojson", JSON.stringify(geojson, undefined, 2))
|
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