forked from azavea/pfb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
signalized.sql
27 lines (24 loc) · 953 Bytes
/
signalized.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
----------------------------------------
-- INPUTS
-- location: neighborhood
----------------------------------------
UPDATE neighborhood_ways_intersections SET signalized = 'f';
UPDATE neighborhood_ways_intersections
SET signalized = 't'
FROM neighborhood_osm_full_point osm
WHERE neighborhood_ways_intersections.osm_id = osm.osm_id
AND osm.highway = 'traffic_signals';
UPDATE neighborhood_ways_intersections
SET signalized = 't'
FROM neighborhood_ways,
neighborhood_osm_full_line osm
WHERE neighborhood_ways.osm_id = osm.osm_id
AND int_id = neighborhood_ways.intersection_to
AND osm."traffic_signals:direction" = 'forward';
UPDATE neighborhood_ways_intersections
SET signalized = 't'
FROM neighborhood_ways,
neighborhood_osm_full_line osm
WHERE neighborhood_ways.osm_id = osm.osm_id
AND int_id = neighborhood_ways.intersection_from
AND osm."traffic_signals:direction" = 'backward';