我需要将 .osm 文件转换为 .map 以测试 Mapsforge Android 应用程序。因此,我尝试在我的 Ubuntu 12.04 PC 上安装 Osmosis。我使用带有以下命令的 debian 软件包安装 osmosis:
sudo apt-get install osmosis
安装完成后,我从http://code.google.com/p/mapsforge/downloads/list下载 mapsforge jar 文件并将其复制到
~/.openstreetmap/osmosis/plugins/
文件夹。但是,当我尝试执行以下命令时:
osmosis --rx file=rethimno.osm --mw file=rethimno.map
我得到以下堆栈跟踪:
Mar 19, 2013 11:46:27 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.40.1
Mar 19, 2013 11:46:27 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Mar 19, 2013 11:46:27 AM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom
at javax.xml.xpath.XPathFactory.newInstance(XPathFactory.java:72)
at org.mapsforge.map.writer.OSMTagMapping.<init>(OSMTagMapping.java:123)
at org.mapsforge.map.writer.OSMTagMapping.getInstance(OSMTagMapping.java:110)
at org.mapsforge.map.writer.OSMTagMapping.getInstance(OSMTagMapping.java:94)
at org.mapsforge.map.writer.model.MapWriterConfiguration.loadTagMappingFile(MapWriterConfiguration.java:412)
at org.mapsforge.map.writer.osmosis.MapFileWriterFactory.createTaskManagerImpl(MapFileWriterFactory.java:53)
at org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory.createTaskManager(TaskManagerFactory.java:60)
at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.buildTasks(Pipeline.java:50)
at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.prepare(Pipeline.java:112)
at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:86)
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(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:328)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:408)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351)
at org.codehaus.classworlds.Launcher.main(Launcher.java:31)
有没有人遇到过同样的问题?如果是,我该如何解决?
谢谢你。