2323 ' secondary' ,
2424 ' primary' ,
2525 ' living_street'
26+ )
27+ AND (
28+ osm .access IS NULL
29+ OR (
30+ osm .access = ' no'
31+ AND osm .bicycle IN (' yes' , ' permissive' , ' designated' )
32+ )
33+ OR osm .access NOT IN (' no' , ' private' )
2634 );
2735
2836UPDATE neighborhood_ways
@@ -31,14 +39,30 @@ FROM neighborhood_osm_full_line AS osm
3139WHERE
3240 neighborhood_ways .osm_id = osm .osm_id
3341 AND osm .highway = ' track'
34- AND osm .tracktype = ' grade1' ;
42+ AND osm .tracktype = ' grade1'
43+ AND (
44+ osm .access IS NULL
45+ OR (
46+ osm .access = ' no'
47+ AND osm .bicycle IN (' yes' , ' permissive' , ' designated' )
48+ )
49+ OR osm .access NOT IN (' no' , ' private' )
50+ );
3551
3652UPDATE neighborhood_ways
3753SET functional_class = ' path'
3854FROM neighborhood_osm_full_line AS osm
3955WHERE
4056 neighborhood_ways .osm_id = osm .osm_id
41- AND osm .highway IN (' cycleway' , ' path' );
57+ AND osm .highway IN (' cycleway' , ' path' )
58+ AND (
59+ osm .access IS NULL
60+ OR (
61+ osm .access = ' no'
62+ AND osm .bicycle IN (' yes' , ' permissive' , ' designated' )
63+ )
64+ OR osm .access NOT IN (' no' , ' private' )
65+ );
4266
4367UPDATE neighborhood_ways
4468SET
@@ -48,7 +72,15 @@ FROM neighborhood_osm_full_line AS osm
4872WHERE
4973 neighborhood_ways .osm_id = osm .osm_id
5074 AND osm .highway = ' footway'
51- AND osm .footway IN (' crossing' , ' traffic_island' );
75+ AND osm .footway IN (' crossing' , ' traffic_island' )
76+ AND (
77+ osm .access IS NULL
78+ OR (
79+ osm .access = ' no'
80+ AND osm .bicycle IN (' yes' , ' permissive' , ' designated' )
81+ )
82+ OR osm .access NOT IN (' no' , ' private' )
83+ );
5284
5385UPDATE neighborhood_ways
5486SET functional_class = ' path'
5789 neighborhood_ways .osm_id = osm .osm_id
5890 AND osm .highway = ' footway'
5991 AND osm .bicycle IN (' yes' , ' permissive' , ' designated' )
60- AND (osm .access IS NULL OR osm .access NOT IN (' no' , ' private' ))
92+ AND (
93+ osm .access IS NULL
94+ OR (
95+ osm .access = ' no'
96+ AND osm .bicycle IN (' yes' , ' permissive' , ' designated' )
97+ )
98+ OR osm .access NOT IN (' no' , ' private' )
99+ )
61100 AND COALESCE(width_ft, 0 ) >= 8 ;
62101
63102UPDATE neighborhood_ways
@@ -66,7 +105,15 @@ FROM neighborhood_osm_full_line AS osm
66105WHERE
67106 neighborhood_ways .osm_id = osm .osm_id
68107 AND osm .highway = ' service'
69- AND osm .bicycle IN (' yes' , ' permissive' , ' designated' );
108+ AND osm .bicycle IN (' yes' , ' permissive' , ' designated' )
109+ AND (
110+ osm .access IS NULL
111+ OR (
112+ osm .access = ' no'
113+ AND osm .bicycle IN (' yes' , ' permissive' , ' designated' )
114+ )
115+ OR osm .access NOT IN (' no' , ' private' )
116+ );
70117
71118UPDATE neighborhood_ways
72119SET functional_class = ' living_street'
@@ -75,7 +122,14 @@ WHERE
75122 neighborhood_ways .osm_id = osm .osm_id
76123 AND osm .highway = ' pedestrian'
77124 AND osm .bicycle IN (' yes' , ' permissive' , ' designated' )
78- AND (osm .access IS NULL OR osm .access NOT IN (' no' , ' private' ));
125+ AND (
126+ osm .access IS NULL
127+ OR (
128+ osm .access = ' no'
129+ AND osm .bicycle IN (' yes' , ' permissive' , ' designated' )
130+ )
131+ OR osm .access NOT IN (' no' , ' private' )
132+ );
79133
80134-- remove stuff that we don't want to route over
81135DELETE FROM neighborhood_ways
0 commit comments