From d3fbb113f38e09ef09473d4235c6883a7aebcd68 Mon Sep 17 00:00:00 2001 From: Paul Bienkowski Date: Sat, 13 May 2023 20:52:04 +0200 Subject: [PATCH] Fix export bounding box ESPG id --- api/obs/api/routes/exports.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/obs/api/routes/exports.py b/api/obs/api/routes/exports.py index 90218fd..4e84a72 100644 --- a/api/obs/api/routes/exports.py +++ b/api/obs/api/routes/exports.py @@ -26,7 +26,7 @@ def parse_bounding_box(input_string): func.ST_Point(left, bottom), func.ST_Point(right, top), ), - 3857, + 4326, ) @@ -66,7 +66,9 @@ async def export_events(req): fmt = req.ctx.get_single_arg("fmt", convert=ExportFormat) events = await req.ctx.db.stream_scalars( - select(OvertakingEvent).where(OvertakingEvent.geometry.bool_op("&&")(bbox)) + select(OvertakingEvent).where( + OvertakingEvent.geometry.bool_op("&&")(func.ST_Transform(bbox, 3857)) + ) ) if fmt == ExportFormat.SHAPEFILE: