Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using the following command to import an osm file into a Postgres DB using Linux:

osm2pgsql -v -a -U user -S -d routing myfile.osm

I got the following error:

Setting up table: planet_osm_point Problem reading geometry information for table planet_osm_point - does it exist? Error occured, cleaning up

I guess I have to manually create the schemas into db.

Can osm2pgsql be used to automatically create such schemas? Otherwise, how can I create them?

share|improve this question
up vote 6 down vote accepted

You have to set up the database in the form osm2pgsql expects it. I have written a detailed Howto here (you might use google to translate):
share|improve this answer
thanks for the link. Unfortunately I'm using Linux, and the Howto seems not to cover it. I'll edit the question to specify that. – Heisenbug Nov 16 '12 at 15:20
This page might help you with Linux: – AndreJ Nov 16 '12 at 15:41

The commands are the same as the commands listed in the answer provided by @Andre Joost except you shouldn't need to provide the full path, all those commands should be in your normal path.

The one exception would be if you're using PostGIS 2.0 or later. In that case you can use the extension manager to create the postgis and postgis_topology extensions.

share|improve this answer

Just add a "--create" flag to osm2pgsql.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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