我最近下载了Osmosis,将.osm.pbf文件转换为.map文件。我在这个应用程序中使用Windows 7。我从他们的系统下载了最新的zip file,并将mapfilewriter jar文件放入/ lib / default /文件夹中。但是,当我在.bat文件中运行此语句时,我一直收到此错误:
osmosis --read-pbf file=taiwanlatest.osm.pbf --mapfile-writer file=helloworld.map
Mar 19, 2013 7:34:49 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.42
Mar 19, 2013 7:34:49 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Mar 19, 2013 7:34:50 PM org.mapsforge.map.writer.osmosis.MapFileWriterTask <init>
INFO: mapfile-writer version: mapsforge-map-writer-0.3.0
Mar 19, 2013 7:34:50 PM org.mapsforge.map.writer.osmosis.MapFileWriterTask <init>
INFO: mapfile format specification version: 3
Mar 19, 2013 7:34:50 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
Mar 19, 2013 7:34:50 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
Mar 19, 2013 7:34:50 PM org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion
SEVERE: Thread for task 1-read-pbf failed
java.lang.AbstractMethodError: org.mapsforge.map.writer.osmosis.MapFileWriterTas
k.initialize(Ljava/util/Map;)V
at crosby.binary.osmosis.OsmosisReader.run(OsmosisReader.java:43)
at java.lang.Thread.run(Thread.java:722)
Mar 19, 2013 7:34:50 PM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks failed
.
at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForComple
tion(Pipeline.java:146)
at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92)
at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Laun
cher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:239)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
我已经读过了,这似乎是由于渗透本身而发生的,而且我必须使用较低版本的渗透。我尝试使用Osmosis版本0.40,当我运行.bat文件时,我遇到了这个错误:
Error: Could not find or load main class org.codehaus.classworlds.Launcher
我到底哪里出错?
答案 0 :(得分:9)
经过多次反复试验,我终于下载了Osmosis版本0.40.1 here。
另外,我在/ lib / default文件夹中添加了4个jar文件:
之后,我创建了一个名为“osmosis-plugins.conf”的新conf文件,并在其中添加了一行“org.mapsforge.map.writer.osmosis.MapFileWriterPluginLoader”。
完成这些步骤后,Osmosis终于有效了(虽然我不确定这是否是最正确的方法)。
但是,我仍然不明白为什么最新版本的Osmosis不起作用。
希望这可以帮助那些面临与我类似问题的人!
答案 1 :(得分:0)
也遇到了这个问题,这是我的解决方案:
mapsforge-map-writer
jar文件(
依赖项)来自https://search.maven.org/search?q=mapsforge-map osmosis/lib/default
目录--mapfile-writer
命令。希望这会有所帮助!