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

Implement tiles for Azure Maps #1709

Merged
merged 6 commits into from
Jan 18, 2021
Merged

Conversation

kopytjuk
Copy link
Contributor

@kopytjuk kopytjuk commented Jan 10, 2021

image

Code:

import matplotlib.pyplot as plt
import cartopy.crs as ccrs

from cartopy.io.img_tiles import AzureMapsTiles

tiler = AzureMapsTiles("your-key", tileset_id="microsoft.base.road")
mercator = tiler.crs

fig = plt.figure()
ax = fig.add_subplot(1, 1, 1, projection=mercator)
ax.set_extent([	9.206600, 9.240600, 49.135002, 49.1552], crs=ccrs.Geodetic())

ax.add_image(tiler, 15)

ax.plot([9.219108094488016], [49.141744935977776], "r+", label="Kilianskirche", transform=ccrs.Geodetic())

ax.set_title("Heilbronn, Germany\nwith microsoft.base.road tileset")
ax.legend()

plt.show()

Rationale

Easy access to Azure Maps tile images for plotting maps.

Implications

An additional CI-variable AZURE_MAPS_SUBSCRIPTION_KEY has to be set for tests.

lib/cartopy/io/img_tiles.py Outdated Show resolved Hide resolved
lib/cartopy/io/img_tiles.py Outdated Show resolved Hide resolved
lib/cartopy/io/img_tiles.py Outdated Show resolved Hide resolved
lib/cartopy/io/img_tiles.py Outdated Show resolved Hide resolved
lib/cartopy/io/img_tiles.py Outdated Show resolved Hide resolved
lib/cartopy/tests/test_img_tiles.py Outdated Show resolved Hide resolved
lib/cartopy/tests/test_img_tiles.py Outdated Show resolved Hide resolved
@SciTools-assistant SciTools-assistant added the Blocked: CLA needed See https://scitools.org.uk. Submit the form at: https://scitools.org.uk/cla/v4/form label Jan 10, 2021
lib/cartopy/io/img_tiles.py Outdated Show resolved Hide resolved
lib/cartopy/io/img_tiles.py Outdated Show resolved Hide resolved
@SciTools-assistant SciTools-assistant removed the Blocked: CLA needed See https://scitools.org.uk. Submit the form at: https://scitools.org.uk/cla/v4/form label Jan 10, 2021
lib/cartopy/io/img_tiles.py Outdated Show resolved Hide resolved
lib/cartopy/io/img_tiles.py Outdated Show resolved Hide resolved
lib/cartopy/tests/test_img_tiles.py Outdated Show resolved Hide resolved
Co-authored-by: Elliott Sales de Andrade <[email protected]>
@QuLogic
Copy link
Member

QuLogic commented Jan 18, 2021

Thanks for your contribution!

@QuLogic QuLogic added this to the 0.19 milestone Jan 18, 2021
@QuLogic QuLogic merged commit efd15f1 into SciTools:master Jan 18, 2021
@kopytjuk kopytjuk deleted the azuremaps-tiles branch January 19, 2021 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants