Skip to content

Commit

Permalink
Use st intersects by default
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Jan 12, 2024
1 parent 1908f0c commit 57af36f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/query_builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ def convert_tags_pattern(query_string):
row_filter_condition = (
f"""(country <@ ARRAY [{cid}])"""
if cid
else f"""ST_within(geom,(select ST_SetSRID(ST_Extent(ST_makeValid(ST_GeomFromText('{wkt.dumps(loads(geometry.json()),decimals=6)}',4326))),4326)))"""
else f"""ST_Intersects(geom,(select ST_SetSRID(ST_Extent(ST_makeValid(ST_GeomFromText('{wkt.dumps(loads(geometry.json()),decimals=6)}',4326))),4326)))"""
)

postgres_query = f"""select {select_query} from (select * , tableoid::regclass as osm_type from {table} where {row_filter_condition}) as sub_query"""
Expand Down

0 comments on commit 57af36f

Please sign in to comment.