Changes between Version 12 and Version 13 of RenderingOsmData


Ignore:
Timestamp:
Jan 10, 2010, 6:52:54 PM (14 years ago)
Author:
zenon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RenderingOsmData

    v12 v13  
    2323
    2424 * Optionally, download and unzip the shapefiles containing the world coastlines from http://hypercube.telascience.org/~kleptog/processed_p.zip (this shapefile isn't included or rendered with the supplied mapfile)
     25
     26=== Download the osm-mapserver utils ===
     27
     28{{{
     29svn checkout http://mapserver-utils.googlecode.com/svn/trunk/ mapserver-utils-read-only
     30}}}
    2531
    2632=== Import into Postgis ===
     
    8086 * Postprocess the imported data:
    8187
    82 {{{
    83 # psql -d osm
    84 }}}
     88 Optionally, edit mapserver-utils-read-only/postprocess.sql to comment out or remove the following two lines if you'd rather leave names unchanged:
    8589
    8690{{{
    8791-- optional, makes it easier to wrap place names
    8892update osm_point set name = replace(name,'-',' ');
    89 
    90 -- grant our user access to the data
    91 grant SELECT on osm_line to "www-data";
    92 grant SELECT on osm_point to "www-data";
    93 grant SELECT on osm_polygon to "www-data";
    94 
    95 -- correct a few common typos
    96 update osm_line set tunnel='yes' where tunnel='true';
    97 update osm_line set tunnel='no' where tunnel='false';
    98 update osm_line set tunnel='yes' where tunnel='yel';
    99 update osm_line set bridge='yes' where bridge='true';
    100 
    101 update osm_line set oneway='yes' where oneway='Yes';
    102 update osm_line set oneway='yes' where oneway='true';
    103 update osm_line set oneway='yes' where oneway='1';
    104 
    105 -- rename one of the columns to make it easier to write mapserver expressions
    106 alter table osm_polygon rename column "natural" to nature;
    107 
    108 -- create a few indexes on the data for speedier access
    109 create index osm_polygon_building_idx on osm_polygon(building);
    110 create index osm_polygon_amenity_idx on osm_polygon(amenity);
    111 create index osm_polygon_landuse_idx on osm_polygon(landuse);
    112 create index osm_line_highway_idx on osm_line(highway);
    113 create index osm_line_aeroway_idx on osm_line(aeroway);
    114 create index osm_line_railway_idx on osm_line(railway);
    115 create index osm_line_bridge_idx on osm_line(bridge);
    116 create index osm_polygon_leisure_idx on osm_polygon(leisure);
    117 create index osm_polygon_aeroway_idx on osm_polygon(aeroway);
    118 create index osm_polygon_waterway_idx on osm_polygon(waterway);
    119 create index osm_polygon_natural_idx on osm_polygon(nature);
    120 create index osm_point_place_idx on osm_point(place);
    121 create index osm_line_zorder_idx on osm_line(z_order);
    122 }}}
     93}}}
     94
     95 Then proceed with postprocessing:
     96
     97{{{
     98# cat mapserver-utils-read-only/postprocess.sql | psql -d osm
     99}}}
     100
    123101
    124102== Creating the Mapfile ==