Open jguthmiller opened 9 years ago
Ah, yes. Our ID dictionary should then refer to an array of features rather than just one.
I wonder if the Mapbox folks have any insight on how multi-polygons should be thought about in regards to the vector tile spec.
+1 on seeing this fixed. Took me ages to realize what was going on when using the gs-mvt plugin for geoserver and trying to see if it is actually doing its job right...
I hacked together a fix a while back, but wasn't sure about submitting a PR since version 2 of the vector tile spec addresses multipolygons.
Here's a copy of the patch if anyone's interested.
hi @jguthmiller ! the patch is perfect. thanks !
If more than one polygon exists for a unique feature in a given tile, the parseVectorTileLayer method will end up overwriting the existing references to that feature, and add a copy of itself to the features list for that tile.
For example, the islands off the coast of California should be visible; Instead the last California polygon in the list of polygons for that tile was effectively duplicated.
Here's the decoded json of the tile for reference. I used Tilestache to generate the tiles, and Mapzen's mapbox vector tile library to encode them.