From 91b9778e7d8396ace0fb504db2306d69c42b2b3f Mon Sep 17 00:00:00 2001 From: Etienne Delclaux Date: Fri, 5 Jul 2024 15:55:49 +0200 Subject: [PATCH] fix: add missing geojson to geom explicit conversion --- backend/gn_module_zh/geometry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/gn_module_zh/geometry.py b/backend/gn_module_zh/geometry.py index 972dd634..b3fb94bb 100644 --- a/backend/gn_module_zh/geometry.py +++ b/backend/gn_module_zh/geometry.py @@ -44,7 +44,7 @@ def set_geom(geometry, id_zh=None): if zh.id_zh != id_zh: zh_geom = DB.session.scalar(select(func.ST_GeogFromWKB(func.ST_AsEWKB(zh.geom)))) polygon_geom = DB.session.scalar( - select(func.ST_GeogFromWKB(func.ST_AsEWKB(str(geometry)))) + select(func.ST_GeogFromWKB(func.ST_AsEWKB(func.ST_GeomFromGeoJSON(str(geometry))))) ) if DB.session.scalar(select(func.ST_Intersects(polygon_geom, zh_geom))): if DB.session.scalar(