use of com.revolsys.geometry.model.PointList 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