[GIS] Merging OSM files with OSMOSIS and import to Postgres with OSM2PGSQL

mergeosm2pgsqlosmosispostgis

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

Best Answer

There might be a problem with your osmosis command, specially that you say you get different results when you change the order. How did you write that?

You don't necessarily have to merge those two files to import both in your database. Import the first one, and for the second, use OSM2PGSQL --append switch to append it to the current database.

If you insist on merging osm files, you can also use OSMConvert instead:

osmconvert 1.osm 2.osm -o=merged.osm
Related Question