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

Update for multi-polygon compliance with spec v1.0.2 #20

Closed
bcamper opened this issue Oct 23, 2015 · 16 comments
Closed

Update for multi-polygon compliance with spec v1.0.2 #20

bcamper opened this issue Oct 23, 2015 · 16 comments
Milestone

Comments

@bcamper
Copy link
Contributor

bcamper commented Oct 23, 2015

The upcoming spec v1.0.2 clarifies how multi-polygons should be encoded: all polygons should be "flattened" into one series of rings, with the winding order of the rings used to determine which are interior/exterior. An exterior ring indicates the start of a new polygon.

I believe this differs from our current handling of multi-polygons, where we "exploded" each polygon into its own feature, and copied the properties of each (as there was no official handling of multi-polygons previously). We should update to be compliant. Tangram already handles the new multi-polygon encoding so no client changes are needed on that side (style rules should be compatible with either method).

mapbox/vector-tile-spec#36

@nvkelso nvkelso added the ready label Oct 23, 2015
rmarianski added a commit that referenced this issue Oct 27, 2015
Refs #20

To handle multipolygons, instead of cloning features with each part, the
winding order of the parts will signal when a new multipolygon starts.
@nvkelso
Copy link
Member

nvkelso commented Oct 30, 2015

@bcamper Will this change work with older v0.3 and earlier Tangrams or does it require the new v0.4 release?

@bcamper
Copy link
Contributor Author

bcamper commented Oct 30, 2015

We should test it but as far as I am aware it should not require any Tangram changes. For decoding MVT tiles we use Mapbox's own JS library. Related, for non-tiled datasources, we do the same poly/ring detection on data generated by Mapbox's geojson-vt (which also outputs multi-polygons in this flattened format), see https://github.com/tangrams/tangram/blob/master/src/sources/geojson.js#L159.

@rmarianski
Copy link
Member

This fix didn't end up getting deployed with the latest update. I added tickets to the appropriate chef repos to ensure we get the latest version of mapbox-vector-tile deployed in the future.

tilezen/chef-tilequeue#12
tilezen/chef-tileserver#1

@nvkelso nvkelso added this to the v0.5.0 milestone Nov 3, 2015
@nvkelso
Copy link
Member

nvkelso commented Nov 3, 2015

Once deployed, how can we verify the fix?

@bcamper
Copy link
Contributor Author

bcamper commented Nov 3, 2015

We should identify a few multipolygon features and compare before/after to make sure they have not changed. I believe The Lake in Central Park is one (we had issues with it previously). Any good candidates?

@nvkelso
Copy link
Member

nvkelso commented Nov 11, 2015

@rmarianski What further testing besides #402 do we need here?

@rmarianski
Copy link
Member

@nvkelso can we point an older version of tangram at the dev vector tiles to see if it looks ok?

@bcamper
Copy link
Contributor Author

bcamper commented Nov 11, 2015

I don't believe it's Tangram version dependent...?

On Wed, Nov 11, 2015 at 4:23 PM, Robert Marianski [email protected]
wrote:

@nvkelso https://github.com/nvkelso can we point an older version of
tangram at the dev vector tiles to see if it looks ok?


Reply to this email directly or view it on GitHub
#20 (comment)
.

@rmarianski
Copy link
Member

Did the decoding library version in tangram change at some point? It sounded like there was some question as to whether this change would impact older versions?

If not, then we should be ok.

@bcamper
Copy link
Contributor Author

bcamper commented Nov 11, 2015

The decoding library is Mapbox's, and should be compatible with old and new encoding methods. If we want to verify, all tangram releases are available by version number: mapzen.com/tangram/[version]/tangram.[min | debug].js

@bcamper
Copy link
Contributor Author

bcamper commented Nov 12, 2015

I was wrong, the Mapbox decoding lib doesn't provide this! This is fixed in Tangram here, when we are ready to merge:

https://github.com/tangrams/tangram/compare/decode-multipolygon

@nvkelso nvkelso removed this from the v0.7.0 milestone Jan 8, 2016
@nvkelso
Copy link
Member

nvkelso commented Feb 24, 2016

@rmarianski Is this part of v0.8 work?

@rmarianski
Copy link
Member

I vote for deploying with v0.8. All the work here is done and just needs to be deployed.

We've verified that the new winding order looks to be correct in dev now, as well as the issue with rounding vs truncating not making things worse in tangram.

@nvkelso nvkelso modified the milestones: v0.8.0, v0.9.0 Feb 24, 2016
@nvkelso
Copy link
Member

nvkelso commented Feb 24, 2016

Cool, moving into v0.8

@nvkelso
Copy link
Member

nvkelso commented Feb 26, 2016

Over to @bcamper to confirm this works to spec before taking this to prod.

@bcamper
Copy link
Contributor Author

bcamper commented Feb 26, 2016

Verified in dev!

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

No branches or pull requests

3 participants