Open andrewharvey opened 6 years ago
It would be relatively straightforward to pull out the detected edges into new features, but I don't feel like this necessarily belongs in Tippecanoe, since it seems like more of a data analysis task than a tiling task. It seems like it might be better as a preprocessor. Do you think it makes more sense as part of tiling?
I agree, it's something that can be done outside of tippecanoe. I was thinking doing it part of tippecanoe would be more efficient since it's already detecting the shared borders when using -ab
, but if it'll add too much blot I understand.
I'm really hesitant to add any new features relating to polygons right now because so many things are going to have to change for cross-tile geometry merging in the new vector tile spec. But I can look into this after things settle back down.
OK, you can try this in https://github.com/mapbox/tippecanoe/pull/576 with --extract-borders
.
With the au/qld parcels from zoom 12-16 it comes to a 1.1GB tileset without --extract-borders
and 950MB with --extract-borders
.
For me it's more the rendering benefits this brings from drawing a single line instead of multiple overlapping lines.
I'm glad this was useful for you. In the long run I still think it makes more sense to do as a preprocessing step on the source data (using TopoJSON, for instance) rather than as part of tiling. (Or perhaps as part of the large-scale spatial join tool that is still in the back of my mind, since detecting shared borders could be one aspect of finding feature overlap.)
I was actually going to request a very different but also very related feature, which is to treat all polygons as line features. I was primarily thinking of the size benefit - presumably all the tiles that are entirely within a single polygon would no longer have to exist, so the end result would be a lot smaller.
But I also figured that could be done by a pre-processor, so... shrug
We already have --detect-shared-borders:
How about a mesh option like https://github.com/topojson/topojson-client#mesh which extracts shared borders from polygons and creates a single line?
This is useful when creating a map of parcel boundaries as lines only, where you don't need the original polygon as it avoids overlapping lines which can improve how it renders visual. Not sure if it would decrease or increase the file size.