use of com.revolsys.geometry.util.GeometricShapeFactory in project com.revolsys.open by revolsys.
the class JTSFunctions method newS.
private static Geometry newS(final Geometry g) {
final GeometryFactory gf = FunctionsUtil.getFactoryOrDefault(g);
final double centreX = WIDTH - S_RADIUS;
final Point[] top = new Point[] { new PointDoubleXY(WIDTH, HEIGHT), new PointDoubleXY(centreX, HEIGHT) };
final Point[] bottom = new Point[] { new PointDoubleXY(centreX, 0), new PointDoubleXY(WIDTH - 2 * S_RADIUS, 0) };
final GeometricShapeFactory gsf = new GeometricShapeFactory(gf);
gsf.setCentre(new PointDoubleXY(centreX, HEIGHT - S_RADIUS));
gsf.setSize(2 * S_RADIUS);
gsf.setNumPoints(10);
final LineString arcTop = gsf.newArc(0.5 * Math.PI, Math.PI);
final GeometricShapeFactory gsf2 = new GeometricShapeFactory(gf);
gsf2.setCentre(new PointDoubleXY(centreX, S_RADIUS));
gsf2.setSize(2 * S_RADIUS);
gsf2.setNumPoints(10);
final LineString arcBottom = gsf2.newArc(1.5 * Math.PI, Math.PI).reverse();
final PointList coordList = new PointList();
coordList.add(top, false);
coordList.add(CoordinatesListUtil.getPointArray(arcTop), false, 1, arcTop.getVertexCount() - 1);
coordList.add(new PointDoubleXY(centreX, HEIGHT / 2));
coordList.add(CoordinatesListUtil.getPointArray(arcBottom), false, 1, arcBottom.getVertexCount() - 1);
coordList.add(bottom, false);
return gf.lineString(coordList.toPointArray());
}
use of com.revolsys.geometry.util.GeometricShapeFactory in project com.revolsys.open by revolsys.
the class PreparedPolygonIntersectsStressTest method newCircle.
Geometry newCircle(final Point origin, final double size, final int nPts) {
final GeometricShapeFactory gsf = new GeometricShapeFactory();
gsf.setCentre(origin);
gsf.setSize(size);
gsf.setNumPoints(nPts);
final Geometry circle = gsf.newCircle();
// Geometry g = gRect.getExteriorRing();
return circle;
}
use of com.revolsys.geometry.util.GeometricShapeFactory in project com.revolsys.open by revolsys.
the class StressTestHarness method newTestCircle.
Geometry newTestCircle(final Point base, final double size, final int nPts) {
final GeometricShapeFactory gsf = new GeometricShapeFactory();
gsf.setCentre(base);
gsf.setSize(size);
gsf.setNumPoints(nPts);
final Geometry circle = gsf.newCircle();
// System.out.println(circle);
return circle;
}
use of com.revolsys.geometry.util.GeometricShapeFactory in project com.revolsys.open by revolsys.
the class PreparedPolygonIntersectsPerfTest method newCircle.
Geometry newCircle(final Point origin, final double size, final int nPts) {
final GeometricShapeFactory gsf = new GeometricShapeFactory();
gsf.setCentre(origin);
gsf.setSize(size);
gsf.setNumPoints(nPts);
final Geometry circle = gsf.newCircle();
// Geometry g = gRect.getExteriorRing();
return circle;
}
use of com.revolsys.geometry.util.GeometricShapeFactory in project com.revolsys.open by revolsys.
the class RectangleIntersectsPerfTest method newRectangle.
Geometry newRectangle(final Point origin, final double size) {
final GeometricShapeFactory gsf = new GeometricShapeFactory();
gsf.setCentre(origin);
gsf.setSize(size);
gsf.setNumPoints(4);
final Geometry g = gsf.newRectangle();
// Geometry g = gRect.getExteriorRing();
return g;
}
Aggregations