forked from MapComplete/MapComplete
Chore: don't use 'reverse', fix tests
This commit is contained in:
parent
85cb90182b
commit
7b72da8064
1 changed files with 2 additions and 1 deletions
|
@ -272,8 +272,9 @@ class GenerateSeries extends Script {
|
||||||
allFeatures = allFeatures.filter((f) => f.properties.metadata?.theme !== "EMPTY CS" && f.geometry.coordinates.length > 0)
|
allFeatures = allFeatures.filter((f) => f.properties.metadata?.theme !== "EMPTY CS" && f.geometry.coordinates.length > 0)
|
||||||
const centerpointsAll = allFeatures.map((f) => {
|
const centerpointsAll = allFeatures.map((f) => {
|
||||||
const centerpoint = GeoOperations.centerpoint(f)
|
const centerpoint = GeoOperations.centerpoint(f)
|
||||||
|
const c = centerpoint.geometry.coordinates
|
||||||
// OsmCha doesn't adhere to the Geojson standard and uses `lat` `lon` as coordinates instead of `lon`, `lat`
|
// OsmCha doesn't adhere to the Geojson standard and uses `lat` `lon` as coordinates instead of `lon`, `lat`
|
||||||
centerpoint.geometry.coordinates.reverse()
|
centerpoint.geometry.coordinates = [c[1], c[0]]
|
||||||
return centerpoint
|
return centerpoint
|
||||||
})
|
})
|
||||||
const centerpoints = centerpointsAll.filter(p => {
|
const centerpoints = centerpointsAll.filter(p => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue