Search in sources :

Example 6 with Polygon

use of org.opengis.geometry.coordinate.Polygon in project geotoolkit by Geomatys.

the class JTSPrimitiveFactory method createSurface.

/**
 * {@inheritDoc }
 */
@Override
public Surface createSurface(final SurfaceBoundary boundary) {
    // For now, our implementation has to assume that the boundary is a
    // polygon.
    Surface result = new JTSSurface(crs);
    Polygon poly = geomFact.createPolygon(boundary);
    // PENDING(jdc): the following line is 1.5 specific.
    // the result.getPatches() list is a generic list with a type of "? extends SurfacePatch"
    // we can compile without the generic if we cast down to List, but why do we need the cast?
    // Polygon extends SurfacePatch, so in theory this should work...
    // ((List<SurfacePatch>) result.getPatches()).add(poly);
    ((List) result.getPatches()).add(poly);
    return result;
}
Also used : List(java.util.List) JTSPolygon(org.geotoolkit.geometry.isoonjts.spatialschema.geometry.geometry.JTSPolygon) Polygon(org.opengis.geometry.coordinate.Polygon) Surface(org.opengis.geometry.primitive.Surface) PolyhedralSurface(org.opengis.geometry.coordinate.PolyhedralSurface)

Aggregations

Polygon (org.opengis.geometry.coordinate.Polygon)6 JTSPolygon (org.geotoolkit.geometry.isoonjts.spatialschema.geometry.geometry.JTSPolygon)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 JTSGeometryFactory (org.geotoolkit.geometry.isoonjts.spatialschema.geometry.geometry.JTSGeometryFactory)2 DirectPosition (org.opengis.geometry.DirectPosition)2 Geometry (org.opengis.geometry.Geometry)2 GeometryFactory (org.opengis.geometry.coordinate.GeometryFactory)2 LineString (org.opengis.geometry.coordinate.LineString)2 PointArray (org.opengis.geometry.coordinate.PointArray)2 Ring (org.opengis.geometry.primitive.Ring)2 SurfaceBoundary (org.opengis.geometry.primitive.SurfaceBoundary)2 Set (java.util.Set)1 GeneralDirectPosition (org.apache.sis.geometry.GeneralDirectPosition)1 AbstractJTSGeometry (org.geotoolkit.geometry.isoonjts.spatialschema.geometry.AbstractJTSGeometry)1 JTSGeometry (org.geotoolkit.geometry.isoonjts.spatialschema.geometry.JTSGeometry)1 AbstractJTSAggregate (org.geotoolkit.geometry.isoonjts.spatialschema.geometry.aggregate.AbstractJTSAggregate)1 JTSMultiCurve (org.geotoolkit.geometry.isoonjts.spatialschema.geometry.aggregate.JTSMultiCurve)1 JTSMultiPoint (org.geotoolkit.geometry.isoonjts.spatialschema.geometry.aggregate.JTSMultiPoint)1 JTSMultiPrimitive (org.geotoolkit.geometry.isoonjts.spatialschema.geometry.aggregate.JTSMultiPrimitive)1