use of com.revolsys.geometry.util.GeometricShapeFactory in project com.revolsys.open by revolsys.
the class StressTestHarness 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 TestDataBuilder method newCircle.
public Geometry newCircle(final int nPts) {
final GeometricShapeFactory gsf = new GeometricShapeFactory();
gsf.setCentre(this.origin);
gsf.setSize(this.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 TestDataBuilder method newLine.
Geometry newLine(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.getBoundary();
}
use of com.revolsys.geometry.util.GeometricShapeFactory in project com.revolsys.open by revolsys.
the class PolygonBufferStressTest method test.
public void test() {
final String geomStr;
final GeometricShapeFactory shapeFact = new GeometricShapeFactory(geometryFactory);
final Geometry g = getSampleGeometry();
// Geometry g = GeometricShapeFactory.createArc(geometryFactory, 0, 0,
// 200.0, 0.0, 6.0,
// 100);
// Geometry circle = GeometricShapeFactory.createCircle(geometryFactory, 0,
// 0, 200,
// 100);
// Geometry g = circle;
// Geometry sq = GeometricShapeFactory.createBox(geometryFactory, 0, 0, 1,
// 120);
// Geometry g = sq.difference(circle);
// Geometry handle = GeometricShapeFactory.createRectangle(geometryFactory,
// 0, 0, 400,
// 20, 1);
// Geometry g = circle.union(handle);
// System.out.println(g);
test(g);
}
use of com.revolsys.geometry.util.GeometricShapeFactory in project com.revolsys.open by revolsys.
the class JTSFunctions method newJ.
private static Geometry newJ(final Geometry g) {
final GeometryFactory gf = FunctionsUtil.getFactoryOrDefault(g);
final Point[] jTop = new Point[] { new PointDoubleXY(0, HEIGHT), new PointDoubleXY(J_WIDTH, HEIGHT), new PointDoubleXY(J_WIDTH, J_RADIUS) };
final Point[] jBottom = new Point[] { new PointDoubleXY(J_WIDTH - J_RADIUS, 0), new PointDoubleXY(0, 0) };
final GeometricShapeFactory gsf = new GeometricShapeFactory(gf);
gsf.setBase(new PointDoubleXY(J_WIDTH - 2 * J_RADIUS, 0));
gsf.setSize(2 * J_RADIUS);
gsf.setNumPoints(10);
final LineString jArc = gsf.newArc(1.5 * Math.PI, 0.5 * Math.PI);
final PointList coordList = new PointList();
coordList.add(jTop, false);
coordList.add(CoordinatesListUtil.getPointArray(jArc.reverse()), false, 1, jArc.getVertexCount() - 1);
coordList.add(jBottom, false);
return gf.lineString(coordList.toPointArray());
}
Aggregations