Search in sources :

Example 11 with SurfaceBoundary

use of org.opengis.geometry.primitive.SurfaceBoundary in project geotoolkit by Geomatys.

the class GeometryUtils method createSurfaceBoundary.

private static SurfaceBoundary createSurfaceBoundary(final PrimitiveFactory primitiveFactory, final DirectPosition[] exteriorRingPoints, final DirectPosition[][] interiorRingsPoints) {
    final Ring exteriorRing = createRing(primitiveFactory, exteriorRingPoints);
    final List interiorRingList = interiorRingsPoints.length == 0 ? Collections.EMPTY_LIST : new ArrayList();
    for (int i = 0; i < interiorRingsPoints.length; i++) {
        interiorRingList.add(createRing(primitiveFactory, interiorRingsPoints[i]));
    }
    final SurfaceBoundary surfaceBoundary = primitiveFactory.createSurfaceBoundary(exteriorRing, interiorRingList);
    return surfaceBoundary;
}
Also used : SurfaceBoundary(org.opengis.geometry.primitive.SurfaceBoundary) Ring(org.opengis.geometry.primitive.Ring) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Example 12 with SurfaceBoundary

use of org.opengis.geometry.primitive.SurfaceBoundary in project geotoolkit by Geomatys.

the class GeometryUtils method getExteriorDirectPositions.

public static DirectPosition[] getExteriorDirectPositions(final Polygon polygon) {
    final SurfaceBoundary surfaceBoundary = polygon.getBoundary();
    final Ring exteriorRing = surfaceBoundary.getExterior();
    return GeometryUtils.getDirectPositions(exteriorRing);
}
Also used : SurfaceBoundary(org.opengis.geometry.primitive.SurfaceBoundary) Ring(org.opengis.geometry.primitive.Ring)

Aggregations

SurfaceBoundary (org.opengis.geometry.primitive.SurfaceBoundary)12 Ring (org.opengis.geometry.primitive.Ring)11 ArrayList (java.util.ArrayList)9 List (java.util.List)6 DirectPosition (org.opengis.geometry.DirectPosition)5 Curve (org.opengis.geometry.primitive.Curve)4 OrientableCurve (org.opengis.geometry.primitive.OrientableCurve)4 JTSGeometryFactory (org.geotoolkit.geometry.isoonjts.spatialschema.geometry.geometry.JTSGeometryFactory)3 JTSPrimitiveFactory (org.geotoolkit.geometry.isoonjts.spatialschema.geometry.primitive.JTSPrimitiveFactory)3 GeometryFactory (org.opengis.geometry.coordinate.GeometryFactory)3 LineString (org.opengis.geometry.coordinate.LineString)3 PointArray (org.opengis.geometry.coordinate.PointArray)3 CurveSegment (org.opengis.geometry.primitive.CurveSegment)3 PrimitiveFactory (org.opengis.geometry.primitive.PrimitiveFactory)3 Geometry (org.opengis.geometry.Geometry)2 Polygon (org.opengis.geometry.coordinate.Polygon)2 CoordinateReferenceSystem (org.opengis.referencing.crs.CoordinateReferenceSystem)2 Set (java.util.Set)1 DirectPosition2D (org.apache.sis.geometry.DirectPosition2D)1 GeneralDirectPosition (org.apache.sis.geometry.GeneralDirectPosition)1