use of org.openstreetmap.osmosis.core.container.v0_6.BoundContainer in project osmosis by openstreetmap.
the class PolygonFilterTest method testProcessBoundContainer2.
/**
* 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);
assertTrue(Double.compare(compareBound.getBottom(), -20) == 0);
assertTrue(compareBound.getOrigin().equals("crossing intersecting"));
}
use of org.openstreetmap.osmosis.core.container.v0_6.BoundContainer in project osmosis by openstreetmap.
the class PolygonFilterTest method testProcessBoundContainer3.
/**
* Test the non-passing of a Bound which does not intersect the filter area.
*/
@Test
public final void testProcessBoundContainer3() {
polyAreaFilter.process(new BoundContainer(nonIntersectingBound));
polyAreaFilter.complete();
assertNull(entityInspector.getLastEntityContainer());
}
use of org.openstreetmap.osmosis.core.container.v0_6.BoundContainer in project osmosis by openstreetmap.
the class PolygonFilterTest method testProcessBoundContainer1.
/**
* 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);
assertTrue(Double.compare(compareBound.getBottom(), 0) == 0);
assertTrue(compareBound.getOrigin().equals("intersecting"));
}
use of org.openstreetmap.osmosis.core.container.v0_6.BoundContainer in project osmosis by openstreetmap.
the class BoundComputer method complete.
@Override
public void complete() {
objects.complete();
if (nodesSeen) {
sink.process(new BoundContainer(new Bound(right, left, top, bottom, this.origin)));
}
try (ReleasableIterator<EntityContainer> i = objects.iterate()) {
while (i.hasNext()) {
sink.process(i.next());
}
}
sink.complete();
}
use of org.openstreetmap.osmosis.core.container.v0_6.BoundContainer in project osmosis by openstreetmap.
the class OsmWriterTest method testProcess2.
/**
* Test processing a repeated Bound entity.
*/
@Test(expected = OsmosisRuntimeException.class)
public final void testProcess2() {
testOsmWriter.process(new BoundContainer(new Bound("source")));
testOsmWriter.process(new BoundContainer(new Bound("source2")));
fail("Expected to throw an exception.");
}
Aggregations