mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-11 21:34:06 +00:00
move search to bind parameters
This commit is contained in:
@@ -30,8 +30,10 @@ class Geometry(types.UserDefinedType[Any]):
|
||||
|
||||
def bind_processor(self, dialect: sa.Dialect) -> Callable[[Any], str]:
|
||||
def process(value: Any) -> str:
|
||||
assert isinstance(value, str)
|
||||
return value
|
||||
if isinstance(value, str):
|
||||
return 'SRID=4326;' + value
|
||||
|
||||
return 'SRID=4326;' + value.to_wkt()
|
||||
return process
|
||||
|
||||
|
||||
@@ -84,6 +86,10 @@ class Geometry(types.UserDefinedType[Any]):
|
||||
return sa.func.ST_Expand(self, other, type_=Geometry)
|
||||
|
||||
|
||||
def ST_Collect(self) -> SaColumn:
|
||||
return sa.func.ST_Collect(self, type_=Geometry)
|
||||
|
||||
|
||||
def ST_Centroid(self) -> SaColumn:
|
||||
return sa.func.ST_Centroid(self, type_=Geometry)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user