Permalink
Browse files

Fixing Travis CI bugs

  • Loading branch information...
1 parent 1339713 commit d67becbd336d8377710a76cd80a85ec010e9cd57 @migurski migurski committed Mar 13, 2013
Showing with 11 additions and 6 deletions.
  1. +1 −1 .travis.yml
  2. +10 −5 TileStache/Goodies/VecTiles/client.py
View
2 .travis.yml
@@ -12,7 +12,7 @@ virtualenv:
before_install:
- sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
- sudo apt-get update -qq
- - sudo apt-get install -qq postgis gdal-bin libgdal-dev libgdal1 libgdal1-dev libpq-dev memcached python-pip python-mapnik
+ - sudo apt-get install -qq postgis gdal-bin libgdal-dev libgdal1 libgdal1-dev libpq-dev memcached python-pip
- sudo apt-get install -qq python-nose python-imaging python-memcache python-gdal python-coverage python-werkzeug
- ogrinfo --version
- ogrinfo --formats
View
15 TileStache/Goodies/VecTiles/client.py
@@ -38,10 +38,15 @@
from gzip import GzipFile
import logging
-import mapnik
from . import mvt, geojson
+try:
+ from mapnik import PythonDatasource, Box2d
+except ImportError:
+ # can still build documentation
+ PythonDatasource = object
+
# earth's diameter in meters
diameter = 2 * pi * 6378137
@@ -146,7 +151,7 @@ def load_tile_features(lock, host, port, path_fmt, tiles, features):
logging.debug('%d features in %s:%d%s' % (len(file_features), host, port, path))
features.extend(file_features)
-class Datasource (mapnik.PythonDatasource):
+class Datasource (PythonDatasource):
''' Mapnik datasource to read tiled vector data in GeoJSON or MVT formats.
Sample usage in Mapnik configuration XML:
@@ -180,8 +185,8 @@ def __init__(self, template):
self.path = self.path.replace('{X}', '{x}').replace('{x}', '%(x)d')
self.path = self.path.replace('{Y}', '{y}').replace('{y}', '%(y)d')
- bbox = mapnik.Box2d(-diameter/2, -diameter/2, diameter/2, diameter/2)
- mapnik.PythonDatasource.__init__(self, envelope=bbox)
+ bbox = Box2d(-diameter/2, -diameter/2, diameter/2, diameter/2)
+ PythonDatasource.__init__(self, envelope=bbox)
def features(self, query):
'''
@@ -199,4 +204,4 @@ def features(self, query):
keys = [set(prop.keys()) for prop in props]
keys = reduce(lambda a, b: a & b, keys)
- return mapnik.PythonDatasource.wkb_features(keys=keys, features=features)
+ return PythonDatasource.wkb_features(keys=keys, features=features)

0 comments on commit d67becb

Please sign in to comment.