Package org.openstreetmap.osmosis.xml.v0_6

Examples of org.openstreetmap.osmosis.xml.v0_6.XmlWriter


    factoryMap.put("fast-read-xml", new FastXmlReaderFactory());
    factoryMap.put("rx", new XmlReaderFactory());
        factoryMap.put("read-xml-change"new XmlChangeReaderFactory());
        factoryMap.put("upload-xml-change", new XmlChangeUploaderFactory());
    factoryMap.put("rxc", new XmlChangeReaderFactory());
    factoryMap.put("write-xml", new XmlWriterFactory());
    factoryMap.put("wx", new XmlWriterFactory());
    factoryMap.put("write-xml-change", new XmlChangeWriterFactory());
    factoryMap.put("wxc", new XmlChangeWriterFactory());
    factoryMap.put("read-api", new XmlDownloaderFactory());
    factoryMap.put("ra", new XmlDownloaderFactory());
   
    factoryMap.put("read-xml-0.6", new XmlReaderFactory());
    factoryMap.put("fast-read-xml-0.6", new FastXmlReaderFactory());
    factoryMap.put("read-xml-change-0.6", new XmlChangeReaderFactory());
    factoryMap.put("write-xml-0.6", new XmlWriterFactory());
    factoryMap.put("write-xml-change-0.6", new XmlChangeWriterFactory());
    factoryMap.put("read-api-0.6", new XmlDownloaderFactory());
   
    return factoryMap;
  }
View Full Code Here


    /**
     * Reads all data from the file and send it to the sink.
     */
    public void run() {
      InputStream inputStream = null;
      FastXmlParser parser = null;
     
      try {
        sink.initialize(Collections.<String, Object>emptyMap());
       
        // make "-" an alias for /dev/stdin
        if (file.getName().equals("-")) {
          inputStream = System.in;
        } else {
          inputStream = new FileInputStream(file);
        }
       
       
        inputStream =
          new CompressionActivator(compressionMethod).
            createCompressionInputStream(inputStream);
       
            XMLInputFactory factory = XMLInputFactory.newInstance();
            factory.setProperty(XMLInputFactory.IS_COALESCING, false);
            factory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, false);
            factory.setProperty(XMLInputFactory.IS_VALIDATING, false);
            XMLStreamReader xpp = factory.createXMLStreamReader(inputStream);
       
        parser = new FastXmlParser(sink, xpp, enableDateParsing);
       
        parser.readOsm();
       
        sink.complete();
       
      } catch (Exception e) {
        throw new OsmosisRuntimeException("Unable to read XML file " + file + ".", e);
View Full Code Here

        new CompressionActivator(compressionMethod).
          createCompressionInputStream(inputStream);
     
      parser = createParser();
     
      parser.parse(inputStream, new OsmChangeHandler(changeSink, enableDateParsing));
     
      changeSink.complete();
     
    } catch (SAXParseException e) {
      throw new OsmosisRuntimeException(
View Full Code Here

        } else {
            this.myComment = aComment;
        }
        this.myPassword = aPassword;

        this.myChangeWriter = new OsmChangeWriter("osmChange", 0);
    }
View Full Code Here

   *            The writer to send all data to.
   */
  public XmlChangeWriter(BufferedWriter writer) {
    super(writer);

        osmChangeWriter = new OsmChangeWriter("osmChange", 0);
  }
View Full Code Here

   *            Specifies the compression method to employ.
   */
  public XmlChangeWriter(File file, CompressionMethod compressionMethod) {
      super(file, compressionMethod);

        osmChangeWriter = new OsmChangeWriter("osmChange", 0);
    }
View Full Code Here

            inputStream = new CompressionActivator(compressionMethod)
                    .createCompressionInputStream(inputStream);

            parser = createParser();

            parser.parse(inputStream, new OsmHandler(sink, enableDateParsing));

            sink.complete();

        } catch (SAXParseException e) {
            throw new OsmosisRuntimeException("Unable to parse xml file " + file + ".  publicId=("
View Full Code Here

        new CompressionActivator(compressionMethod).
          createCompressionInputStream(inputStream);
     
      parser = createParser();
     
      parser.parse(inputStream, new OsmHandler(sink, enableDateParsing));
     
      sink.complete();
     
    } catch (SAXParseException e) {
      throw new OsmosisRuntimeException(
View Full Code Here

            // First send the Bound down the pipeline
            mySink.process(new BoundContainer(new Bound(myRight, myLeft, myTop, myBottom, myBaseUrl)));

            try {
                parser.parse(inputStream, new OsmHandler(mySink, true));
            } finally {
                inputStream.close();
                inputStream = null;
            }
View Full Code Here

   *            The writer to send all data to.
   */
  public XmlWriter(BufferedWriter writer) {
    super(writer);
   
    osmWriter = new OsmWriter("osm", 0, true, false);
  }
View Full Code Here

TOP

Related Classes of org.openstreetmap.osmosis.xml.v0_6.XmlWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.