} else {
/* try to read file using Osmosis */
try {
osmData = new OsmosisReader(osmFile).getData();
} catch (IOException e) {
System.out.println("could not read file," +
" trying workaround for files created by JOSM");
useJOSMHack = true;
}
}
/* create a temporary "cleaned up" file as workaround for JOSM files */
if (useJOSMHack) {
File tempFile;
try {
tempFile = JOSMFileHack.createTempOSMFile(osmFile);
} catch (Exception e2) {
throw new IOException("could not read OSM file" +
" (not even with workaround for JOSM files)", e2);
}
osmData = new OsmosisReader(tempFile).getData();
}
return createRepresentations(osmData, worldModules, config, targets);