org.deegree.geometry.standard.primitive
Class DefaultPolygon

java.lang.Object
  extended by org.deegree.geometry.standard.AbstractDefaultGeometry
      extended by org.deegree.geometry.standard.primitive.DefaultSurface
          extended by org.deegree.geometry.standard.primitive.DefaultPolygon
All Implemented Interfaces:
GMLObject, Object, TypedObjectNode, Geometry, GeometricPrimitive, Polygon, Surface

public class DefaultPolygon
extends DefaultSurface
implements Polygon

Default implementation of Polygon.

Version:
$Revision: 31649 $, $Date: 2011-08-25 01:03:49 +0200 (Thu, 25 Aug 2011) $
Author:
Markus Schneider , last edited by: $Author: mschneider $

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.deegree.geometry.primitive.Surface
Surface.SurfaceType
 
Nested classes/interfaces inherited from interface org.deegree.geometry.primitive.GeometricPrimitive
GeometricPrimitive.PrimitiveType
 
Nested classes/interfaces inherited from interface org.deegree.geometry.Geometry
Geometry.GeometryType
 
Field Summary
 
Fields inherited from class org.deegree.geometry.standard.primitive.DefaultSurface
patches
 
Fields inherited from class org.deegree.geometry.standard.AbstractDefaultGeometry
crs, env, id, jtsFactory, jtsGeometry, pm
 
Constructor Summary
DefaultPolygon(String id, ICRS crs, PrecisionModel pm, Ring exteriorRing, List<Ring> interiorRings)
          Creates a new DefaultPolygon instance from the given parameters.
 
Method Summary
protected  com.vividsolutions.jts.geom.Geometry buildJTSGeometry()
           
 Ring getExteriorRing()
          Returns the exterior ring of the polygon.
 List<Ring> getInteriorRings()
          Returns the interior rings (holes) of the polygon.
 List<PolygonPatch> getPatches()
          Returns the patches that constitute this surface.
 Surface.SurfaceType getSurfaceType()
          Returns the type of surface.
 boolean isSFSCompliant()
          Returns whether this geometry complies with the Simple Feature Specification (SFS).
 
Methods inherited from class org.deegree.geometry.standard.primitive.DefaultSurface
getArea, getCoordinateDimension, getExteriorRingCoordinates, getGeometryType, getInteriorPoint, getInteriorRingsCoordinates, getPerimeter, getPrimitiveType
 
Methods inherited from class org.deegree.geometry.standard.AbstractDefaultGeometry
contains, createFromJTS, crosses, equals, getAsDefaultGeometry, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getDifference, getDistance, getEnvelope, getGMLProperties, getId, getIntersection, getJTSGeometry, getPrecision, getUnion, intersects, isBeyond, isDisjoint, isWithin, isWithinDistance, overlaps, setCoordinateSystem, setGMLProperties, setId, setPrecision, toString, touches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.geometry.primitive.Surface
getArea, getExteriorRingCoordinates, getInteriorRingsCoordinates, getPerimeter, getPrimitiveType
 
Methods inherited from interface org.deegree.geometry.primitive.GeometricPrimitive
getGeometryType
 
Methods inherited from interface org.deegree.geometry.Geometry
contains, crosses, equals, getBuffer, getCentroid, getConvexHull, getCoordinateDimension, getCoordinateSystem, getDifference, getDistance, getEnvelope, getId, getIntersection, getPrecision, getUnion, intersects, isBeyond, isDisjoint, isWithin, isWithinDistance, overlaps, setCoordinateSystem, setGMLProperties, setId, setPrecision, touches
 
Methods inherited from interface org.deegree.commons.tom.gml.GMLObject
getGMLProperties
 

Constructor Detail

DefaultPolygon

public DefaultPolygon(String id,
                      ICRS crs,
                      PrecisionModel pm,
                      Ring exteriorRing,
                      List<Ring> interiorRings)
Creates a new DefaultPolygon instance from the given parameters.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
pm - precision model, may be null
interiorRings - list of rings that define the inner boundaries, may be empty or null
Method Detail

getExteriorRing

public Ring getExteriorRing()
Description copied from interface: Polygon
Returns the exterior ring of the polygon.

Please note that this method may return null. The following explanation is from the GML 3.1.1 spec (section 9.2.2.5): In the normal 2D case, one of these rings is distinguished as being the exterior boundary. In a general manifold this is not always possible, in which case all boundaries shall be listed as interior boundaries, and the exterior will be empty.

Specified by:
getExteriorRing in interface Polygon
Returns:
the exterior ring, or null if no ring is distinguished as being the exterior boundary

getInteriorRings

public List<Ring> getInteriorRings()
Description copied from interface: Polygon
Returns the interior rings (holes) of the polygon.

Specified by:
getInteriorRings in interface Polygon
Returns:
the interior rings (holes) of the polygon, list may be empty (but not null)

getSurfaceType

public Surface.SurfaceType getSurfaceType()
Description copied from interface: Surface
Returns the type of surface.

Specified by:
getSurfaceType in interface Polygon
Specified by:
getSurfaceType in interface Surface
Overrides:
getSurfaceType in class DefaultSurface
Returns:
the type of surface

getPatches

public List<PolygonPatch> getPatches()
Description copied from interface: Surface
Returns the patches that constitute this surface.

Specified by:
getPatches in interface Polygon
Specified by:
getPatches in interface Surface
Overrides:
getPatches in class DefaultSurface
Returns:
the patches that constitute this surface

isSFSCompliant

public boolean isSFSCompliant()
Description copied from interface: Geometry
Returns whether this geometry complies with the Simple Feature Specification (SFS).

Specified by:
isSFSCompliant in interface Geometry
Overrides:
isSFSCompliant in class AbstractDefaultGeometry
Returns:
true, if this geometry complies with the SFS, false otherwise

buildJTSGeometry

protected com.vividsolutions.jts.geom.Geometry buildJTSGeometry()
Overrides:
buildJTSGeometry in class DefaultSurface


Copyright © 2011. All Rights Reserved.