Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Google map tiles in Cartopy

It seems fetching Google tiles directly isn't supported very well by Google via normal API access (even with an API key). Hence, cartopy.io.img_tiles.GoogleTiles doesn't work well as it is able to fetch tiles only for one or two trials after which the requests start getting denied by Google.

What's the recommended way of using Google Maps with Cartopy?

Thanks

like image 605
virtualmic Avatar asked Dec 23 '18 06:12

virtualmic


1 Answers

Instead of using Google map tiles, I am using Mapbox static tiles API and it seems to be working well. They are currently offering 50,000 calls to the API for free (even for commercial use).

I have monkey patched GoogleWTS.get_image function as described here to update the URL and storing tiles in a local cache (which I delete every week to get fresh data): https://github.com/SciTools/cartopy/issues/1341#issuecomment-511116060.

like image 106
virtualmic Avatar answered Sep 28 '22 21:09

virtualmic