X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/b1d419f458a41b3ddfe162f0dbe5b3c620c95af7..899a04ad264c45197ec7509b164c934a05392f30:/nominatim/db/sqlalchemy_types.py diff --git a/nominatim/db/sqlalchemy_types.py b/nominatim/db/sqlalchemy_types.py index d1ff7635..036b25dd 100644 --- a/nominatim/db/sqlalchemy_types.py +++ b/nominatim/db/sqlalchemy_types.py @@ -38,7 +38,7 @@ def _default_distance_spheroid(element: SaColumn, @compiles(Geometry_DistanceSpheroid, 'sqlite') # type: ignore[no-untyped-call, misc] def _spatialite_distance_spheroid(element: SaColumn, compiler: 'sa.Compiled', **kw: Any) -> str: - return "Distance(%s, true)" % compiler.process(element.clauses, **kw) + return "COALESCE(Distance(%s, true), 0.0)" % compiler.process(element.clauses, **kw) class Geometry_IsLineLike(sa.sql.expression.FunctionElement[bool]):