From 57af36f8f3a5fb8ebc5685349758f5873a2c2faf Mon Sep 17 00:00:00 2001 From: kshitijrajsharma Date: Fri, 12 Jan 2024 20:57:37 +0545 Subject: [PATCH] Use st intersects by default --- src/query_builder/builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/query_builder/builder.py b/src/query_builder/builder.py index 56f3e367..5268754c 100644 --- a/src/query_builder/builder.py +++ b/src/query_builder/builder.py @@ -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"""