X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/d743cf308ee6b30bb5ea39e903c4fae496fc14bc..cab2a74740ba951a09635c0ca65ead65a8b2f361:/nominatim/db/sqlalchemy_types.py diff --git a/nominatim/db/sqlalchemy_types.py b/nominatim/db/sqlalchemy_types.py index f31966cd..9e1f9fce 100644 --- a/nominatim/db/sqlalchemy_types.py +++ b/nominatim/db/sqlalchemy_types.py @@ -66,7 +66,15 @@ class Geometry(types.UserDefinedType): # type: ignore[type-arg] def ST_DWithin(self, other: SaColumn, distance: SaColumn) -> SaColumn: - return sa.func.ST_DWithin(self, other, distance, type_=sa.Float) + return sa.func.ST_DWithin(self, other, distance, type_=sa.Boolean) + + + def ST_DWithin_no_index(self, other: SaColumn, distance: SaColumn) -> SaColumn: + return sa.func._ST_DWithin(self, other, distance, type_=sa.Boolean) + + + def ST_Intersects_no_index(self, other: SaColumn) -> SaColumn: + return sa.func._ST_Intersects(self, other, type_=sa.Boolean) def ST_Distance(self, other: SaColumn) -> SaColumn: @@ -74,7 +82,11 @@ class Geometry(types.UserDefinedType): # type: ignore[type-arg] def ST_Contains(self, other: SaColumn) -> SaColumn: - return sa.func.ST_Contains(self, other, type_=sa.Float) + return sa.func.ST_Contains(self, other, type_=sa.Boolean) + + + def ST_CoveredBy(self, other: SaColumn) -> SaColumn: + return sa.func.ST_CoveredBy(self, other, type_=sa.Boolean) def ST_ClosestPoint(self, other: SaColumn) -> SaColumn: