public GeometryFactory getFactory() { return super.getFactory(); }
public GeometryFactory getFactory() { return super.getFactory(); }
/** * Does what it says, reverses the order of the Coordinates in the ring. * * <p>This is different then lr.reverses() in that a copy is produced using a new coordinate * sequence. * * @param lr The ring to reverse. * @return A new ring with the reversed Coordinates. */ public static final LinearRing reverseRing(LinearRing lr) { GeometryFactory gf = lr.getFactory(); CoordinateSequenceFactory csf = gf.getCoordinateSequenceFactory(); CoordinateSequence csOrig = lr.getCoordinateSequence(); int numPoints = csOrig.size(); int dimensions = csOrig.getDimension(); CoordinateSequence csNew = JTS.createCS(csf, numPoints, dimensions, csOrig.getMeasures()); for (int i = 0; i < numPoints; i++) { for (int j = 0; j < dimensions; j++) { csNew.setOrdinate(numPoints - 1 - i, j, csOrig.getOrdinate(i, j)); } } return gf.createLinearRing(csNew); }
if (ring.getFactory().createPolygon(ring).getArea() > 0) { return ring; } else {
return ring.getFactory() .createLinearRing( out.toCoordinateSequence(ring.getFactory().getCoordinateSequenceFactory()));
public Geometry reverse() { CoordinateSequence seq = points.copy(); CoordinateSequences.reverse(seq); LinearRing rev = getFactory().createLinearRing(seq); return rev; } }
return ring.getFactory().createMultiPolygon(new Polygon[]{ ring.getFactory().createPolygon(ring, EMPTY_RING_ARRAY) }); } else { Set<LineString> lines = nodeLineString(ring.getCoordinates(), ring.getFactory()); lines = getSegments(lines); decompose(unionPoly, geoms); decompose(unionLines, geoms); return ring.getFactory().buildGeometry(geoms);