Examples of XmlChangeReader


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

        // 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

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

  }
 
 
  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

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

    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

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

   
    // 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

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


  @Override
  public XmlChangeReader getData(long sequence) {
    File changeFile = sequenceFormatter.getFormattedName(sequence, ".osc.gz");
    return new XmlChangeReader(changeFile, false, CompressionMethod.GZip);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.