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
Extract borders? #17
Comments
So, like, topojson.meshes? Normally I implement this by doing multiple passes and filtering accordingly, but yes, it might be more efficient to have a method to construct multiple disjoint meshes in one pass. |
Yes. The API could be simpler than what I coded here, as there is no need to use filter and tag functions at the same time. (If you don't want some part of the mesh, just tag it "0" or something, and filter it out from the partition.) So, To avoid code duplication, [Updated my block accordingly] |
Another option is to use the tag to filter as well as to partition, the rule being that if the tag is false-ish, the arcs are ignored. Then we would have (almost) no overhead for the simpler |
Currently
topojson.mesh()
returns one big mesh, and no simple way to extract borders and tag them by neighbors (for example).Could it be interesting to have an extension of
topojson.mesh()
that allows atag(a,b)
function to partition the resulting mesh?Here's a block that demonstrates the idea (with code adapted from src/mesh.js):
http://blockbuilder.org/Fil/9ff0ca1825369075394d0e77e149052c
Notice how the two lines between USA and Canada belong to the same MultiLineString (they have the same tag). The coastline is tagged 0 and also is a unique MultiLineString.
The text was updated successfully, but these errors were encountered: