WIP: Support for tile services in local coordinate systems #120
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:
projecttile
rather thanmercantile
for 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
pyproj
andowslib
are necessary.scripts/parse_leaflet_providers.py
I 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 dependencypyproj
for 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
.owslib
to 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_level
to avoid getting invalid URLs (doesn't that come up currently, if you plot a very small feature?)mercantile
->projecttile
for.tiles
s_crs
forwarp_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
.