From 272c5089d83c134932c3cff50e6237dab3d0cafb Mon Sep 17 00:00:00 2001 From: manuel Date: Fri, 26 Jan 2018 20:22:55 +0100 Subject: [PATCH] Add Stamen Toner and Watercolor image tiles --- lib/cartopy/io/img_tiles.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/cartopy/io/img_tiles.py b/lib/cartopy/io/img_tiles.py index 0e68bbe1f..7fd09fc17 100644 --- a/lib/cartopy/io/img_tiles.py +++ b/lib/cartopy/io/img_tiles.py @@ -275,6 +275,30 @@ def _image_url(self, tile): return url +class StamenToner(GoogleTiles): + """ + Implements web tile retrieval from Stamen Toner maps + + """ + def _image_url(self, tile): + x, y, z = tile + url = 'http://tile.stamen.com/toner/%s/%s/%s.png' % ( + z, x, y) + return url + + +class StamenWatercolor(GoogleTiles): + """ + Implements web tile retrieval from Stamen Watercolor maps + + """ + def _image_url(self, tile): + x, y, z = tile + url = 'http://tile.stamen.com/watercolor/%s/%s/%s.png' % ( + z, x, y) + return url + + class MapboxTiles(GoogleTiles): """ Implement web tile retrieval from Mapbox.