mapshaper
mapshaper copied to clipboard
`-merge-layers` makes separate files when source layers have null geometries
I was trying to merge three files into one, but got three output files instead.
Very likely, this is because sometimes one or more of those files have null geometries.
Command I used:
mapshaper -i filea.json fileb.json filec.json combine-files \
-merge-layers \
-o format=geojson precision=0.001 merged.json
In my test case, each source file is essentially empty:
{"type":"FeatureCollection", "features": [
]}
Resulting in:
[o] Wrote data/merged1.json
[o] Wrote data/merged2.json
[o] Wrote data/merged3.json
Ideally, we'd end up with one merged.json file that contains this:
{"type":"GeometryCollection", "geometries": [
]}
Current workaround is to add the combine-layers to the -o command in lieu of using -merge-layers.