Search in sources :

Example 16 with Stopwatch

use of com.revolsys.geometry.util.Stopwatch in project com.revolsys.open by revolsys.

the class IteratedBufferStressTest method run.

void run() throws Exception {
    final Stopwatch totalSW = new Stopwatch();
    Geometry base = this.geometryFactory.geometry(this.inputWKT);
    double dist = 1.0;
    while (true) {
        final Geometry b1 = doBuffer(base, dist);
        final Geometry b2 = doBuffer(b1, -dist);
        dist += 1;
        base = b2;
    // System.out.println("---------------------- " +
    // totalSW.getTimeString());
    // System.out.println();
    }
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) Stopwatch(com.revolsys.geometry.util.Stopwatch)

Example 17 with Stopwatch

use of com.revolsys.geometry.util.Stopwatch in project com.revolsys.open by revolsys.

the class TestPerfDistanceGeomSet method test.

public void test(final Geometry[] geom) {
    final Stopwatch sw = new Stopwatch();
    final double dist = 0.0;
    for (int i = 0; i < MAX_ITER; i++) {
        testAll(geom);
    }
    if (!this.verbose) {
    // System.out.println(sw.getTimeString());
    }
    if (this.verbose) {
    // System.out.println("Finished in " + sw.getTimeString());
    // System.out.println(" (Distance = " + dist + ")");
    }
}
Also used : Stopwatch(com.revolsys.geometry.util.Stopwatch) Point(com.revolsys.geometry.model.Point)

Example 18 with Stopwatch

use of com.revolsys.geometry.util.Stopwatch in project com.revolsys.open by revolsys.

the class TestPerfFastDistanceFile method testAllDistances.

void testAllDistances(final List geoms, final int maxToScan) {
    final Stopwatch sw = new Stopwatch();
    computeAllDistances(geoms, maxToScan);
// computePairDistance(geoms, 1, 3);
// computePairDistance(geoms, 55, 77);
// System.out.println("Count = " + maxToScan + " Finished in "
// + sw.getTimeString());
}
Also used : Stopwatch(com.revolsys.geometry.util.Stopwatch)

Example 19 with Stopwatch

use of com.revolsys.geometry.util.Stopwatch in project com.revolsys.open by revolsys.

the class RectangleIntersectsPerfTest method test.

void test(final Collection<Geometry> rect, final Geometry g) {
    // System.out.println("Target # pts: " + g.getVertexCount()
    // + " -- # Rectangles: " + rect.size());
    final int maxCount = MAX_ITER;
    final Stopwatch sw = new Stopwatch();
    final int count = 0;
    for (int i = 0; i < MAX_ITER; i++) {
        for (final Geometry element : rect) {
            // rect[j].relate(g);
            element.intersects(g);
        }
    }
// System.out.println("Finished in " + sw.getTimeString());
// System.out.println();
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) Stopwatch(com.revolsys.geometry.util.Stopwatch) Point(com.revolsys.geometry.model.Point)

Example 20 with Stopwatch

use of com.revolsys.geometry.util.Stopwatch in project com.revolsys.open by revolsys.

the class DelaunayPerfTest method run.

public void run(final int nPts) {
    final List<Point> pts = randomPoints(nPts);
    // System.out.println("# pts: " + pts.size());
    final Stopwatch sw = new Stopwatch();
    final QuadEdgeDelaunayTinBuilder builder = new QuadEdgeDelaunayTinBuilder(GEOMETRY_FACTORY);
    builder.insertVertices(pts);
    // Geometry g = builder.getEdges(geomFact);
    // don't actually form output geometry, to save time and memory
    builder.getSubdivision();
// System.out.println(" -- Time: " + sw.getTimeString() + " Mem: "
// + Memory.usedTotalString());
// System.out.println(g);
}
Also used : QuadEdgeDelaunayTinBuilder(com.revolsys.elevation.tin.quadedge.QuadEdgeDelaunayTinBuilder) Stopwatch(com.revolsys.geometry.util.Stopwatch) Point(com.revolsys.geometry.model.Point)

Aggregations

Stopwatch (com.revolsys.geometry.util.Stopwatch)30 Point (com.revolsys.geometry.model.Point)14 Geometry (com.revolsys.geometry.model.Geometry)6 QuadEdgeDelaunayTinBuilder (com.revolsys.elevation.tin.quadedge.QuadEdgeDelaunayTinBuilder)3 DD (com.revolsys.geometry.math.DD)3 BoundingBox (com.revolsys.geometry.model.BoundingBox)3 PointDoubleXY (com.revolsys.geometry.model.impl.PointDoubleXY)2 Iterator (java.util.Iterator)2 RectangleLineIntersector (com.revolsys.geometry.algorithm.RectangleLineIntersector)1 PointOnGeometryLocator (com.revolsys.geometry.algorithm.locate.PointOnGeometryLocator)1 SimplePointInAreaLocator (com.revolsys.geometry.algorithm.locate.SimplePointInAreaLocator)1 Interval (com.revolsys.geometry.index.bintree.Interval)1 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)1 Location (com.revolsys.geometry.model.Location)1 BoundingBoxDoubleXY (com.revolsys.geometry.model.impl.BoundingBoxDoubleXY)1 SineStarFactory (com.revolsys.geometry.model.util.SineStarFactory)1 Constructor (java.lang.reflect.Constructor)1 Method (java.lang.reflect.Method)1 BigDecimal (java.math.BigDecimal)1 ArrayList (java.util.ArrayList)1