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

I have installed nominatim for Maldives and now I want to install for Sri Lanka in the same db. According to lonvia i found it is fast that i merge below both files and then do the import.

I have sri-lanka-latest.osm.pbf and maldives-latest.osm.pbf two pbf files and i tried to merge these two with osmconvert command. I have read Osmconvert in the wiki and osm help questions but could not find the answer.

Then i converted these two files to .o5m files separately using osmconvert and then merged those both files. Is that what I should do?

Thanks in Advance.

asked 25 Mar '16, 09:54

Tharaka%20Rajith's gravatar image

Tharaka Rajith
accept rate: 0%

edited 28 Mar '16, 08:08

Merging two PBF files can be done in one run, using concatenated processes:

osmconvert region1.pbf --out-o5m | osmconvert - region2.pbf -o=all.pbf

Further examples and explanations can be found at OSM Wiki page:

permanent link

answered 26 Mar '16, 07:57

Marqqs's gravatar image

accept rate: 22%

Even better, thanks. I added a link from the Nominatim documentation to this thread.

(27 Mar '16, 19:08) mtmail

this is the answer i was looking for, works like a charm, thanks

(28 Mar '16, 07:12) Tharaka Rajith

This should work:

  1. osmconvert country1.osm.pbf -o=country1.o5m
  2. osmconvert country2.osm.pbf -o=country2.o5m
  3. osmconvert country1.o5m country2.o5m -o=together.o5m
  4. osmconvert together.o5m -o=together.osm.pbf

and then import together.osm.pbf with Nominatim.

permanent link

answered 25 Mar '16, 15:27

mtmail's gravatar image

accept rate: 27%

If you want to merge more than one file, the most voted option isn't really working for me. It only stores the content of the last 2 files.

You could make this shorter by converting all your .osm.pbf to .o5m and then do osmconvert *.o5m -o=together.osm.pbf so it gets all .o5m files.

(30 Nov '18, 13:36) xarly89

This answer should be treated with more love!:)

(03 Dec '19, 15:14) CuriosityBeg...

Or you can use osmium-tool:

osmium merge country1.osm.pbf country2.osm.pbf -o together.osm.pbf.

permanent link

answered 25 May '17, 07:11

Jochen%20Topf's gravatar image

Jochen Topf
accept rate: 31%

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 25 Mar '16, 09:54

question was seen: 22,481 times

last updated: 03 Dec '19, 15:18

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