[GIS] How to load OSM data into PostGIS preserving all Tags

openstreetmappostgresqlshapefile

I am new to the field of GIS and am trying to view source tags in OSM. I have downloaded the shapefiles from http://downloads.cloudmade.com and have loaded them into Postgres. When I view the data, I am unable to see any tagging data. Should I be following a different process or using shapefiles at all?

Best Answer

Download the OSM files (in .osm format) and import using osm2pgsql.

When using osm2pgsql, there's a file called default.style that allows you to control which OSM feature goes into which postgresql table, e.g.:

way        boundary     text         polygon
node,way   railway      text         linear

means that

  • features tagged "boundary" go into the *planet_osm_polygon* table
  • features tagged "railway" go into the *planet_osm_point* and *planet_osm_line* because the "railway" tag is common between railway stations (osm nodes) and railway tracks (osm ways).
Related Question