org.osm2world.core.osm.creation
Class JOSMFileHack

Object
  extended by JOSMFileHack

public final class JOSMFileHack
extends Object

workaround for the inability of Osmosis to read the JOSM XML format.


Method Summary
static File createTempOSMFile(File josmFile)
          creates a temporary file in the .osm format.
static boolean isJOSMGenerated(File file)
          Returns true if the file was identified as being generated by JOSM.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isJOSMGenerated

public static final boolean isJOSMGenerated(File file)
Returns true if the file was identified as being generated by JOSM. This method peeks into the first lines of the file, trying to find the generator tag.


createTempOSMFile

public static final File createTempOSMFile(File josmFile)
                                    throws IOException,
                                           ParserConfigurationException,
                                           SAXException,
                                           TransformerException
creates a temporary file in the .osm format. This removes some JOSM-specific attributes present in the original file, and sets fake versions for unversioned elements. The generated file should not be used for anything except feeding it to OSM2World.

Throws:
IOException
ParserConfigurationException
SAXException
TransformerException