
Hello, I meet an error with PBF files produced by splitter and used with mkgmap : "Error at line 1, col 1 Bad file format... it occurs with Ireland.osm.pbf from geofabrik.de. (mkgmap v2172 & splitter v200) Is there a way to convert PBF file produced by splitter into OSM format (or how can I used PBF files produced by splitter with mkgmap) ? Should I add an option in command line ? Please help ! David

On 2012-01-18 17:18, David wrote:
Hello,
I meet an error with PBF files produced by splitter and used with mkgmap : "Error at line 1, col 1 Bad file format... it occurs with Ireland.osm.pbf from geofabrik.de. (mkgmap v2172 & splitter v200)
If I understand correctly, this means that mkgmap is trying to read the pbf files as xml files. In my experience, this is because the pbf jars (protobuf.jar and osmpbf.jar) were unavailable during build and/or runtime.
Is there a way to convert PBF file produced by splitter into OSM format (or how can I used PBF files produced by splitter with mkgmap) ? Should I add an option in command line ?
There are a few options: * tell splitter to output xml (--output=xml) * use osmconvert or osmosis to convert the .pbf produced by splitter to something else * rebuild mkgmap with pbf support and make sure the jars are available during runtime To get mkgmap to build and run with pbf support, I did the following: 1. modified resources/MANIFEST.MF and changed osmprotobuf.jar to osmpbf.jar (I'm guessing it changed names at some point in the past) 2. modified external.properties to change the protobuf.jar and osmprotobuf.jar variables to point to where I had protobuf.jar and osmpbf.jar installed 3. after mkgmap was done building, I copied protobuf.jar and osmpbf.jar to the directory containing the built mkgmap.jar I used the protobuf.jar and osmpbf.jar from the splitter svn repository. Hope this helps, Richard

Hello,
To get mkgmap to build and run with pbf support, I did the following: 1. modified resources/MANIFEST.MF and changed osmprotobuf.jar to osmpbf.jar (I'm guessing it changed names at some point in the past) 2. modified external.properties to change the protobuf.jar and osmprotobuf.jar variables to point to where I had protobuf.jar and osmpbf.jar installed 3. after mkgmap was done building, I copied protobuf.jar and osmpbf.jar to the directory containing the built mkgmap.jar
I used the protobuf.jar and osmpbf.jar from the splitter svn repository.
I stumbled about this problem again and again. The build.xml for splitter creates the /dist/lib directory and copies required jar files to it. I thought this should be done in mkgmap as well, but since nobody else complained I thought I missed something. I am busy with the LocationHook, so maybe someone else has time to improve that? Ciao, Gerd

On 2012-01-19 05:36, Gerd Petermann wrote:
Hello,
To get mkgmap to build and run with pbf support, I did the following: 1. modified resources/MANIFEST.MF and changed osmprotobuf.jar to osmpbf.jar (I'm guessing it changed names at some point in the past) 2. modified external.properties to change the protobuf.jar and osmprotobuf.jar variables to point to where I had protobuf.jar and osmpbf.jar installed 3. after mkgmap was done building, I copied protobuf.jar and osmpbf.jar to the directory containing the built mkgmap.jar
I used the protobuf.jar and osmpbf.jar from the splitter svn repository.
I stumbled about this problem again and again. The build.xml for splitter creates the /dist/lib directory and copies required jar files to it. I thought this should be done in mkgmap as well, but since nobody else complained I thought I missed something. I am busy with the LocationHook, so maybe someone else has time to improve that?
I'm somewhat familiar with osmosis's build system. It uses Apache Ivy to download the required dependencies (and their dependencies, recursively). I'm tempted to spend some time over the weekend to modify mkgmap's build system to mimic osmosis's approach. Would this interest people? -Richard

Hi
I stumbled about this problem again and again. The build.xml for splitter creates the /dist/lib directory and copies required jar files to it. I thought this should be done in mkgmap as well, but since nobody else complained I thought I missed something.
You are quite right and the mkgmap build should work the same or similar way as for splitter. I shall fix it to follow splitter. ..Steve
participants (4)
-
David
-
Gerd Petermann
-
Richard Hansen
-
Steve Ratcliffe