diff --git a/konova/models/geometry.py b/konova/models/geometry.py index f69fcc7e..f8c272f9 100644 --- a/konova/models/geometry.py +++ b/konova/models/geometry.py @@ -213,12 +213,9 @@ class Geometry(BaseResource): geojson (dict): The FeatureCollection json (as dict) """ geom = self.geom - geom.transform(ct=srid) + if geom.srid != srid: + geom.transform(ct=srid) - polygons = [] - for coords in geom.coords: - p = Polygon(coords[0], srid=geom.srid) - polygons.append(p) geojson = { "type": "FeatureCollection", "crs": { @@ -230,8 +227,8 @@ class Geometry(BaseResource): "features": [ { "type": "Feature", - "geometry": json.loads(x.geojson) - } for x in polygons + "geometry": json.loads(geom.json), + } ] } return geojson diff --git a/konova/templates/konova/includes/parcels/parcels.html b/konova/templates/konova/includes/parcels/parcels.html index a8a882ed..9512c09c 100644 --- a/konova/templates/konova/includes/parcels/parcels.html +++ b/konova/templates/konova/includes/parcels/parcels.html @@ -2,10 +2,19 @@
-
- {% fa5_icon 'search-location' %} - {% trans 'Spatial reference' %} -
+
+
+
+ {% fa5_icon 'search-location' %} + {% trans 'Spatial reference' %} +
+
+
+
+ {{ obj.geometry.geom.area|floatformat:2 }} m² +
+
+