From daae2609d29f7044909b1cbc2564362922a7f0b9 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Wed, 16 Nov 2022 12:20:16 +0100 Subject: [PATCH] #231 Report geometry * should fix report geometry cast problem in cases where MultiPolygon(srid=4326) is taken as default --- analysis/utils/report.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/analysis/utils/report.py b/analysis/utils/report.py index 63a06b84..9932863a 100644 --- a/analysis/utils/report.py +++ b/analysis/utils/report.py @@ -17,6 +17,7 @@ from compensation.models import Compensation, Payment, EcoAccountDeduction, EcoA from intervention.models import Intervention from konova.models import Geometry from konova.sub_settings.django_settings import BASE_DIR, DEFAULT_DATE_FORMAT +from konova.sub_settings.lanis_settings import DEFAULT_SRID_RLP class TimespanReport: @@ -333,7 +334,7 @@ class TimespanReport: return Geometry.objects.filter( id__in=ids ).annotate( - geom_cast=Cast("geom", MultiPolygonField()) + geom_cast=Cast("geom", MultiPolygonField(srid=DEFAULT_SRID_RLP)) ).annotate( num=NumGeometries("geom_cast") ).aggregate(