use of com.revolsys.geometry.model.impl.PointDoubleXY in project com.revolsys.open by revolsys.
the class TestPerfDistanceLinesPoints method newLine.
Geometry newLine(final double extent, final int nSegs) {
final Point[] pts = new Point[] { new PointDoubleXY(0, 0), new PointDoubleXY(0, extent), new PointDoubleXY(extent, extent), new PointDoubleXY(extent, 0) };
final Geometry outline = geomFact.lineString(pts);
final double inc = extent / nSegs;
return Densifier.densify(outline, inc);
}
use of com.revolsys.geometry.model.impl.PointDoubleXY in project com.revolsys.open by revolsys.
the class DelaunayRobustTest method randomPointsInGrid.
List<Point> randomPointsInGrid(final int nPts, final double basex, final double basey) {
final List<Point> pts = new ArrayList<>();
final int nSide = (int) Math.sqrt(nPts) + 1;
for (int i = 0; i < nSide; i++) {
for (int j = 0; j < nSide; j++) {
final double x = basex + i * SIDE_LEN + SIDE_LEN * Math.random();
final double y = basey + j * SIDE_LEN + SIDE_LEN * Math.random();
pts.add(new PointDoubleXY(x, y));
}
}
return pts;
}
use of com.revolsys.geometry.model.impl.PointDoubleXY in project com.revolsys.open by revolsys.
the class TestDataBuilder method newTestGeoms.
public List newTestGeoms(final BoundingBox env, final int nItems, final double size, final int nPts) {
final int nCells = (int) Math.sqrt(nItems);
final List geoms = new ArrayList();
final double width = env.getWidth();
final double xInc = width / nCells;
final double yInc = width / nCells;
for (int i = 0; i < nCells; i++) {
for (int j = 0; j < nCells; j++) {
final Point base = new PointDoubleXY(env.getMinX() + i * xInc, env.getMinY() + j * yInc);
final Geometry line = newLine(base, size, nPts);
geoms.add(line);
}
}
return geoms;
}
use of com.revolsys.geometry.model.impl.PointDoubleXY in project com.revolsys.open by revolsys.
the class IsSimpleTest method test3TouchAtEndpoint.
/**
* 3 LineStrings touching at an endpoint.
*
* @throws Exception
*/
public void test3TouchAtEndpoint() throws Exception {
final String a = "MULTILINESTRING ((0 1, 1 1, 2 1), (0 0, 1 0, 2 1), (0 2, 1 2, 2 1))";
// rings are simple under all rules
runIsSimpleTest(a, true, new PointDoubleXY(2, 1));
}
use of com.revolsys.geometry.model.impl.PointDoubleXY in project com.revolsys.open by revolsys.
the class IsSimpleTest method testMultiLineStringWithRingTouchAtEndpoint.
public void testMultiLineStringWithRingTouchAtEndpoint() throws Exception {
final String a = "MULTILINESTRING ((100 100, 20 20, 200 20, 100 100), (100 200, 100 100))";
// under Mod-2, the ring has no boundary, so the line intersects the
// interior ==> not simple
runIsSimpleTest(a, false, new PointDoubleXY(100, 100));
}
Aggregations