Fix direction of road segments (fixes #142)
BREAKING CHANGE: This changes the tile generation function, please update your database with `prepare_sql_tiles.py`.
This commit is contained in:
parent
ab6e2b8a74
commit
810bd39152
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue