Package org.openstreetmap.osmosis.xml.v0_6

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


    Map<String, TaskManagerFactory> factoryMap;
   
    factoryMap = new HashMap<String, TaskManagerFactory>();
   
    factoryMap.put("read-xml", new XmlReaderFactory());
    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());
   
View Full Code Here


        // producer/consumer approach so that the osm parse thread produces features into the
        // iterator's queue, and WorkingTree.insert consumes them on this thread
        QueueIterator<Feature> target = new QueueIterator<Feature>(queueCapacity, timeout,
                timeoutUnit);

        XmlChangeReader reader = new XmlChangeReader(file, true, resolveCompressionMethod(file));

        ProgressListener progressListener = getProgressListener();
        ConvertAndImportSink sink = new ConvertAndImportSink(target, context, workingTree(),
                platform(), new SubProgressListener(progressListener, 100));
        reader.setChangeSink(sink);

        Thread readerThread = new Thread(reader, "osm-diff-reader-thread");
        readerThread.start();

        // used to set the task status name, but report no progress so it does not interfere
View Full Code Here

  }
 
 
  private void processReplicationFile(File replicationFile, ReplicationState replicationState) {
    try {
      XmlChangeReader xmlReader;
     
      // Send the contents of the replication file to the sink but suppress the complete
      // and release methods.
      xmlReader = new XmlChangeReader(replicationFile, true, CompressionMethod.GZip);
     
      // Delegate to the sub-class to process the xml.
      processChangeset(xmlReader, replicationState);
     
    } finally {
View Full Code Here

    sinkInitInvoked = false;
   
    // Send the replication data downstream but don't call any lifecycle
    // methods on the change sink because we're managing those separately.
    if (chunkFile != null) {
      RunnableChangeSource changeReader = new XmlChangeReader(chunkFile, true, CompressionMethod.GZip);
      changeReader.setChangeSink(noLifecycleChangeSink);
      changeReader.run();
    }
   
    changeSink.complete();
  }
View Full Code Here

   
    // Generate a set of tasks for loading the change files and merge them
    // into a single change stream.
    tasks = new ArrayList<RunnableChangeSource>();
    for (File tmpFile : tmpFileList) {
      XmlChangeReader changeReader;
     
      // Generate a change reader task for the current task.
      changeReader = new XmlChangeReader(
        tmpFile,
        true,
        CompressionMethod.GZip
      );
     
      // If tasks already exist, a change merge task must be used to merge
      // existing output with this task output, otherwise this task can be
      // added to the list directly.
      if (tasks.size() > 0) {
        ChangeMerger changeMerger;
       
        // Create a new change merger merging the last task output with the current task.
        changeMerger = new ChangeMerger(ConflictResolutionMethod.LatestSource, 10);
       
        // Connect the inputs of this merger to the most recent change
        // output and the new change output.
        tasks.get(tasks.size() - 1).setChangeSink(changeMerger.getChangeSink(0));
        changeReader.setChangeSink(changeMerger.getChangeSink(1));
       
        tasks.add(changeReader);
        tasks.add(changeMerger);
       
      } else {
View Full Code Here


  @Override
  public XmlChangeReader getData(long sequence) {
    File changeFile = sequenceFormatter.getFormattedName(sequence, ".osc.gz");
    return new XmlChangeReader(changeFile, false, CompressionMethod.GZip);
  }
View Full Code Here

    factoryMap = new HashMap<String, TaskManagerFactory>();
   
    factoryMap.put("read-xml", new XmlReaderFactory());
    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

   
    factoryMap.put("read-xml", new XmlReaderFactory());
    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());
View Full Code Here

        if (!entries.hasNext()) {
            cli.getConsole().println("No differences found");
            return;
        }
        BufferedWriter bufWriter = new BufferedWriter(new FileWriter(new File(file)));
        XmlChangeWriter writer = new XmlChangeWriter(bufWriter);
        while (entries.hasNext()) {
            ChangeContainer change = entries.next();
            writer.process(change);
        }
        writer.complete();
        bufWriter.flush();

    }
View Full Code Here

  /**
   * Runs the changeset extraction.
   */
  public void run() {
    ApidbChangeReader reader;
    XmlChangeWriter writer;
    ChangeTagSorter tagSorter;
    String fileName;
    File tmpFile;
    File file;

    // Generate the changeset file name.
    fileName = new ChangesetFileNameFormatter(config.getChangeFileBeginFormat(), config.getChangeFileEndFormat())
        .generateFileName(intervalBegin, intervalEnd);

    // Generate the temporary output file.
    tmpFile = new File(baseDirectory, TMP_FILE_NAME);

    // Generate the changeset output file.
    file = new File(baseDirectory, fileName);

    // Create the output task to write to a compressed xml file.
    writer = new XmlChangeWriter(tmpFile, CompressionMethod.GZip);

    // Create the input task to read the change interval from the database.
    reader = new ApidbChangeReader(config.getDatabaseLoginCredentials(), config.getDatabasePreferences(),
        intervalBegin, intervalEnd, fullHistory);
   
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.