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's gravatar image

rgubler
15232
accept rate: 0%

closed 14 Sep '11, 16:49

Pieren's gravatar image

Pieren
9.7k2075157

2

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.

(14 Sep '11, 16:52) Pieren

... or ask at http://forum.osm.org

(15 Sep '11, 17:25) stephan75

The question has been closed for the following reason "Question is off-topic or not relevant" by Pieren 14 Sep '11, 16:49

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×219
×1

question asked: 14 Sep '11, 11:31

question was seen: 1,589 times

last updated: 15 Sep '11, 17:25

powered by OSQA