-
Notifications
You must be signed in to change notification settings - Fork 370
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
Updated Ordnance Survey img_tile to new OS API #2105
Conversation
CLA signed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks pretty good I think, I don't have an API key to test out locally and not sure if we have one on the remote CI... I put a few comments for things to consider, but those could always be follow-up PRs to extend the capability too if that is of interest.
The docstring of the class should be updated to inform users of what the new specifications and links are. Some of the current links are broken.
https://osdatahub.os.uk/docs/wmts/technicalSpecification
f'tilematrixSet=EPSG%3A3857&style=true&layer={self.layer}%203857&' | ||
f'SERVICE=WMTS&REQUEST=GetTile&format=image%2Fpng&' | ||
f'TileMatrix=EPSG%3A3857%3A{z}&TileRow={y}&TileCol={x}') | ||
return f"https://api.os.uk/maps/raster/v1/zxy/" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like they do still have the WMTS endpoint with query parameters if you want to use that still?
https://api.os.uk/maps/raster/v1/wmts?request=getcapabilities&key=
from: https://osdatahub.os.uk/docs/wmts/technicalSpecification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the WMTS endpoint is still available. I thought the zxy endpoint was a bit more concise, so I went with that instead. Do you think it'd be better to keep it as a WMTS endpoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@greglucas just following up on this - would a WMTS be better than a ZXY endpoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, I don't think we need to at this point. If you or someone else wants more flexibility in the future that can be a follow-up PR.
Thanks @dchirst! |
Rationale
The Ordnance Survey API has been updated and refactored, breaking the original API that Cartopy used (#2036). Cartopy needs to be brought up to date with OS' newest APIs.
Implications
The Ordnance Survey img tile should now work!
The new api does not support the Night layer, and only supports Leisure for EPSG:27700. Therefore, these 2 map styles will no longer work with the new API in Cartopy (I only implemented support for EPSG:3857).