diff --git a/api/obs/api/routes/mapdetails.py b/api/obs/api/routes/mapdetails.py index 2c9ce59..fc475d7 100644 --- a/api/obs/api/routes/mapdetails.py +++ b/api/obs/api/routes/mapdetails.py @@ -108,7 +108,7 @@ async def mapdetails_road(req): def partition(arr, cond): return arr[:, cond], arr[:, ~cond] - forwards, backwards = partition(data, mask) + forwards, backwards = partition(data, ~mask) print("for", forwards.dtype, "back", backwards.dtype) def array_stats(arr, rounder): diff --git a/tile-generator/layers/obs_roads/layer.sql b/tile-generator/layers/obs_roads/layer.sql index 181bf15..85f700a 100644 --- a/tile-generator/layers/obs_roads/layer.sql +++ b/tile-generator/layers/obs_roads/layer.sql @@ -24,7 +24,7 @@ RETURNS TABLE( r.dir as direction, case when road.directionality = 0 then r.dir else 0 end as offset_direction FROM road - LEFT JOIN (VALUES (1, TRUE), (-1, FALSE), (0, FALSE)) AS r(dir, rev) ON (abs(r.dir) != road.directionality) + LEFT JOIN (VALUES (-1, TRUE), (1, FALSE), (0, FALSE)) AS r(dir, rev) ON (abs(r.dir) != road.directionality) FULL OUTER JOIN overtaking_event ON (road.way_id = overtaking_event.way_id and (road.directionality != 0 or overtaking_event.direction_reversed = r.rev)) -- WHERE road.name = 'Merzhauser Straße' WHERE road.geometry && bbox