-
Notifications
You must be signed in to change notification settings - Fork 26
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
Quadkey support #19
Comments
This comment has been minimized.
This comment has been minimized.
@geospatial-jeff (Not sure if this is the best place to post this) This is something I'm quite interested in, we have been looking at how to make QuadKeys from the NZTM tiling scheme. there are a few issues with NZTM when it comes to quadkeys,
To work around these two issues we have had two thoughts Create a new TileMatrixSet Create a offset based QuadKey mapping for NZTM, Most of NZTM increases by 2x and is almost square, we can take z0 which is 2x4 and make it a virtual 4x4 grid, then we can zoom out and create a virtual z-1 (2x2) and z-2 (1x1) which would then perfectly map to quadkeys,
Then we have QuadKeys that could be "valid" or "invalid", the TileMatrixSet knows if they are valid or not, This still leaves the problem of z8-z9 transition, the z8 -> z9 transition means that a z9 tile may have 4 z8 tiles as it's parent so any math that creates a covering of a tile >= z9 may need up to 4 parent tiles. what this means in practice is we can use QuadKeys to easily reference anything between z0 and z8, then possibly have to use 4 quad keys for anything in >= z9. We have currently gone with the second option (example source: https://github.com/linz/basemaps/blob/master/packages/geo/src/tms.quad.key.ts) But we are open to better solutions! |
@blacha as you mention the 2.5x zoom fundamentally breaks the math behind quadtrees so I think the approach you have come up with is as good as you can get. Creating an offset quadkey is a clever way of handling the differing matrix dimensions. |
I think we don't have to decide yet if we always want to support quadkeys. We could just implement a function that checks if a custom Tile Matrix Set supports quadkeys. If not we just raise an |
Just to follow up on this, we ended up deciding that it was worth the effort to replace the old tile matrix set with one that is quad key compatible, the 2.5x scale jumps also caused issues with things like COG creation with GDAL (this is now fixed) So now we have:
|
closed by #56 |
Tile matrix sets have the notion of X/Y/Z coordinates so technically we can generate a quadkey. However not all tile matrix sets have 4 children per parent which breaks the parent/child hierarchy. A good example of this is Canadian NAD83 LCC.
This all being said, I do think there are many benefits to supporting quadkeys:
I think this comes down to whether or not morecantile will support tile matrices which don't decimate by a factor of 4 (width or height is
2**zoom
). From the README, docstrings, and general usage my thought is that it shouldn't, but that isn't entirely clear.The text was updated successfully, but these errors were encountered: