public Ring createRing(List<OrientableCurve> orientableCurves) throws MismatchedReferenceSystemException, MismatchedDimensionException { /** * Creates a Ring from triple Array of DirectPositions (Array of arrays, which each * represent a future Curve. Each array contain an array of positions, which each represent * a future lineString) */ return getPrimitiveFactory().createRing(orientableCurves); }
Ring shell = primitiveFactory.createRing(curveList); Curve holecurve = readLinearRingText(tokenizer); List holeList = Collections.singletonList(holecurve); Ring hole = primitiveFactory.createRing(holeList);
private static Ring createRing( final PrimitiveFactory primitiveFactory, final DirectPosition[] points) { final List curveList = Collections.singletonList(createCurve(primitiveFactory, points)); final Ring ring = primitiveFactory.createRing(curveList); return ring; }
private static Ring createRing( final PrimitiveFactory primitiveFactory, final DirectPosition[] points) { final List curveList = Collections.singletonList(createCurve(primitiveFactory, points)); final Ring ring = primitiveFactory.createRing(curveList); return ring; }
private static Ring createRing( final PrimitiveFactory primitiveFactory, final DirectPosition[] points) { final List curveList = Collections.singletonList(createCurve(primitiveFactory, points)); final Ring ring = primitiveFactory.createRing(curveList); return ring; }
/** * A helper method for creating a Ring from an array of DirectPositions * * @param curve * @return a <tt>Ring</tt> */ protected Ring createRing(final Curve curve) { final List curveList = Collections.singletonList(curve); final Ring ring = PRIMITIVE_FACTORY.createRing(curveList); return ring; }
Ring shell = primitiveFactory.createRing(curveList); Curve holecurve = readLinearRingText(tokenizer); List holeList = Collections.singletonList(holecurve); Ring hole = primitiveFactory.createRing(holeList);
Ring shell = primitiveFactory.createRing(curveList); Curve holecurve = readLinearRingText(tokenizer); List<OrientableCurve> holeList = Collections.singletonList((OrientableCurve)holecurve); Ring hole = primitiveFactory.createRing(holeList);
ArrayList<OrientableCurve> curveList = new ArrayList<OrientableCurve>(); curveList.add(newCurve); Ring newRing = primitiveFactory.createRing(curveList); return newRing;
public static Ring linearRingToRing(final org.locationtech.jts.geom.LineString jtsLinearRing, final CoordinateReferenceSystem crs) { int numPoints = jtsLinearRing.getNumPoints(); if (numPoints != 0 && !jtsLinearRing.getCoordinateN(0).equals(jtsLinearRing.getCoordinateN(numPoints - 1))) { throw new IllegalArgumentException("LineString must be a ring"); } PrimitiveFactory pf = new JTSPrimitiveFactory(crs); //FactoryFinder.getPrimitiveFactory(hints); GeometryFactory gf = new JTSGeometryFactory(crs); //FactoryFinder.getGeometryFactory(hints); LineString ls = gf.createLineString(new ArrayList()); List pointList = ls.getControlPoints().positions(); for (int i = 0; i < numPoints; i++) { pointList.add(coordinateToDirectPosition(jtsLinearRing.getCoordinateN(i), crs)); } Curve curve = pf.createCurve(new ArrayList()); // Cast below can be removed when Types will be allowed to abandon Java 1.4 support. ((List) curve.getSegments()).add(ls); Ring result = pf.createRing(new ArrayList()); // Cast below can be removed when Types will be allowed to abandon Java 1.4 support. ((List) result.getGenerators()).add(curve); return result; }
public static Ring linearRingToRing(com.vividsolutions.jts.geom.LineString jtsLinearRing, CoordinateReferenceSystem crs) { int numPoints = jtsLinearRing.getNumPoints(); if (! jtsLinearRing.getCoordinateN(0).equals(jtsLinearRing.getCoordinateN(numPoints-1))) { throw new IllegalArgumentException("LineString must be a ring"); } Hints hints = new Hints( Hints.CRS, crs ); PrimitiveFactory pf = GeometryFactoryFinder.getPrimitiveFactory(hints); GeometryFactory gf = GeometryFactoryFinder.getGeometryFactory(hints); LineString ls = gf.createLineString(new ArrayList()); List pointList = ls.getControlPoints(); for (int i=0; i<numPoints; i++) { pointList.add(coordinateToDirectPosition(jtsLinearRing.getCoordinateN(i), crs)); } Curve curve = pf.createCurve(new ArrayList()); // Cast below can be removed when GeoAPI will be allowed to abandon Java 1.4 support. ((List) curve.getSegments()).add(ls); Ring result = pf.createRing(new ArrayList()); // Cast below can be removed when GeoAPI will be allowed to abandon Java 1.4 support. ((List) result.getGenerators()).add(curve); return result; }
public static Ring linearRingToRing(com.vividsolutions.jts.geom.LineString jtsLinearRing, CoordinateReferenceSystem crs) { int numPoints = jtsLinearRing.getNumPoints(); if (! jtsLinearRing.getCoordinateN(0).equals(jtsLinearRing.getCoordinateN(numPoints-1))) { throw new IllegalArgumentException("LineString must be a ring"); } Hints hints = new Hints( Hints.CRS, crs ); PrimitiveFactory pf = GeometryFactoryFinder.getPrimitiveFactory(hints); GeometryFactory gf = GeometryFactoryFinder.getGeometryFactory(hints); LineString ls = gf.createLineString(new ArrayList()); List pointList = ls.getControlPoints().positions(); for (int i=0; i<numPoints; i++) { pointList.add(coordinateToDirectPosition(jtsLinearRing.getCoordinateN(i), crs)); } Curve curve = pf.createCurve(new ArrayList()); curve.getSegments().add(ls); Ring result = pf.createRing(new ArrayList()); result.getGenerators().add(curve); return result; }