source: subversion/sites/www.openstreetbrowser.org/src/sql/03_power.sql @ 29773

Last change on this file since 29773 was 16408, checked in by skunk, 11 years ago

Files missing (please don't ask me why)

File size: 996 bytes
Line 
1update planet_osm_line set "importance"=(CASE
2    WHEN cast("voltage" as int)>=150000 THEN 'national'
3    WHEN cast("voltage" as int)>=15000 THEN 'regional'
4    WHEN cast("voltage" as int)>=1500 THEN 'urban'
5    ELSE 'suburban' END)
6  where "power"='line' and "voltage" similar to '^[0-9]+$';
7update planet_osm_line set "importance"=(CASE
8    WHEN cast(substr("voltage", 1, length("voltage")-3) as int)>=150 THEN 'national'
9    WHEN cast(substr("voltage", 1, length("voltage")-3) as int)>=15 THEN 'regional'
10    WHEN cast(substr("voltage", 1, length("voltage")-3) as int)>=1 THEN 'urban'
11    ELSE 'suburban' END)
12  where "power"='line' and "voltage" similar to '^[0-9]+ kV$';
13update planet_osm_line set "importance"='suburban'
14  where "power"='line' and "importance" is null;
15update planet_osm_point set "importance"=l."importance" from way_nodes, planet_osm_line l where planet_osm_point.osm_id=way_nodes.node_id and l.osm_id=way_nodes.way_id and planet_osm_point."power" in ('tower', 'pole');
16
Note: See TracBrowser for help on using the repository browser.