mapshaper icon indicating copy to clipboard operation
mapshaper copied to clipboard

`-merge-layers` makes separate files when source layers have null geometries

Open jkeefe opened this issue 1 year ago • 0 comments

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.

jkeefe avatar Oct 03 '24 20:10 jkeefe