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

I've donwloaded the following maps:

andorra-latest.osm.pbf       https://download.geofabrik.de/europe/andorra-latest.osm.pbf
azores-latest.osm.pbf        https://download.geofabrik.de/europe/azores-latest.osm.pbf
cyprus-latest.osm.pbf        https://download.geofabrik.de/europe/cyprus-latest.osm.pbf

And I am using osmconvert to merge maps. I read this answer to merge maps. So my command of merging the above maps looks like this:

.\osmconvert andorra-latest.osm.pbf --out-o5m | .\osmconvert - azores-latest.osm.pbf | .\osmconvert - cyprus-latest.osm.pbf -o=all.osm.pbf

However, the osmconvert shows the following errors after running the above command:

osmconvert Error: unknown file format: standard input
osmconvert Error: could not open input file: .osm.pbf

An image: alt text

However, the merging perfectly works in Windows 7 and Windows Server 2016 Standard

Does anybody know how to solve this error?

asked 02 Dec '19, 09:38

CuriosityBeginner's gravatar image

CuriosityBeg...
31336
accept rate: 0%


According to the documentation, merging files can be done in one shot by listing all of the input files. In your case, the command would be simply:

.\osmconvert andorra-latest.osm.pbf azores-latest.osm.pbf cyprus-latest.osm.pbf -o=all.osm.pbf

EDIT: Apparently you can't merge like this with .osm.pbf files. You can with .o5m files.

permanent link

answered 02 Dec '19, 18:19

alester's gravatar image

alester
6.6k266100
accept rate: 28%

edited 03 Dec '19, 17:15

thanks for your reply. However, it says osmconvert Error: more than one.pbf input file is not allowed Maybe you have other suggestions?

(02 Dec '19, 19:51) CuriosityBeg...
2

Looks like merging only works with format o5m and not with pbf. So you have to convert your files to o5m first: osmconvert andorra-latest.osm.pbf -o=andorra-latest.osm.o5m. Afterwards you can merge them. Not sure if the merge process is able to write them as pbf directly or if you need to write o5m again and convert it to pbf during an additional step.

Alternatively just use the more modern and faster osmium-tool: osmium merge andorra-latest.osm.pbf azores-latest.osm.pbf cyprus-latest.osm.pbf -o all.osm.pbf.

(03 Dec '19, 15:49) scai ♦

@scai how can I get exe of osmium-tool? Thanks in advance.

(10 Dec '19, 08:18) CuriosityBeg...
2

@CuriosityBeginner As far as I know there are no official Windows builds available. Also see related discussions at https://github.com/osmcode/osmium-tool/issues/59 and https://github.com/osmcode/osmium-tool/pull/105. https://github.com/osmcode/osmium-tool#building explains how to build it yourself using Visual Studio C++. On Linux, osmium-tool is available via the package manager on various distributions.

(10 Dec '19, 08:37) scai ♦

@scai: I would not recommend osmium tool for Windows users. Here the sensible approach is to convert each osm.pbf file into an o5m file (perhaps in a temporary working directory) & then merge them as @alester says.

(10 Dec '19, 13:55) SK53 ♦

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:

×362
×47
×41
×12

question asked: 02 Dec '19, 09:38

question was seen: 4,470 times

last updated: 10 Dec '19, 13:55

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