Hi,
i have to merge a lot of small *.osm files together.
The first try was to create a windows .bat file but the command line was longer than supported from windows.
Now i wrote 2 groovy scripts and call osmosis directly. Unfortunately it looks like it can't find/load plugins: org.openstreetmap.osmosis.core.OsmosisRuntimeException: Task type fast-read-xml
There are the groovy files: merge.groovy String localDirectory = new File(getClass().protectionDomain.codeSource.location.path).parent String urlBase = "file:/" + localDirectory + "osmosis-0.39\lib\default\"; URL[] urls = [new URL(urlBase + "plexus-classworlds-2.2.2.jar")]; ClassLoader classLoader = new URLClassLoader(urls, getClass().getClassLoader()); GroovyShell myGroovyShell4Merge = new GroovyShell(classLoader, binding); processErrorStatus = myGroovyShell4Merge.evaluate(new File(localDirectory, "/innerMergeCall.groovy"))
innerMergeCall.groovy String localDirectory = new File(getClass().protectionDomain.codeSource.location.path).parent File dir = new File("tmp/osm_parts"); if(dir.isDirectory()) { List argsList = new ArrayList() String[] subFiles = dir.list() long count = 0; for(String fileStr : subFiles) { argsList.add("--fast-read-xml " + new File(dir, fileStr).canonicalPath) count++ } for(int ii = 1; ii < count; ii++) { argsList.add("--merge") } argsList.add("--wx " + new File(localDirectory, "tmp/osm/merged.osm")) String[] args = new String[argsList.size()] args = argsList.toArray(args) String myAppHome = new File(localDirectory, "osmosis-0.39").canonicalPath System.setProperty("app.home", myAppHome) System.setProperty("classworlds.conf", myAppHome + "/config/plexus.conf") org.codehaus.classworlds.Launcher.main(args) }
Does anyone have an idea what going wrong?
Yours Rüdiger
asked 14 Sep '11, 11:31

rgubler
15●2●3●2
accept rate: 0%
closed 14 Sep '11, 16:49

Pieren
9.8k●20●83●157
This help website is not relevant for such software issues. Please contact the dev@openstreetmap.org or osmosis-dev@openstreetmap.org mailing lists where you might have a better chance to get an answer.
... or ask at http://forum.osm.org