Osm4j and graphhopper trouble

I know you I am unlikely to find someone with a similiar problem, but I am using graphhopper and osm4j in the same project and now I can import osm maps anymore, because the com.graphhopper.reader.osm.GraphHopperOSM suddenly detects 0 edge, 0 nodes etc when reading an osm file. If I comment out the following dependencies the behaviour is back to normal. Does anyone have pointers towards what might be going on here?

<repositories>
    <repository>
        <id>slimjars</id>
        <url>http://mvn.slimjars.com</url>
    </repository>
    <repository>
        <id>topobyte</id>
        <url>http://mvn.topobyte.de</url>
    </repository>
</repositories>

<dependency>
    <groupId>de.topobyte</groupId>
    <artifactId>osm4j-core</artifactId>
    <version>0.1.0</version>
</dependency>
<dependency>
    <groupId>de.topobyte</groupId>
    <artifactId>osm4j-utils</artifactId>
    <version>0.1.2</version>
</dependency>
<dependency>
    <groupId>de.topobyte</groupId>
    <artifactId>osm4j-pbf</artifactId>
    <version>0.1.1</version>
</dependency>
<dependency>
    <groupId>de.topobyte</groupId>
    <artifactId>osm4j-tbo</artifactId>
    <version>0.1.0</version>
</dependency>
<dependency>
    <groupId>de.topobyte</groupId>
    <artifactId>osm4j-geometry</artifactId>
    <version>0.1.0</version>
</dependency>
<dependency>
    <groupId>de.topobyte</groupId>
    <artifactId>osm4j-xml</artifactId>
    <version>0.1.2</version>
</dependency>

the issue seems to be mixed versions of protobuf 3.4.0 and 2.6.1… :roll_eyes:

We use osmosis-osm-binary 0.47 that should use protobuf 3.6.1.

You can try switching to 0.45 that uses protobuf 2.x: https://github.com/graphhopper/graphhopper/blob/master/reader-osm/pom.xml#L28

See also https://github.com/graphhopper/graphhopper/pull/1175

1 Like

that’s valuable advice, thank you

Powered by Discourse