[tilestache] 01/04: Imported Upstream version 1.51.3

Bas Couwenberg sebastic at debian.org
Mon Oct 31 06:51:13 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository tilestache.

commit 092d2d4d988ff24c500fefb0bd0707a53f9d3621
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Mon Oct 31 07:47:10 2016 +0100

    Imported Upstream version 1.51.3
---
 CHANGELOG                |  3 +++
 TileStache/Core.py       |  5 +----
 TileStache/Mapnik.py     |  9 ++++++--
 TileStache/Pixels.py     |  8 ++++++-
 TileStache/VERSION       |  2 +-
 man/tilestache-compose.1 | 58 ++++++++++++++++++++++++++++++++++++++++++++++++
 man/tilestache-list.1    | 40 +++++++++++++++++++++++++++++++++
 man/tilestache-seed.1    |  4 ++--
 tests/cache_tests.py     |  7 ++++--
 tests/provider_tests.py  |  5 ++++-
 tests/vectiles_tests.py  |  4 +++-
 tests/vector_tests.py    |  5 ++++-
 12 files changed, 135 insertions(+), 15 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index f0af519..edcc9e6 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+2016-10-30: 1.51.3
+- Fixes for debian packaging
+
 2016-10-27: 1.51.2
 - Adding support for .pbf format for Mapbox Vector Tiles
 - Configuration can be passed as a dictionary in addition to path to JSON file.
diff --git a/TileStache/Core.py b/TileStache/Core.py
index b1e5776..a404bbe 100644
--- a/TileStache/Core.py
+++ b/TileStache/Core.py
@@ -755,15 +755,12 @@ def _preview(layer):
     <script type="text/javascript" defer>
     <!--
         var template = '{Z}/{X}/{Y}.%(ext)s';
