1

I am trying to replicate the example in this page. I downloaded the data and run this code (the example data of that page can be downloaded from here):

osmosis --rbf sample_osmosis.osm.pbf --nkv keyValueList="amenity.school" --wx schools.osm

I am using Linux Mint 20.2 Cinnamon and installed osmosis by using Sypantic (version 0.47).

I downloaded the example in the previous page and run the previous code in the folder containing the .pbf file.

However, I am getting this error:

osmosis --rbf sample_osmosis.osm.pbf --nkv keyValueList="amenity.school" --wx schools.osm
nov. 18, 2021 11:55:56 P. M. org.openstreetmap.osmosis.core.Osmosis run
INFORMACIÓN: Osmosis Version 0.47
nov. 18, 2021 11:55:56 P. M. org.openstreetmap.osmosis.core.Osmosis run
INFORMACIÓN: Preparing pipeline.
nov. 18, 2021 11:55:56 P. M. org.openstreetmap.osmosis.core.Osmosis run
INFORMACIÓN: Launching pipeline execution.
nov. 18, 2021 11:55:56 P. M. org.openstreetmap.osmosis.core.Osmosis run
INFORMACIÓN: Pipeline executing, waiting for completion.
nov. 18, 2021 11:55:56 P. M. org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion
GRAVE: Thread for task 1-rbf failed
java.lang.NoClassDefFoundError: com/google/common/util/concurrent/MoreExecutors
    at org.openstreetmap.osmosis.pbf2.v0_6.PbfReader.run(PbfReader.java:87)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.ClassNotFoundException: com.google.common.util.concurrent.MoreExecutors
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
    ... 2 more

nov. 18, 2021 11:55:56 P. M. org.openstreetmap.osmosis.core.Osmosis main
GRAVE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks failed.
    at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForCompletion(Pipeline.java:146)
    at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92)
    at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:321)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:234)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

Any idea what might be happening?

antecessor
  • 2,688
  • 6
  • 29
  • 61

2 Answers2

0

I just ran with success your exact command with the Osmosis Version 0.48.3 using your example data (osmosis --rbf sample_osmosis.osm.pbf --nkv keyValueList="amenity.school" --wx school.osm): INFOS: Total execution time: 439 milliseconds.

My Osmosis version is possibly different from yours, but the sample_osmosis.osm.pbf file possibly evolved too.

FYI I encountered on 2022-07-20 the same error message ("GRAVE: Thread for task 1-rbf failed") using the latest GeoFabrik OSM data from https://download.geofabrik.de/europe/monaco-220719.osm.pbf with a basic Osmosis command: osmosis --read-pbf file=monaco-latest.osm.pbf --write-xml file=monaco-latest.osm. After analysis and exchange with the GeoFabrik support, it was related to a bug that has been fixed the day after.

Waiting for a format fix, a good workaround has been to "clean" the pbf with osmconvert: osmconvert" monaco-latest.osm.pbf>monaco-new.osm.pbf --out-pbf

Franck Durand
  • 31
  • 1
  • 5
0

Tutorials

Description

After encountering this problem I used osmium to extract .pbf to .osm

osmium cat xxx.pbf -o xxx.osm