diff options
Diffstat (limited to 'chimere/models.py')
-rw-r--r-- | chimere/models.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/chimere/models.py b/chimere/models.py index e3fa122..0fb42fb 100644 --- a/chimere/models.py +++ b/chimere/models.py @@ -1092,7 +1092,7 @@ class AggregatedPolygon(models.Model): managed = False db_table = 'chimere_aggregated_polygons' - def getGeoJSON(self, color="", inner_color=''): + def getGeoJSON(self, simplify=False, color="", inner_color=''): '''Return a GeoJSON string ''' # get colors @@ -1112,8 +1112,11 @@ class AggregatedPolygon(models.Model): if not inner_color: inner_color = c.inner_color + geom = self.polygon + if simplify: + geom = self.polygon.simplify(0.0003).json attributes = { - 'color': color, 'geometry': json.loads(self.polygon.geojson), + 'color': color, 'geometry': json.loads(geom), 'type': "Feature", "properties": { 'color': color, 'inner_color': inner_color, |