NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I have a problem merging and then importing two OSM files. I downloaded to distinct .osm-files from cloudmade. They are not sharing any geographical attribute (as the first is the country Monaco, the 2nd is the county Bremen in Germany).

I merged the with OSMOSIS and it gives me an output file.

Then I import it via OSM2PGSQL.

Looking at the dataset using QGIS it either shows me the data of Bremen or Monaco (depending the order in the OSMOSIS merge statement).

Does anyone has a solution for this problem?

Thanks a lot Carsten

EDIT: I imported like described further down. Downloaded Bremen and Monaco planet files and imported them like this:

$osm2pgsql -l --create --database gis --username postgres --prefix planet --slim --cache 2048 /home/katia/Downloads/monaco.osm.bz2 -S /usr/share/osm2pgsql/default.style

$osm2pgsql -l --append --database gis --username postgres --prefix planet --slim --cache 2048 /home/katia/Downloads/bremen_1.osm.bz2 -S /usr/share/osm2pgsql/default.style

The two files seems to be correctly imported into postgis. No duplicates. But trying them visualizing them in OpenJump it displayes only the bremen.osm data. In PGAdmin3 it shows me that the tables do not have any primary key. How do set them correctly?

Thanks

asked 13 Feb '13, 10:45

hoge6b01's gravatar image

hoge6b01
56336
accept rate: 0%

edited 13 Feb '13, 23:01

(not that it's directly related to your question but) do be aware that the date quoted for the data at http://downloads.cloudmade.com/ is 13 December 2011.

(13 Feb '13, 10:55) SomeoneElse ♦

oh, i haven't seen that. Thank you! What do you suggest to download from?

(13 Feb '13, 11:24) hoge6b01

There are lots of extract sites available - see this page. I tend to use Geofabrik myself, but there are lots of others.

(13 Feb '13, 11:30) SomeoneElse ♦

I thought Geofabrik "pre-selects" the OSM content. Not that OSM2PGSQL selects the content defined in the default.style as well, but does Geofabrik contain the tags from default.style?

(13 Feb '13, 11:46) hoge6b01

I'm guessing that you're missing the "append" on the second import? If you have a look here you'll see how that can be used, and also a description of a further problem that you might get if there's any data overlap between the two (which in your case there probably won't be).

permanent link

answered 13 Feb '13, 10:58

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

Thanks. I will give it a new try when I'm at home. btw, how do I temporary drop contrains?

(13 Feb '13, 11:26) hoge6b01

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×263
×252
×134
×41

question asked: 13 Feb '13, 10:45

question was seen: 7,656 times

last updated: 13 Feb '13, 23:01

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum