Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ssadhu-sl committed Sep 17, 2024
1 parent eb25629 commit b46d3b2
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions application/data_access/entity_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,23 +177,17 @@ def _apply_location_filters(session, query, params):

clauses = []
for geometry in params.get("geometry", []):
simplified_geom = func.ST_Envelope(func.ST_GeomFromText(geometry, 4326))
simplified_geom = func.ST_GeomFromText(geometry, 4326)
clauses.append(
or_(
and_(
EntityOrm.geometry.is_not(None),
geometry_is_valid,
EntityOrm.geometry.op("&&")(
simplified_geom
), # Using && operator to trigger index
spatial_function(EntityOrm.geometry, simplified_geom),
),
and_(
EntityOrm.point.is_not(None),
point_is_valid,
EntityOrm.point.op("&&")(
simplified_geom
), # Using && operator to trigger index
spatial_function(EntityOrm.point, simplified_geom),
),
)
Expand Down

0 comments on commit b46d3b2

Please sign in to comment.