-        var provider = new com.modestmaps.TemplatedMapProvider(template);
-        var map = new MM.Map('map', provider, null, [
+        var map = new MM.Map('map', new MM.TemplatedLayer(template), null, [
             new MM.TouchHandler(),
             new MM.DragHandler(),
             new MM.DoubleClickHandler()
         ]);
         map.setCenterZoom(new com.modestmaps.Location(%(lat).6f, %(lon).6f), %(zoom)d);
-        // hashify it
-        new MM.Hash(map);
     //-->
     </script>
 </body>
diff --git a/TileStache/Mapnik.py b/TileStache/Mapnik.py
index fff47ac..8c14299 100644
--- a/TileStache/Mapnik.py
+++ b/TileStache/Mapnik.py
@@ -151,8 +151,13 @@ class ImageProvider:
                 # always release the lock
                 global_mapnik_lock.release()
 
-        img = Image.frombytes('RGBA', (width, height), img.tostring())
-
+        if hasattr(Image, 'frombytes'):
+            # Image.fromstring is deprecated past Pillow 2.0
+            img = Image.frombytes('RGBA', (width, height), img.tostring())
+        else:
+            # PIL still uses Image.fromstring
+            img = Image.fromstring('RGBA', (width, height), img.tostring())
+        
         logging.debug('TileStache.Mapnik.ImageProvider.renderArea() %dx%d in %.3f from %s', width, height, time() - start_time, self.mapfile)
 
         return img
diff --git a/TileStache/Pixels.py b/TileStache/Pixels.py
index b3c74fa..399d0d3 100644
--- a/TileStache/Pixels.py
+++ b/TileStache/Pixels.py
@@ -101,7 +101,13 @@ def apply_palette(image, palette, t_index):
 
         indexes.append(mapping[(r, g, b)])
 
-    output = Image.frombytes('P', image.size, ''.join(indexes))
+    if hasattr(Image, 'frombytes'):
+        # Image.fromstring is deprecated past Pillow 2.0
+        output = Image.frombytes('P', image.size, ''.join(indexes))
+    else:
+        # PIL still uses Image.fromstring
+        output = Image.fromstring('P', image.size, ''.join(indexes))
+ 
     bits = int(ceil(log(len(palette)) / log(2)))
 
     palette += [(0, 0, 0)] * (256 - len(palette))
diff --git a/TileStache/VERSION b/TileStache/VERSION
index aa618f0..f8997b4 100644
--- a/TileStache/VERSION
+++ b/TileStache/VERSION
@@ -1 +1 @@
-1.51.2
+1.51.3
diff --git a/man/tilestache-compose.1 b/man/tilestache-compose.1
new file mode 100644
index 0000000..347b4d8
--- /dev/null
+++ b/man/tilestache-compose.1
@@ -0,0 +1,58 @@
+.TH TILESTACHE-COMPOSE 1 "Nov 10, 2010"
+.SH NAME
+tilestache-compose \- set a map coverage area
+.SH SYNOPSIS
+.B tilestache-compose
+.RI [ options ] " file" ...
+.SH DESCRIPTION
+This manual page documents briefly the \fBtilestache-compose\fR command.
+.PP
+There are three ways to set a map coverage area.
+.PP
+1) Center, zoom, and dimensions: create a map of the specified size,
+centered on a given geographical point at a given zoom level:
+.PP
+   tilestache-compose.py \-c config.json \-l layer-name \-d 800 800 \-n 37.8 \-122.3 \-z 11 out.jpg
+.PP
+2) Extent and dimensions: create a map of the specified size that
+adequately covers the given geographical extent:
+.PP
+   tilestache-compose.py \-c config.json \-l layer-name \-d 800 800 \-e 36.9 \-123.5 38.9 \-121.2 out.png
+.PP
+3) Extent and zoom: create a map at the given zoom level that covers
+the precise geographical extent, at whatever pixel size is necessary:
+.PP
+   tilestache-compose.py \-c config.json \-l layer-name \-e 36.9 \-123.5 38.9 \-121.2 \-z 9 out.jpg
+.SH OPTIONS
+.TP
+\fB-c\fR, \fB\-\-config\fR \fIfile\fR
+Path to configuration file.
+.TP
+\fB-l\fR, \fB\-\-layer\fR \fIlayer\fR
+Layer name from configuration.
+.TP
+\fB-n\fR, \fB\-\-center\fR \fIlat lon\fR
+Geographic center of map.
+.TP
+\fB-e\fR, \fB\-\-extent\fR \fIlat lon lat lon\fR
+Geographic extent of map.
+.TP
+\fB-z\fR, \fB\-\-zoom\fR \fIlevel\fR
+Zoom level.
+.TP
+\fB-d\fR, \fB\-\-dimensions\fR \fIwidth height\fR
+Pixel width, height of output image.
+.TP
+\fB-v\fR, \fB\-\-verbose\fR
+Make a bunch of noise.
+.TP
+\fB-i\fR, \fB\-\-include-paths\fR \fIpaths\fR
+Add the following colon-separated list of paths to Python's include path (aka sys.path)
+.TP
+\fB-x\fR, \fB\-\-ignore-cached\fR
+Re-render every tile, whether it is in the cache already or not.
+.TP
+\fB-h\fR, \fB\-\-help\fR
+Show summary of options.
+.SH AUTHOR
+\fBTileStache\fR was written by Michal Migurski <mike at stamen.com>.
diff --git a/man/tilestache-list.1 b/man/tilestache-list.1
new file mode 100644
index 0000000..44462a4
--- /dev/null
+++ b/man/tilestache-list.1
@@ -0,0 +1,40 @@
+.TH TILESTACHE-LIST 1 "Nov 10, 2010"
+.SH NAME
+tilestache-list \- generates list of tiles based on geographic or other criteria
+.SH SYNOPSIS
+.B tilestache-list
+.RI [ options ]
+.RI [ zoom... ]
+.SH DESCRIPTION
+This manual page documents briefly the \fBtilestache-list\fR command.
+.PP
+\fBtilestache\-list\fP generates a list of tiles based on geographic or
+other criteria.
+.PP
+No images are created and no Tilestache configuration is read, but a list
+of tile coordinates in Z/X/Y form compatible with
+\fBtilestache-seed \-\-tile-list\fP output.
+.PP
+Example:
+.PP
+    tilestache\-list.py \-b 52.55 13.28 52.46 13.51 11 12 13
+.PP
+Protip: seed a cache in parallel on 8 CPUs with split and xargs like this:
+.PP
+    tilestache\-list.py 12 13 14 15 | split \-l 20 \- tiles/list\-
+    ls \-1 tiles/list\-* | xargs \-n1 \-P8 tilestache\-seed.py \-c tilestache.cfg \-l osm \-\-tile\-list
+.SH OPTIONS
+.TP
+\fB-b\fR, \fB\-\-bbox\fR \fIlat lon lat lon\fR
+Bounding box in floating point geographic coordinates:
+south west north east.
+.TP
+\fB-p\fR, \fB\-\-padding\fR \fInumber\fR
+Extra margin of tiles to add around bounded area.
+.TP
+\fB\-\-from\-mbtiles\fR \fIfile\fR
+Optional input file for tiles, will be read as an MBTiles 1.1 tileset.
+See http://mbtiles.org for more information.
+Overrides \-\-bbox and \-\-padding.
+.SH AUTHOR
+\fBTileStache\fR was written by Michal Migurski <mike at stamen.com>.
diff --git a/man/tilestache-seed.1 b/man/tilestache-seed.1
index 97d1691..7570548 100644
--- a/man/tilestache-seed.1
+++ b/man/tilestache-seed.1
@@ -54,13 +54,13 @@ More information in http://tilestache.org/doc/#caches.
 Optional output file for tiles, will be created as an MBTiles 1.1 tileset. See http://mbtiles.org for more information.
 .TP
 .B \-\-from\-mbtiles
