Search in sources :

Example 11 with PointList

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());
}
Also used : PointList(com.revolsys.geometry.model.PointList) GeometryFactory(com.revolsys.geometry.model.GeometryFactory) GeometricShapeFactory(com.revolsys.geometry.util.GeometricShapeFactory) LineString(com.revolsys.geometry.model.LineString) Point(com.revolsys.geometry.model.Point) PointDoubleXY(com.revolsys.geometry.model.impl.PointDoubleXY)

Aggregations

PointList (com.revolsys.geometry.model.PointList)11 Point (com.revolsys.geometry.model.Point)6 LineString (com.revolsys.geometry.model.LineString)3 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)2 PointDoubleXY (com.revolsys.geometry.model.impl.PointDoubleXY)2 GeometricShapeFactory (com.revolsys.geometry.util.GeometricShapeFactory)2 HalfEdge (com.revolsys.geometry.edgegraph.HalfEdge)1 MarkHalfEdge (com.revolsys.geometry.edgegraph.MarkHalfEdge)1 DirectedEdge (com.revolsys.geometry.planargraph.DirectedEdge)1