diff --git a/doc/source/conf.py b/doc/source/conf.py index 60d83ec..ab35750 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -65,9 +65,9 @@ # built documents. # # The short X.Y version. -version = u'0.3' +version = u'0.4' # The full version, including alpha/beta/rc tags. -release = u'0.3alpha' +release = u'0.4' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/source/tutorial.rst b/doc/source/tutorial.rst index 4b46b26..9eb87f8 100644 --- a/doc/source/tutorial.rst +++ b/doc/source/tutorial.rst @@ -81,9 +81,9 @@ This operation will write a local file representing the terrain tile. If you don't want to create a physical file but only need its content, you can use: >>> tile = encode(geometries, bounds=bounds) - >>> content = tile.toStringIO(gzipped=True) + >>> content = tile.toBytesIO(gzipped=True) -This operation will create a gzipped compressed string buffer wrapped in a `cStringIO.StringIO` instance. +This operation will create a gzipped compressed string buffer wrapped in a `io.BytesIO` instance. To define a water-mask you can use: @@ -147,7 +147,7 @@ Using the `requests module`_, here is an example on how to read a remote terrain The you won't need to decompress the gzipped tile has this is performed automatically in the requests module. - >>> import cStringIO + >>> from io import BytesIO >>> import requests >>> from quantized_mesh_tile.terrain import TerrainTile >>> from quantized_mesh_tile.global_geodetic import GlobalGeodetic @@ -156,7 +156,7 @@ in the requests module. >>> [west, south, east, north] = bounds = geodetic.TileBounds(x, y, z) >>> url = 'http://assets.agi.com/stk-terrain/world/%s/%s/%s.terrain?v=1.16389.0' % (z, x, y) >>> response = requests.get(url) - >>> content = cStringIO.StringIO(response.content) + >>> content = BytesIO(response.content) >>> ter = TerrainTile(west=west, south=south, east=east, north=north) - >>> ter.fromStringIO(content) + >>> ter.fromBytesIO(content) >>> print ter.getVerticesCoordinates() diff --git a/quantized_mesh_tile/__init__.py b/quantized_mesh_tile/__init__.py index 219e344..1c00b6f 100644 --- a/quantized_mesh_tile/__init__.py +++ b/quantized_mesh_tile/__init__.py @@ -9,6 +9,13 @@ from .topology import TerrainTopology +# Enable Shapely "speedups" if available +# http://toblerity.org/shapely/manual.html#performance +from shapely import speedups +if speedups.available: + speedups.enable() + + def encode(geometries, bounds=[], autocorrectGeometries=False, hasLighting=False, watermask=[]): """ diff --git a/setup.py b/setup.py index 8a9167c..070886d 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ requires = ['shapely', 'numpy'] setup(name='quantized-mesh-tile', - version='0.3alpha', + version='0.4', description='Quantized-Mesh format reader and writer', author=u'Loic Gasser', author_email='loicgasser4@gmail.com',