mapbox / geojson-merge

Merge multiple GeoJSON files into one FeatureCollection.
ISC License
233 stars 33 forks source link

merging "features" does not re-increment the "id" property #25

Open jonathancallahan opened 6 years ago

jonathancallahan commented 6 years ago

We are using geojson-merge to merge the following three files:

https://haze.airfire.org/monitoring/latest/geojson/airnow_PM2.5_latest10.geojson https://haze.airfire.org/monitoring/latest/geojson/airsis_PM2.5_latest10.geojson https://haze.airfire.org/monitoring/latest/geojson/wrcc_PM2.5_latest10.geojson

geojson-merge does not re-increment each feature's id so we end up with a combined file with non-unique ids which causes ArcGIS Online to fail.

andrewharvey commented 6 years ago

Personally I don't believe that should be within the scope of geojson-merge. I see these GeoJSON utilities like unix text processing commands, they should focus on doing one job and handle complex scenarios via constructing them in a chain via pipes.

As such how about piping them through https://github.com/andrewharvey/geojson-id-streaming which will reset the id's.