Do not generate roads and events for tiles at low zoom levels

This commit is contained in:
Paul Bienkowski 2023-03-12 12:40:57 +01:00
parent 78561d5929
commit bea4174b37
2 changed files with 2 additions and 0 deletions

View file

@ -15,6 +15,7 @@ RETURNS TABLE(event_id bigint, geometry geometry, distance_overtaker float, dist
FULL OUTER JOIN road ON road.way_id = overtaking_event.way_id FULL OUTER JOIN road ON road.way_id = overtaking_event.way_id
JOIN track on track.id = overtaking_event.track_id JOIN track on track.id = overtaking_event.track_id
WHERE ST_Transform(overtaking_event.geometry, 3857) && bbox WHERE ST_Transform(overtaking_event.geometry, 3857) && bbox
AND zoom_level >= 10
AND (user_id is NULL OR user_id = track.author_id) AND (user_id is NULL OR user_id = track.author_id)
AND time BETWEEN COALESCE(min_time, '1900-01-01'::timestamp) AND COALESCE(max_time, '2100-01-01'::timestamp); AND time BETWEEN COALESCE(min_time, '1900-01-01'::timestamp) AND COALESCE(max_time, '2100-01-01'::timestamp);

View file

@ -67,6 +67,7 @@ RETURNS TABLE(
) e on (e.way_id = road.way_id and (road.directionality != 0 or e.direction_reversed = r.rev)) ) e on (e.way_id = road.way_id and (road.directionality != 0 or e.direction_reversed = r.rev))
WHERE road.geometry && bbox WHERE road.geometry && bbox
AND zoom_level >= 10
GROUP BY GROUP BY
road.name, road.name,
road.way_id, road.way_id,