From 82fb82a949c8bcedeb041a78c046945a7e3f8db5 Mon Sep 17 00:00:00 2001 From: Etienne Delclaux Date: Tue, 21 May 2024 12:37:16 +0200 Subject: [PATCH] lint: adjust to last lint updates --- backend/gn_module_zh/geometry.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/backend/gn_module_zh/geometry.py b/backend/gn_module_zh/geometry.py index 40584579..b9429a5f 100644 --- a/backend/gn_module_zh/geometry.py +++ b/backend/gn_module_zh/geometry.py @@ -10,6 +10,7 @@ import pdb + def set_geom(geometry, id_zh=None): if not id_zh: id_zh = 0 @@ -26,9 +27,10 @@ def set_geom(geometry, id_zh=None): ) .filter( func.ST_Touches( - func.ST_GeomFromWKB(func.ST_AsEWKB(TZH.geom),4326), - func.ST_GeomFromWKB(func.ST_AsEWKB(str(geometry)),4326), - ) == False + func.ST_GeomFromWKB(func.ST_AsEWKB(TZH.geom), 4326), + func.ST_GeomFromWKB(func.ST_AsEWKB(str(geometry)), 4326), + ) + == False ) .all() ) @@ -37,9 +39,13 @@ def set_geom(geometry, id_zh=None): for zh in q_zh: if zh.id_zh != id_zh: zh_geom = DB.session.query(func.ST_GeogFromWKB(func.ST_AsEWKB(zh.geom))).scalar() - polygon_geom = DB.session.query(func.ST_GeogFromWKB(func.ST_AsEWKB(str(geometry)))).scalar() + polygon_geom = DB.session.query( + func.ST_GeogFromWKB(func.ST_AsEWKB(str(geometry))) + ).scalar() if DB.session.query(func.ST_Intersects(polygon_geom, zh_geom)).scalar(): - if DB.session.query(func.ST_GeometryType(func.ST_Intersection(zh_geom, polygon_geom, 0.1))).scalar() not in ['ST_LineString','ST_MultiLineString']: + if DB.session.query( + func.ST_GeometryType(func.ST_Intersection(zh_geom, polygon_geom, 0.1)) + ).scalar() not in ["ST_LineString", "ST_MultiLineString"]: is_intersected = True if DB.session.query( func.ST_Contains(