source: subversion/utils/mapnik/setup_z_order.sql @ 2256

Last change on this file since 2256 was 2256, checked in by artem, 13 years ago

added script to init z_order column

File size: 1.5 KB
Line 
1begin;
2delete from planet_osm_polygon where "natural" = 'coastline';
3update planet_osm_line set layer=0 where layer is null;
4update planet_osm_line set z_order= 10*int4(layer) + 9 where highway='motorway' or highway='motorway_link';
5update planet_osm_line set z_order= 10*int4(layer) + 8 where highway='trunk' or highway='trunk_link';
6update planet_osm_line set z_order= 10*int4(layer) + 7 where highway='primary' or highway='primary_link';
7update planet_osm_line set z_order= 10*int4(layer) + 6 where highway='secondary' or highway='secondary_link';
8update planet_osm_line set z_order= 10*int4(layer) + 5 where char_length(railway) > 0;
9update planet_osm_line set z_order= 10*int4(layer) + 4 where highway='tertiary' or highway='tertiary_link';
10update planet_osm_line set z_order= 10*int4(layer) + 3 where highway='residential' or highway='minor' or highway='unclassified';
11update planet_osm_line set z_order= z_order + 10  where bridge = 'true';
12update planet_osm_line set z_order= z_order + 10  where bridge = 'yes';
13
14delete from geometry_columns where f_table_name='planet_osm_roads';
15drop table planet_osm_roads;
16create table planet_osm_roads as select * from planet_osm_line where highway='motorway' or highway='motorway_link' or highway='trunk' or highway='trunk_link' or highway='primary' or highway='primary_link' or char_length(railway) > 0;
17insert into geometry_columns values('','public','planet_osm_roads','way',2,4326,'LINESTRING');
18create index planet_osm_roads_spidx on planet_osm_roads using GIST (way GIST_GEOMETRY_OPS);
19commit;
20vacuum analyze planet_osm_roads;
Note: See TracBrowser for help on using the repository browser.