From 4149002b6bc25f81325bba6beb4311ec68a3b313 Mon Sep 17 00:00:00 2001 From: Rich Signell Date: Mon, 28 Apr 2014 07:37:02 -0400 Subject: [PATCH 1/4] adding Mizurski's Terrain for the US --- lib/cartopy/io/img_tiles.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/cartopy/io/img_tiles.py b/lib/cartopy/io/img_tiles.py index ca42b280f..43f337a4c 100755 --- a/lib/cartopy/io/img_tiles.py +++ b/lib/cartopy/io/img_tiles.py @@ -223,7 +223,14 @@ def _image_url(self, tile): x, y, z = tile url = 'http://a.tile.openstreetmap.org/%s/%s/%s.png' % (z, x, y) return url - + +class StamenTerrain(GoogleTiles): + # http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames + # http://mike.teczno.com/notes/osm-us-terrain-layer/background.html + def _image_url(self, tile): + x, y, z = tile + url = 'http://tile.stamen.com/terrain-background/%s/%s/%s.png' % (z, x, y) + return url class QuadtreeTiles(GoogleTiles): """ From 9c904626d2cf95bc730300f0b92ff13fa8499428 Mon Sep 17 00:00:00 2001 From: Rich Signell Date: Tue, 29 Apr 2014 07:02:08 -0400 Subject: [PATCH 2/4] updated for PEP8 compliance --- build.out | 4 ++++ lib/cartopy/io/img_tiles.py | 26 ++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 build.out diff --git a/build.out b/build.out new file mode 100644 index 000000000..912220cca --- /dev/null +++ b/build.out @@ -0,0 +1,4 @@ +running build +running build_py +running build_ext +cythoning lib/cartopy/trace.pyx to lib/cartopy\trace.cpp diff --git a/lib/cartopy/io/img_tiles.py b/lib/cartopy/io/img_tiles.py index 43f337a4c..4a6e08b22 100755 --- a/lib/cartopy/io/img_tiles.py +++ b/lib/cartopy/io/img_tiles.py @@ -223,15 +223,33 @@ def _image_url(self, tile): x, y, z = tile url = 'http://a.tile.openstreetmap.org/%s/%s/%s.png' % (z, x, y) return url - + + class StamenTerrain(GoogleTiles): - # http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames - # http://mike.teczno.com/notes/osm-us-terrain-layer/background.html + ''' + Terrain tiles defined for the continental United States, and include land + color and shaded hills. The land colors are a custom palette developed by + Gem Spear for the National Atlas 1km land cover data set, which defines + twenty-four land classifications including five kinds of forest, + combinations of shrubs, grasses and crops, and a few tundras and wetlands. + The colors are at their highest contrast when fully zoomed-out to the + whole U.S., and they slowly fade out to pale off-white as you zoom in to + leave room for foreground data and break up the weirdness of large areas + of flat, dark green. + + Additional info: + http://mike.teczno.com/notes/osm-us-terrain-layer/background.html + http://maps.stamen.com/#terrain/12/37.6902/-122.3600 + http://wiki.openstreetmap.org/wiki/List_of_OSM_based_Services + https://github.com/migurski/DEM-Tools + ''' def _image_url(self, tile): x, y, z = tile - url = 'http://tile.stamen.com/terrain-background/%s/%s/%s.png' % (z, x, y) + url = 'http://tile.stamen.com/terrain-background/%s/%s/%s.png' % ( + z, x, y) return url + class QuadtreeTiles(GoogleTiles): """ Implements web tile retrieval using the Microsoft WTS quadkey coordinate From 254a6fe7309ffba78b5891f382e0f877807cdad5 Mon Sep 17 00:00:00 2001 From: Rich Signell Date: Tue, 29 Apr 2014 07:18:05 -0400 Subject: [PATCH 3/4] sigh. removed trailing whitespace --- lib/cartopy/io/img_tiles.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/cartopy/io/img_tiles.py b/lib/cartopy/io/img_tiles.py index 4a6e08b22..73a281a5a 100755 --- a/lib/cartopy/io/img_tiles.py +++ b/lib/cartopy/io/img_tiles.py @@ -226,30 +226,30 @@ def _image_url(self, tile): class StamenTerrain(GoogleTiles): - ''' - Terrain tiles defined for the continental United States, and include land - color and shaded hills. The land colors are a custom palette developed by - Gem Spear for the National Atlas 1km land cover data set, which defines - twenty-four land classifications including five kinds of forest, - combinations of shrubs, grasses and crops, and a few tundras and wetlands. - The colors are at their highest contrast when fully zoomed-out to the - whole U.S., and they slowly fade out to pale off-white as you zoom in to - leave room for foreground data and break up the weirdness of large areas + """ + Terrain tiles defined for the continental United States, and include land + color and shaded hills. The land colors are a custom palette developed by + Gem Spear for the National Atlas 1km land cover data set, which defines + twenty-four land classifications including five kinds of forest, + combinations of shrubs, grasses and crops, and a few tundras and wetlands. + The colors are at their highest contrast when fully zoomed-out to the + whole U.S., and they slowly fade out to pale off-white as you zoom in to + leave room for foreground data and break up the weirdness of large areas of flat, dark green. - - Additional info: + + Additional info: http://mike.teczno.com/notes/osm-us-terrain-layer/background.html http://maps.stamen.com/#terrain/12/37.6902/-122.3600 - http://wiki.openstreetmap.org/wiki/List_of_OSM_based_Services - https://github.com/migurski/DEM-Tools - ''' + http://wiki.openstreetmap.org/wiki/List_of_OSM_based_Services + https://github.com/migurski/DEM-Tools + """ def _image_url(self, tile): x, y, z = tile url = 'http://tile.stamen.com/terrain-background/%s/%s/%s.png' % ( z, x, y) return url - + class QuadtreeTiles(GoogleTiles): """ Implements web tile retrieval using the Microsoft WTS quadkey coordinate From 998a7905500952947f9ae36c567d674fb23f8cf8 Mon Sep 17 00:00:00 2001 From: Rich Signell Date: Tue, 29 Apr 2014 07:50:26 -0400 Subject: [PATCH 4/4] sobbing now. removed more trailing whitespace There has to be a better way. --- lib/cartopy/io/img_tiles.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cartopy/io/img_tiles.py b/lib/cartopy/io/img_tiles.py index 73a281a5a..9dca16c4e 100755 --- a/lib/cartopy/io/img_tiles.py +++ b/lib/cartopy/io/img_tiles.py @@ -223,8 +223,8 @@ def _image_url(self, tile): x, y, z = tile url = 'http://a.tile.openstreetmap.org/%s/%s/%s.png' % (z, x, y) return url - - + + class StamenTerrain(GoogleTiles): """ Terrain tiles defined for the continental United States, and include land