You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The zoom 0 parent tile case was fixed in #130, the changelog entry from that PR says:
The Tile constructor in mercantile 2.0 will refuse to make tiles with X and Y
indexes outside of the range 0 <= value <= 2 ** zoom. It will also require
indexes to be integers.
But this constraint actually isn't true, here is a really easy way to break it:
The easiest way to make the aforementioned constraint actually work is to prevent users from creating tiles with a negative zoom level, and in my opinion this is really what the constraint is trying to do. Mercantile is a library for Spherical mercator coordinate and tile utilities. By definition the lowest zoom level in the mercator grid is zoom 0, at which point a single tile covers the the entire world. So even allowing users to provide a negative zoom seems to break the original intention of the library, and can lead to some very unintuitive behavior that doesn't align with how the mercator grid works in reality:
tile=mercantile.Tile(x=0, y=0, z=-1)
children=mercantile.children(tile)
# Mercator grid by definition only has a single Z0 tileassertlen(children) ==4
The text was updated successfully, but these errors were encountered:
This was first brought up in #122 (comment) which mentions the use case of calculating the parent of a zoom 0 tile:
The zoom 0 parent tile case was fixed in #130, the changelog entry from that PR says:
But this constraint actually isn't true, here is a really easy way to break it:
The easiest way to make the aforementioned constraint actually work is to prevent users from creating tiles with a negative zoom level, and in my opinion this is really what the constraint is trying to do. Mercantile is a library for
Spherical mercator coordinate and tile utilities
. By definition the lowest zoom level in the mercator grid is zoom 0, at which point a single tile covers the the entire world. So even allowing users to provide a negative zoom seems to break the original intention of the library, and can lead to some very unintuitive behavior that doesn't align with how the mercator grid works in reality:The text was updated successfully, but these errors were encountered: