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

Further places layer plastic surgery #1729

Closed
nvkelso opened this issue Dec 13, 2018 · 4 comments
Closed

Further places layer plastic surgery #1729

nvkelso opened this issue Dec 13, 2018 · 4 comments

Comments

@nvkelso
Copy link
Member

nvkelso commented Dec 13, 2018

Originally posted by @nvkelso in https://github.com/tilezen/vector-datasource/issue_comments#issuecomment-447149749

For zoom 0 we're still including too many countries. The same is true for zooms 1 and 2. Addressing this will have significant file size savings.

Seems like we're doing 512 min_zoom math instead of 256 math? Like at zoom 0 we should only see features with min_zoom < 1, but many 1.x graded features are included.

New:
image

Old:
image

image
`

Poland is included at zoom 2, but it's min_zoom is 3.

image

@nvkelso nvkelso added this to the v1.7.0 milestone Dec 13, 2018
@nvkelso
Copy link
Member Author

nvkelso commented Dec 13, 2018

Probably this line can change:

https://github.com/tilezen/vector-datasource/blob/master/vectordatasource/transform.py#L8132

        if min_zoom is not None and min_zoom <= nominal_zoom + 1:

to:

       if min_zoom is not None and min_zoom <= nominal_zoom + 0.5:

Which would better match how Natural Earth is curated for min_zoom (which will remove the 1.7 features above from the zoom 1 tile, but they'll show up in zoom 2 tile and collide out min_zoom 2.0 features – good). There are some x.5 curated features in Natural Earth.

This would also force the Poland example into zoom 3 tile.

@zerebubuth
Copy link
Member

Seems like we're doing 512 min_zoom math instead of 256 math? Like at zoom 0 we should only see features with min_zoom < 1

Our 512px tiles are designed to contain the same content as the 4 z+1 256px tiles which cover the same area. Therefore, the nominal zoom (i.e: style zoom) of a 512px tile is z+1. So the nominal zoom of the 0/0/0 512px tile is 1.

Also, because clients typically overzoom a zoom N tile for zooms <N+1, we designed the tile to contain things with a min zoom up to N+1. Therefore, the 0/0/0 tile would contain, for example, features with a min_zoom of 1.9 because the 0/0/0 tile is the one being displayed when the nominal zoom is 1.9.

I'm happy to make a change as suggested (basically dropping a whole bunch of features needed for overzooming), but we should be aware that it'll be a major change compared with how we've done things in the past. Although it might not matter, if clients aren't evaluating fractional zooms anyway.

@nvkelso
Copy link
Member Author

nvkelso commented Dec 14, 2018

Turns out Tangram doesn't evaluate fractional zooms. I still think it's useful to overstuff the layer a little bit, but for the places layer I think the file size savings are more important / values with x.6 and x.7 etc min_zoom would probably need much more sophisticated runtime label logic than is generally available, too?

The reason zoom 0 is still big is continent and ocean labels (in water and earth layers), adding a fix for those now to put them in zoom 1 instead (which is still MINOR version compliant change).

@nvkelso
Copy link
Member Author

nvkelso commented Dec 21, 2018

Verified, closing.

@nvkelso nvkelso closed this as completed Dec 21, 2018
@ghost ghost removed the in review label Dec 21, 2018
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

2 participants