Skip to content
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

Additional support for LINZ Maps Tiles #2048

Merged
merged 6 commits into from
Aug 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lib/cartopy/io/img_tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,3 +682,19 @@ def _image_url(self, tile):
f'https://atlas.microsoft.com/map/tile?'
f'api-version={self.api_version}&tilesetId={self.tileset_id}&'
f'x={x}&y={y}&zoom={z}&subscription-key={self.subscription_key}')

class LINZMapsTiles(GoogleWTS):
aluthfian marked this conversation as resolved.
Show resolved Hide resolved

aluthfian marked this conversation as resolved.
Show resolved Hide resolved
def __init__(self, subscription_key, layer_id, api_version="v4", desired_tile_form='RGB', cache=False):
aluthfian marked this conversation as resolved.
Show resolved Hide resolved

aluthfian marked this conversation as resolved.
Show resolved Hide resolved
super().__init__(desired_tile_form=desired_tile_form, cache=cache)
self.subscription_key = subscription_key
self.layer_id = layer_id
self.api_version = api_version

aluthfian marked this conversation as resolved.
Show resolved Hide resolved
def _image_url(self, tile):
x, y, z = tile
return (
f'https://tiles-a.koordinates.com/services;'
f'key={self.subscription_key}/tiles/{self.api_version}/'
f'layer={self.layer_id}/EPSG:3857/{z}/{x}/{y}.png')
aluthfian marked this conversation as resolved.
Show resolved Hide resolved