Commit dd815054 authored by PIOLLE's avatar PIOLLE

fixed call to geojson

parent 7c0bdb95
......@@ -110,9 +110,10 @@ class GeoShape(object):
shape_union = shapely.ops.unary_union(shapes)
return GeoShape.orient(shape_union)
def geojson(self):
@staticmethod
def geojson(shape):
"""return a shape as a geojson string"""
geojson_area = shapely.geometry.mapping(self.shape)
geojson_area = shapely.geometry.mapping(shape)
geojson_area['type'] = geojson_area['type'].lower()
if (geojson_area['type'] in ['linestring', 'multilinestring'] and
'orientation' in geojson_area):
......
......@@ -29,6 +29,8 @@ except:
" will fail"
)
from .geoshape import GeoShape
class TileEncoder(json.JSONEncoder):
......@@ -109,7 +111,7 @@ class Tile(object):
def geojson(self):
"""return the tile shape as a geojson string"""
geojson_area = self.shape.geojson()
geojson_area = GeoShape.geojson(self.shape)
geojson = {
'time_coverage_end': self.end,
'geometry': geojson_area,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment