Search in sources :

Example 21 with BoundingBoxDoubleXY

use of com.revolsys.geometry.model.impl.BoundingBoxDoubleXY in project com.revolsys.open by revolsys.

the class STRtreeTest method testDisallowedInserts.

public void testDisallowedInserts() {
    final StrTree t = new StrTree(5);
    t.insertItem(new BoundingBoxDoubleXY(0, 0, 0, 0), new Object());
    t.insertItem(new BoundingBoxDoubleXY(0, 0, 0, 0), new Object());
    t.getItems(BoundingBox.empty());
    try {
        t.insertItem(new BoundingBoxDoubleXY(0, 0, 0, 0), new Object());
        assertTrue(false);
    } catch (final IllegalStateException e) {
        assertTrue(true);
    }
}
Also used : StrTree(com.revolsys.geometry.index.strtree.StrTree) BoundingBoxDoubleXY(com.revolsys.geometry.model.impl.BoundingBoxDoubleXY)

Example 22 with BoundingBoxDoubleXY

use of com.revolsys.geometry.model.impl.BoundingBoxDoubleXY in project com.revolsys.open by revolsys.

the class RectanglePredicateSyntheticTest method getTestGeometries.

private List<Geometry> getTestGeometries() {
    final BoundingBox testEnv = new BoundingBoxDoubleXY(this.rectEnv.getMinX() - this.bufSize, this.rectEnv.getMinY() - this.bufSize, this.rectEnv.getMaxX() + this.bufSize, this.rectEnv.getMaxY() + this.bufSize);
    final List<Geometry> testGeoms = newTestGeometries(testEnv, 5, this.testGeomSize);
    return testGeoms;
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) BoundingBox(com.revolsys.geometry.model.BoundingBox) BoundingBoxDoubleXY(com.revolsys.geometry.model.impl.BoundingBoxDoubleXY)

Example 23 with BoundingBoxDoubleXY

use of com.revolsys.geometry.model.impl.BoundingBoxDoubleXY in project com.revolsys.open by revolsys.

the class MCIndexedPointInAreaLocator method locate.

@Override
public Location locate(final double x, final double y) {
    final RayCrossingCounter rcc = new RayCrossingCounter(x, y);
    final MCSegmentCounter mcSegCounter = new MCSegmentCounter(rcc);
    final BoundingBox rayEnv = new BoundingBoxDoubleXY(x, y, this.maxXExtent, y);
    final List mcs = this.index.query(rayEnv);
    countSegs(rcc, rayEnv, mcs, mcSegCounter);
    return rcc.getLocation();
}
Also used : RayCrossingCounter(com.revolsys.geometry.algorithm.RayCrossingCounter) BoundingBox(com.revolsys.geometry.model.BoundingBox) List(java.util.List) BoundingBoxDoubleXY(com.revolsys.geometry.model.impl.BoundingBoxDoubleXY)

Example 24 with BoundingBoxDoubleXY

use of com.revolsys.geometry.model.impl.BoundingBoxDoubleXY in project com.revolsys.open by revolsys.

the class TestSerializable method newData.

List newData() {
    final List objList = new ArrayList();
    final BoundingBox env = new BoundingBoxDoubleXY(123, 123, 456, 456);
    objList.add(env);
    objList.add(GeometryTestFactory.newBox(fact, 0.0, 100.0, 10, 10.0));
    return objList;
}
Also used : BoundingBox(com.revolsys.geometry.model.BoundingBox) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) BoundingBoxDoubleXY(com.revolsys.geometry.model.impl.BoundingBoxDoubleXY)

Example 25 with BoundingBoxDoubleXY

use of com.revolsys.geometry.model.impl.BoundingBoxDoubleXY in project com.revolsys.open by revolsys.

the class QuadtreeCorrectTest method queryGrid.

void queryGrid(final int nGridCells, final double cellSize) {
    final Stopwatch sw = new Stopwatch();
    sw.start();
    int gridSize = (int) Math.sqrt(nGridCells);
    gridSize += 1;
    final double extent = MAX_EXTENT - MIN_EXTENT;
    final double gridInc = extent / gridSize;
    for (int i = 0; i < gridSize; i++) {
        for (int j = 0; j < gridSize; j++) {
            final double x = MIN_EXTENT + gridInc * i;
            final double y = MIN_EXTENT + gridInc * j;
            final BoundingBox env = new BoundingBoxDoubleXY(x, y, x + cellSize, y + cellSize);
            queryTest(env);
        // queryTime(env);
        }
    }
// System.out.println("Time = " + sw.getTimeString());
}
Also used : BoundingBox(com.revolsys.geometry.model.BoundingBox) Stopwatch(com.revolsys.geometry.util.Stopwatch) BoundingBoxDoubleXY(com.revolsys.geometry.model.impl.BoundingBoxDoubleXY)

Aggregations

BoundingBoxDoubleXY (com.revolsys.geometry.model.impl.BoundingBoxDoubleXY)26 BoundingBox (com.revolsys.geometry.model.BoundingBox)18 ArrayList (java.util.ArrayList)7 List (java.util.List)6 Point (com.revolsys.geometry.model.Point)5 Geometry (com.revolsys.geometry.model.Geometry)4 StrTree (com.revolsys.geometry.index.strtree.StrTree)3 KdNode (com.revolsys.geometry.index.kdtree.KdNode)2 KdTree (com.revolsys.geometry.index.kdtree.KdTree)2 LineString (com.revolsys.geometry.model.LineString)2 PointDoubleXY (com.revolsys.geometry.model.impl.PointDoubleXY)2 Iterator (java.util.Iterator)2 Lists (com.revolsys.collection.list.Lists)1 MapEx (com.revolsys.collection.map.MapEx)1 ScaledIntegerTriangulatedIrregularNetwork (com.revolsys.elevation.tin.compactbinary.ScaledIntegerTriangulatedIrregularNetwork)1 AsciiTin (com.revolsys.elevation.tin.tin.AsciiTin)1 RayCrossingCounter (com.revolsys.geometry.algorithm.RayCrossingCounter)1 Area (com.revolsys.geometry.cs.Area)1 Authority (com.revolsys.geometry.cs.Authority)1 ParameterValueString (com.revolsys.geometry.cs.ParameterValueString)1