WIP: Support for tile services in local coordinate systems#120
Open
Huite wants to merge 4 commits intogeopandas:mainfrom
Open
WIP: Support for tile services in local coordinate systems#120Huite wants to merge 4 commits intogeopandas:mainfrom
Huite wants to merge 4 commits intogeopandas:mainfrom
Conversation
Note: not a 100% of them work. The issue appears to be some inconsistency in the URL (which does not match PDOK's own description...). This appears to be rather common case with these WMTS services. In this specific case, however, owslib IS able to fetch a tile, so there's like something that can be done. There are also cases where the WMTS URL structure looks nothing like what owslib expects. I suppose manual tweaking is required in that case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This currently adds:
projecttilerather thanmercantilefor some tile handling, located here: https://github.com/Huite/projecttileIt doesn't have dependencies currently, except if you'd want to generate a list of providers yourself in which case
pyprojandowslibare necessary.scripts/parse_leaflet_providers.pyI initially hoped that I wouldn't have to explicitly set all providers. My hope was that you could just present a WMTS url, take a peek at what it's serving, and pick a layer. There's some issues with this:
owslib, although it's not a very heavy dependencypyprojfor one the fly reprojection of the bounding box, although since rasterio is already required it's probably also not a big deal(?)owslib, so I couldn't get the retryer to work; you'd have to useowslib, but it does its own things withrequests.owslibto fetch the tile.Instead, I've now chosen to keep it a little simpler and more explicit by generating a list of providers. A user can just choose a provider, or create one, and it should work. I think the upshot is also that there's very fine control: it the WMTS URL doesn't comply to standards, you can just edit the URL template to whatever works.
WIP
I haven't added any tests yet, because I'd like to get a little bit feedback. To make it maximally clear what changes are necessary, I've just copy-pasted and edited some functions and appended
_wmts. This is not my preferred interface, it's just for communications purposes.Maybe it's most straightforward to create another TileProvider,
WebMapTileServiceProvider, and dispatch on the type?In overview, the changes required:
_clamp zoom_levelto avoid getting invalid URLs (doesn't that come up currently, if you plot a very small feature?)mercantile->projecttilefor.tiless_crsforwarp_tiles?If you do make a decision on if and how to include these changes, I'll be happy to setup CI properly, also for
projecttile.