Package org.openstreetmap.osmosis.core.container.v0_6

Examples of org.openstreetmap.osmosis.core.container.v0_6.NodeContainer


    SinkEntityInspector inspector = new SinkEntityInspector();
    Bound newBound = new Bound(2, 1, 4, 3, "NewBound");
    BoundSetter setter = new BoundSetter(newBound);
    setter.setSink(inspector);
    setter.process(new BoundContainer(new Bound("Test")));
    setter.process(new NodeContainer(new Node(
        new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    setter.complete();
    setter.release();
   
    Iterator<EntityContainer> iterator = inspector.getProcessedEntities().iterator();
View Full Code Here


  public void setNewBoundTest() {
    SinkEntityInspector inspector = new SinkEntityInspector();
    Bound newBound = new Bound(2, 1, 4, 3, "NewBound");
    BoundSetter setter = new BoundSetter(newBound);
    setter.setSink(inspector);
    setter.process(new NodeContainer(new Node(
        new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    setter.complete();
    setter.release();
   
    EntityContainer ec = inspector.getProcessedEntities().iterator().next();
View Full Code Here

  public void complete() {

    // send on all required nodes
    ReleasableIterator<NodeContainer> nodeIterator = allNodes.iterate();
    while (nodeIterator.hasNext()) {
      NodeContainer nodeContainer = nodeIterator.next();
      long nodeId = nodeContainer.getEntity().getId();
      if (!requiredNodes.get(nodeId)) {
        continue;
      }
      sink.process(nodeContainer);
    }
View Full Code Here

      osmNode = new org.openstreetmap.osmosis.core.domain.v0_6.Node(entityData, fieldDecoder.decodeLatitude(node
          .getLat()), fieldDecoder.decodeLatitude(node.getLon()));

      // Add the bound object to the results.
      decodedEntities.add(new NodeContainer(osmNode));
    }
  }
View Full Code Here

      node = new org.openstreetmap.osmosis.core.domain.v0_6.Node(entityData,
          fieldDecoder.decodeLatitude(latitude), fieldDecoder.decodeLongitude(longitude));

      // Add the bound object to the results.
      decodedEntities.add(new NodeContainer(node));
    }
  }
View Full Code Here

   * Test processing a Node entity.
   */
  @Test
  public final void testProcess3() {
    testOsmWriter.process(
        new NodeContainer(
          new Node(
            new CommonEntityData(
                1234, 0, new Date(), new OsmUser(12, "OsmosisTest"), 0, new ArrayList<Tag>()),
            20, 20)));
    // Nothing to assert; just expect no exception
View Full Code Here

      try {
        sink.initialize(Collections.<String, Object>emptyMap());
        if (publishBound) {
          sink.process(new BoundContainer(bound));
        }
        sink.process(new NodeContainer(createNode()));
        sink.complete();
      } finally {
        sink.release();
      }
    }
View Full Code Here

    simplifier.setChangeSink(new NullChangeWriter());
    simplifier.initialize(new HashMap<String, Object>());
    Node node;

    node = new Node(new CommonEntityData(1, 2, new Date(), OsmUser.NONE, 2), 1, 1);
    simplifier.process(new ChangeContainer(new NodeContainer(node), ChangeAction.Modify));

    try {
      node = new Node(new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1);
      simplifier.process(new ChangeContainer(new NodeContainer(node), ChangeAction.Modify));
    } catch (OsmosisRuntimeException e) {
      if (e.getMessage().startsWith("Pipeline entities are not sorted")) {
        return;
      }
      throw e;
View Full Code Here

    simplifier.setChangeSink(new NullChangeWriter());
    simplifier.initialize(new HashMap<String, Object>());
    Node node;

    node = new Node(new CommonEntityData(2, 2, new Date(), OsmUser.NONE, 2), 1, 1);
    simplifier.process(new ChangeContainer(new NodeContainer(node), ChangeAction.Modify));

    try {
      node = new Node(new CommonEntityData(1, 2, new Date(), OsmUser.NONE, 1), 1, 1);
      simplifier.process(new ChangeContainer(new NodeContainer(node), ChangeAction.Modify));
    } catch (OsmosisRuntimeException e) {
      if (e.getMessage().startsWith("Pipeline entities are not sorted")) {
        return;
      }
      throw e;
View Full Code Here

    way = new Way(new CommonEntityData(2, 2, new Date(), OsmUser.NONE, 2));
    simplifier.process(new ChangeContainer(new WayContainer(way), ChangeAction.Modify));

    try {
      node = new Node(new CommonEntityData(1, 2, new Date(), OsmUser.NONE, 1), 1, 1);
      simplifier.process(new ChangeContainer(new NodeContainer(node), ChangeAction.Modify));
    } catch (OsmosisRuntimeException e) {
      if (e.getMessage().startsWith("Pipeline entities are not sorted")) {
        return;
      }
      throw e;
View Full Code Here

TOP

Related Classes of org.openstreetmap.osmosis.core.container.v0_6.NodeContainer

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.