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

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


       

        if (reader.getEventType() == XMLStreamConstants.START_ELEMENT
            && reader.getLocalName().equals(ELEMENT_NAME_BOUND)) {
          LOG.fine("Legacy <bound> element encountered.");
          sink.process(new BoundContainer(readBound()));
        }
       
        if (reader.getEventType() == XMLStreamConstants.START_ELEMENT
            && reader.getLocalName().equals(ELEMENT_NAME_BOUNDS)) {
          sink.process(new BoundContainer(readBounds(generator)));
        }

        while (reader.getEventType() == XMLStreamConstants.START_ELEMENT) {     
          // Node, way, relation
          if (reader.getLocalName().equals(ELEMENT_NAME_NODE)) {
View Full Code Here


  @Test
  public void computeBoundNoNodesWithBound() {
    SinkEntityInspector inspector = new SinkEntityInspector();
    BoundComputer bc = new BoundComputer("NewBound");
    bc.setSink(inspector);
    bc.process(new BoundContainer(new Bound("Test")));
    bc.complete();
    bc.release();

    Assert.assertNull(inspector.getLastEntityContainer());
  }
View Full Code Here

  @Test
  public void removeExistingBoundTest() {
    SinkEntityInspector inspector = new SinkEntityInspector();
    BoundSetter setter = new BoundSetter(null);
    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();
   
View Full Code Here

  public void overwriteBoundTest() {
    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();
   
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public void end() {
    getSink().process(new BoundContainer(bound));
    bound = null;
  }
View Full Code Here

        // Only post a bound downstream if both upstream sources had a bound.
        // (Otherwise there's either nothing to post or the posted bound is going
        // to be smaller than the actual data, which is bad)
        if (bound0 != null && bound1 != null) {
          sink.process(new BoundContainer(bound0.union(bound1)));
        } else if ((bound0 != null && bound1 == null)
            || (bound0 == null && bound1 != null)) {
          handleBoundRemoved(bound0 == null);
        }
      }
View Full Code Here

   * Test passing a Bound which intersects the filter area.
   */
  @Test
  public final void testProcessBoundContainer1() {
    Bound compareBound;
    simpleAreaFilter.process(new BoundContainer(intersectingBound));
    simpleAreaFilter.complete();
    compareBound = (Bound) entityInspector.getLastEntityContainer().getEntity();
    assertTrue(Double.compare(compareBound.getRight(), 20) == 0);
    assertTrue(Double.compare(compareBound.getLeft(), 10) == 0);
    assertTrue(Double.compare(compareBound.getTop(), 20) == 0);
View Full Code Here

  /**
   * Test the non-passing of a Bound which does not intersect the filter area.
   */
  @Test
  public final void testProcessBoundContainer2() {
    simpleAreaFilter.process(new BoundContainer(nonIntersectingBound));
    simpleAreaFilter.complete();
    assertNull(entityInspector.getLastEntityContainer());
  }
View Full Code Here

   * Test passing a Bound which intersects the filter area.
   */
  @Test
  public final void testProcessBoundContainer1() {
    Bound compareBound;
    polyAreaFilter.process(new BoundContainer(intersectingBound));
    polyAreaFilter.complete();
    compareBound = (Bound) entityInspector.getLastEntityContainer().getEntity();
    assertTrue(Double.compare(compareBound.getRight(), 20) == 0);
    assertTrue(Double.compare(compareBound.getLeft(), 0) == 0);
    assertTrue(Double.compare(compareBound.getTop(), 20) == 0);
View Full Code Here

   * Test passing a Bound which crosses the antimeredian and intersects the filter area.
   */
  @Test
  public final void testProcessBoundContainer2() {
    Bound compareBound;
    polyAreaFilter.process(new BoundContainer(crossingIntersectingBound));
    polyAreaFilter.complete();
    compareBound = (Bound) entityInspector.getLastEntityContainer().getEntity();
    assertTrue(Double.compare(compareBound.getRight(), 20) == 0);
    assertTrue(Double.compare(compareBound.getLeft(), -20) == 0);
    assertTrue(Double.compare(compareBound.getTop(), 20) == 0);
View Full Code Here

TOP

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

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.