X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/ca782e2f20164269e8566c511807b6931485d530..7b27c04b8392d0babe33cf53e2838b05ffbcbacf:/nominatim/api/reverse.py diff --git a/nominatim/api/reverse.py b/nominatim/api/reverse.py index fb4c0b23..df5c10f2 100644 --- a/nominatim/api/reverse.py +++ b/nominatim/api/reverse.py @@ -180,7 +180,7 @@ class ReverseGeocoder: diststr = sa.text(f"{distance}") sql: SaLambdaSelect = sa.lambda_stmt(lambda: _select_from_placex(t) - .where(t.c.geometry.ST_DWithin(WKT_PARAM, diststr)) + .where(t.c.geometry.within_distance(WKT_PARAM, diststr)) .where(t.c.indexed_status == 0) .where(t.c.linked_place_id == None) .where(sa.or_(sa.not_(t.c.geometry.is_area()), @@ -219,7 +219,7 @@ class ReverseGeocoder: t = self.conn.t.placex sql: SaLambdaSelect = sa.lambda_stmt(lambda: _select_from_placex(t) - .where(t.c.geometry.ST_DWithin(WKT_PARAM, 0.001)) + .where(t.c.geometry.within_distance(WKT_PARAM, 0.001)) .where(t.c.parent_place_id == parent_place_id) .where(sa.func.IsAddressPoint(t)) .where(t.c.indexed_status == 0) @@ -241,7 +241,7 @@ class ReverseGeocoder: sa.select(t, t.c.linegeo.ST_Distance(WKT_PARAM).label('distance'), _locate_interpolation(t)) - .where(t.c.linegeo.ST_DWithin(WKT_PARAM, distance)) + .where(t.c.linegeo.within_distance(WKT_PARAM, distance)) .where(t.c.startnumber != None) .order_by('distance') .limit(1)) @@ -275,7 +275,7 @@ class ReverseGeocoder: inner = sa.select(t, t.c.linegeo.ST_Distance(WKT_PARAM).label('distance'), _locate_interpolation(t))\ - .where(t.c.linegeo.ST_DWithin(WKT_PARAM, 0.001))\ + .where(t.c.linegeo.within_distance(WKT_PARAM, 0.001))\ .where(t.c.parent_place_id == parent_place_id)\ .order_by('distance')\ .limit(1)\