Skip to content

Commit

Permalink
lint: adjust to last lint updates
Browse files Browse the repository at this point in the history
  • Loading branch information
edelclaux committed May 21, 2024
1 parent 895c158 commit 82fb82a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions backend/gn_module_zh/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import pdb


def set_geom(geometry, id_zh=None):
if not id_zh:
id_zh = 0
Expand All @@ -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()
)
Expand 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(
Expand Down

0 comments on commit 82fb82a

Please sign in to comment.