The data was imported using the following command:

osmosis --read-pbf file="/usr/local/lib/geoserver-2.1.3/data_dir/argentina.osm.pbf" --write-pgsql database="argosm" password="1234.5" user="argosm"

And previously these commands were issued:

sudo su postgres

createdb argosm
createlang plpgsql argosm

psql -d argosm -f /usr/share/postgresql/9.1/contrib/postgis-2.0/postgis.sql
psql -d argosm -f /usr/share/postgresql/9.1/contrib/postgis-2.0/spatial_ref_sys.sql

psql -d argosm -f /usr/share/postlbs/routing_core.sql
psql -d argosm -f /usr/share/postlbs/routing_core_wrappers.sql
psql -d argosm -f /usr/share/postlbs/routing_topology.sql

The following tables have been created:

  • nodes
  • relations
  • relation_members
  • schema_info
  • spatial_ref_sys
  • users
  • way_nodes
  • ways

Then I added a store in Geoserver, but the only layer I can see with Openlayers, QGIS and so on is "nodes".

No rivers, streets, and no street names. I don't know what can I do with this data, or did I miss some step?

All processes ended normally, no errors during import.

Thank you


Or, another, for better tool for importing OSM data would be Imposm. Which you can also use with Tilemill (google OSMBright for Tilemill) to easily preview your map. Imposm is good for use with Mapnik library

  • Great tool. Spent less than 2 minutes importing argentina.osm.pbf. – Martin0x777 Jan 14 '13 at 17:58

IIRC from my OSM experience Osmosis is not the tool you are looking for.

Osmosis will dump the raw OSM data directly into your PostGIS schema without any data processing, so all you'll get is a huge list of 'nodes' and 'ways' but no useful relationships between them.

osm2pgsql will import your data and do some intelligent processing using the OSM relations metadata - converting closed 'ways' into polygons for lakes, landuse areas etc. Also the resulting PostGIS schema will be much easier to work with in GeoSever, and should be compatible with some of the OSM-style SLDs you can find online (search this site and the GeoServer Users mailing list for numerous discussions around these SLDs).

I believe there are other OSM loading tools you could use but my best experience was with osm2pgsql. You should check out a question I asked a while back on a similar subject.

  • Thank you very much, I learned a lot based on your answer. – Martin0x777 Jan 14 '13 at 16:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.