Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

topomerge can't deduplicate geometries #16

Open
jstcki opened this issue Jul 18, 2017 · 2 comments
Open

topomerge can't deduplicate geometries #16

jstcki opened this issue Jul 18, 2017 · 2 comments

Comments

@jstcki
Copy link

jstcki commented Jul 18, 2017

I expected topomerge to be able to deduplicate geometries but it didn't work:

topomerge -k 'd.id' < foo.json

Geometries come out like this:

{"type":"MultiPolygon","arcs":[[]],"id":"1"}
// etc.

As a workaround I used ndjson-reduce 'p[d.id] = d, p' '{}' | ndjson-split 'Object.values(d)' on the GeoJSON features first.

@mbostock
Copy link
Member

Right—that’s not how topojson.merge (topomerge) works. It expects the input to be topologically-consistent and non-overlapping. Could probably be documented better, though.

@aubergene
Copy link

I might have been having a different issue, but it sounds similar it's quite nuanced describing the differences. I had two shapefiles which shared a border, but when I merged them into the same topojson file the borders didn't match up despite them being very similar. The fix was that I was doing the quantization after conversion to topojson, when you need to do at the point you load both files. I hope this is correct and helpful to other people.

geo2topo -q 1e5 -n nuts=raw/ndjson/nuts.ndjson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants