From 82671959bba469828332de212ff250dd7fb02cf9 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Tue, 31 Oct 2023 15:35:18 +0000 Subject: [PATCH] Cast Point to Geography --- matcher/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/matcher/api.py b/matcher/api.py index b4efe3b..808b077 100644 --- a/matcher/api.py +++ b/matcher/api.py @@ -110,7 +110,9 @@ def make_envelope_around_point( """Make an envelope around a point, the distance parameter specifies the size.""" conn = database.session.connection() - p = sqlalchemy.func.ST_MakePoint(lon, lat) + p = sqlalchemy.sql.expression.cast( + sqlalchemy.func.ST_MakePoint(lon, lat), geoalchemy2.Geography + ) s = select( [