Database Reference
In-Depth Information
Tip
Ifyouwanttoexportlargerareas,youshouldconsiderdownload-
ing the whole database, built daily at planet.osm (250 GB un-
compressedand16GBcompressed).At planet.osm ,youmay
alsodownloadextractsthatcontainOpenstreetMapDataforindi-
vidual continents, countries, and metropolitan areas.
3. If you want to get the same dataset used for this recipe, just copy
and paste the following URL in your browser: ht-
tp://www.openstreetmap.org/ex-
port?lat=41.88745&lon=12.4899&zoom=15&layers=M ; or,getitfrom
the topic datasets ( chp01/map.osm file).
4. Click on the Export link.
5. Select OpenStreetMap XML Data as the output format.
6. Download the map.osm file to your working directory.
2. Run osm2pgsql toimporttheOSMdatainthePostGISdatabase.Usethe -
hstore option,asyouwishtoaddtagswithanadditionalhstore(key/value)
column in the PostgreSQL tables:
$ osm2pgsql -d rome -U me --hstore map.osm
osm2pgsql SVN version 0.80.0 (32bit id
space)Using projection SRS 900913
(Spherical Mercator)Setting up table:
planet_osm_point...All indexes on
planet_osm_polygon created in 1sCompleted
planet_osm_polygonOsm2pgsql took 3s
overall
$ osm2pgsql -d rome -U me --hstore map.osm
osm2pgsql SVN version 0.80.0 (32bit id
space)
Using projection SRS 900913 (Spherical
Mercator)
Setting up table: planet_osm_point
Search WWH ::




Custom Search