-Optional input file for tiles, will be read as an MBTiles 1.1 tileset. See http://mbtiles.org for more information. Overrides --extension, --bbox and --padding (this may change).
+Optional input file for tiles, will be read as an MBTiles 1.1 tileset. See http://mbtiles.org for more information. Overrides \-\-extension, \-\-bbox and \-\-padding (this may change).
 .TP
 .B \-\-to-s3
 Optional output bucket for tiles, will be populated with tiles in a standard Z/X/Y layout. Three required arguments: AWS access-key, secret, and bucket name.
 .TP
 .B \-\-tile\-list
-Optional file of tile coordinates, a simple text list of Z/X/Y coordinates. Overrides --bbox and --padding.
+Optional file of tile coordinates, a simple text list of Z/X/Y coordinates. Overrides \-\-bbox and \-\-padding.
 .TP
 .B \-\-error\-list
 Optional file of failed tile coordinates, a simple text list of Z/X/Y coordinates. If provided, failed tiles will be logged to this file instead of stopping tilestache-seed.
diff --git a/tests/cache_tests.py b/tests/cache_tests.py
index 87a6eea..66e2e68 100644
--- a/tests/cache_tests.py
+++ b/tests/cache_tests.py
@@ -1,7 +1,10 @@
-from unittest import TestCase
-from . import utils
+import os
+from unittest import TestCase, skipIf
 import memcache
+from . import utils
+
 
+ at skipIf('OFFLINE_TESTS' in os.environ, "Offline tests only")
 class CacheTests(TestCase):
     '''Tests various Cache configurations that reads from cfg file'''
 
diff --git a/tests/provider_tests.py b/tests/provider_tests.py
index 59b3371..181f271 100644
--- a/tests/provider_tests.py
+++ b/tests/provider_tests.py
@@ -1,8 +1,11 @@
 # This Python file uses the following encoding: utf-8
+import os
 
-from unittest import TestCase
+from unittest import TestCase, skipIf
 from . import utils
 
+
+ at skipIf('OFFLINE_TESTS' in os.environ, "Offline tests only")
 class ProviderTests(TestCase):
     '''Tests Proxy Provider that reads from cfg file'''
 
diff --git a/tests/vectiles_tests.py b/tests/vectiles_tests.py
index 34e95ed..95adb1b 100644
--- a/tests/vectiles_tests.py
+++ b/tests/vectiles_tests.py
@@ -1,4 +1,5 @@
-from unittest import TestCase
+import os
+from unittest import TestCase, skipIf
 from collections import namedtuple
 from math import hypot
 import json
@@ -144,6 +145,7 @@ class PostGISVectorTestBase(object):
         self.conn.ExecuteSQL('DROP TABLE if exists %s' % (self.testTableName,))
 
 
+ at skipIf('NO_DATABASE' in os.environ, "No database tests requested")
 class VectorProviderTest(PostGISVectorTestBase, TestCase):
     '''Various vectiles tests on top of PostGIS'''
 
diff --git a/tests/vector_tests.py b/tests/vector_tests.py
index 1edfc82..38082a2 100644
--- a/tests/vector_tests.py
+++ b/tests/vector_tests.py
@@ -1,5 +1,6 @@
-from unittest import TestCase
+from unittest import TestCase, skipIf
 import json
+import os
 
 from osgeo import ogr
 from shapely.geometry import Point, LineString, Polygon, MultiPolygon, asShape
@@ -11,6 +12,8 @@ from . import utils
 # If you want to run them locally, create a similar PostGIS database.
 # Look at .travis.yml for details.
 
+
+ at skipIf('NO_DATABASE' in os.environ, "No database tests requested")
 class PostGISVectorTestBase(object):
     '''
     Base Class for PostGIS Vector tests. Has methods to:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/tilestache.git



More information about the Pkg-grass-devel mailing list