deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

org.deegree.geometry.standard.primitive
Class DefaultOrientableSurface

java.lang.Object
  extended by org.deegree.geometry.standard.AbstractDefaultGeometry
      extended by org.deegree.geometry.standard.primitive.DefaultOrientableSurface
All Implemented Interfaces:
Geometry, GeometricPrimitive, OrientableSurface, Surface, GMLObject

public class DefaultOrientableSurface
extends AbstractDefaultGeometry
implements OrientableSurface

Default implementation of OrientableSurface.

Version:
$Revision:$, $Date:$
Author:
Markus Schneider , last edited by: $Author:$

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.AbstractDefaultGeometry
jtsFactory, jtsGeometry, pm
 
Constructor Summary
DefaultOrientableSurface(String id, CRS crs, Surface baseSurface, boolean isReversed)
          Creates a new DefaultOrientableSurface instance from the given parameters.
 
Method Summary
 boolean contains(Geometry geometry)
          Tests whether this geometry contains the specified geometry.
 boolean crosses(Geometry geometry)
          Tests whether this geometry crosses the specified geometry.
 boolean equals(Geometry geometry)
          Tests whether this geometry is equal to the specified geometry.
 Measure getArea(Unit requestedBaseUnit)
           
 Surface getBaseSurface()
          Returns the Surface that this OrientableSurface is based on.
 Geometry getBuffer(Measure distance)
          Return a new Geometry that contains all points with a distance from this Geometry that is less than or equal to the specified distance.
 Point getCentroid()
          Returns the centroid of the geometry.
 Geometry getConvexHull()
          Returns the convex hull of the geometry.
 int getCoordinateDimension()
          Returns the coordinate dimension, i.e. the dimension of the space that the geometry is embedded in.
 CRS getCoordinateSystem()
          Returns the associated spatial reference system.
 Geometry getDifference(Geometry geometry)
          Returns the set-theoretic difference of this and the passed Geometry.
 Measure getDistance(Geometry geometry, Unit requestedUnit)
          Returns the minimum distance between this and the specified geometry.
 Envelope getEnvelope()
          Returns the minimal bounding box of the geometry.
 Points getExteriorRingCoordinates()
          Convenience method for accessing the control points of the exterior ring of a simple polygon surface.
 Geometry.GeometryType getGeometryType()
          Must always return Geometry.GeometryType#PRIMITIVE_GEOMETRY.
 String getId()
          Returns the id of the geometry.
 List<Points> getInteriorRingsCoordinates()
          Convenience method for accessing the control points of the interior rings of a simple polygon surface.
 Geometry getIntersection(Geometry geometry)
          Returns the set-theoretic intersection of this and the passed Geometry.
 com.vividsolutions.jts.geom.Geometry getJTSGeometry()
          Returns an equivalent (or best-fit) JTS geometry object.
 List<? extends SurfacePatch> getPatches()
          Returns the patches that constitute this surface.
 Measure getPerimeter(Unit requestedUnit)
           
 PrecisionModel getPrecision()
          Returns the PrecisionModel of the geometry.
 GeometricPrimitive.PrimitiveType getPrimitiveType()
          Must always return GeometricPrimitive.PrimitiveType.Surface.
 Surface.SurfaceType getSurfaceType()
          Must always return Surface.SurfaceType.OrientableSurface.
 Geometry getUnion(Geometry geometry)
          Returns the set-theoretic union of this and the passed Geometry.
 boolean intersects(Geometry geometry)
          Tests whether this geometry intersects the specified geometry.
 boolean isBeyond(Geometry geometry, Measure distance)
          Tests whether this geometry is beyond a specified distance of a second geometry.
 boolean isDisjoint(Geometry geometry)
          Tests whether this geometry is disjoint from the specified geometry.
 boolean isReversed()
          Returns whether the orientation of this surface is reversed compared to the base surface.
 boolean isWithin(Geometry geometry)
          tests whether the value of a geometric is topological located within this geometry.
 boolean isWithinDistance(Geometry geometry, Measure distance)
          Tests whether this geometry is within a specified distance of a second geometry.
 boolean overlaps(Geometry geometry)
          Tests whether this geometry overlaps the specified geometry.
 boolean touches(Geometry geometry)
          Tests whether this geometry touches the specified geometry.
 
Methods inherited from class org.deegree.geometry.standard.AbstractDefaultGeometry
buildJTSGeometry, createFromJTS, getAsDefaultGeometry, getGMLProperties, setCoordinateSystem, setGMLProperties, setId, setPrecision, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.geometry.Geometry
setCoordinateSystem, setGMLProperties, setId, setPrecision
 
Methods inherited from interface org.deegree.gml.GMLObject
getGMLProperties
 

Constructor Detail

DefaultOrientableSurface

public DefaultOrientableSurface(String id,
                                CRS crs,
                                Surface baseSurface,
                                boolean isReversed)
Creates a new DefaultOrientableSurface instance from the given parameters.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
baseSurface - base surface
isReversed - set to true, if the orientation of the base Surface shall be reversed
Method Detail

getId

public String getId()
Description copied from interface: Geometry
Returns the id of the geometry.

In a GML representation of the geometry, this corresponds to the gml:id (GML 3 and later) or gid (GML 2) attribute of the geometry element.

Specified by:
getId in interface Geometry
Specified by:
getId in interface GMLObject
Overrides:
getId in class AbstractDefaultGeometry
Returns:
the id of the geometry, or null if it is an anonymous (unidentified) geometry

getCoordinateSystem

public CRS getCoordinateSystem()
Description copied from interface: Geometry
Returns the associated spatial reference system.

Specified by:
getCoordinateSystem in interface Geometry
Overrides:
getCoordinateSystem in class AbstractDefaultGeometry
Returns:
spatial reference system, may be null

getSurfaceType

public Surface.SurfaceType getSurfaceType()
Description copied from interface: OrientableSurface
Must always return Surface.SurfaceType.OrientableSurface.

Specified by:
getSurfaceType in interface OrientableSurface
Specified by:
getSurfaceType in interface Surface
Returns:
Surface.SurfaceType.OrientableSurface

getBaseSurface

public Surface getBaseSurface()
Description copied from interface: OrientableSurface
Returns the Surface that this OrientableSurface is based on.

Specified by:
getBaseSurface in interface OrientableSurface
Returns:
the base surface

isReversed

public boolean isReversed()
Description copied from interface: OrientableSurface
Returns whether the orientation of this surface is reversed compared to the base surface.

Specified by:
isReversed in interface OrientableSurface
Returns:
true, if the orientation is reversed, false otherwise

contains

public boolean contains(Geometry geometry)
Description copied from interface: Geometry
Tests whether this geometry contains the specified geometry. TODO formal explanation (DE9IM)

Specified by:
contains in interface Geometry
Overrides:
contains in class AbstractDefaultGeometry
Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry contains geometry

crosses

public boolean crosses(Geometry geometry)
Description copied from interface: Geometry
Tests whether this geometry crosses the specified geometry. TODO formal explanation (DE9IM)

Specified by:
crosses in interface Geometry
Overrides:
crosses in class AbstractDefaultGeometry
Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry crosses geometry

getDifference

public Geometry getDifference(Geometry geometry)
Description copied from interface: Geometry
Returns the set-theoretic difference of this and the passed Geometry.

Specified by:
getDifference in interface Geometry
Overrides:
getDifference in class AbstractDefaultGeometry
Parameters:
geometry - other geometry, must not be null
Returns:
difference Geometry or null (empty set)

getDistance

public Measure getDistance(Geometry geometry,
                           Unit requestedUnit)
Description copied from interface: Geometry
Returns the minimum distance between this and the specified geometry.

Specified by:
getDistance in interface Geometry
Overrides:
getDistance in class AbstractDefaultGeometry
Parameters:
geometry - second geometry
requestedUnit - unit of the
Returns:
shortest distance between the two geometries

equals

public boolean equals(Geometry geometry)
Description copied from interface: Geometry
Tests whether this geometry is equal to the specified geometry. TODO formal explanation (DE9IM)

Specified by:
equals in interface Geometry
Overrides:
equals in class AbstractDefaultGeometry
Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry is equal to geometry

getArea

public Measure getArea(Unit requestedBaseUnit)
Specified by:
getArea in interface Surface
Returns:
area of the surface

getBuffer

public Geometry getBuffer(Measure distance)
Description copied from interface: Geometry
Return a new Geometry that contains all points with a distance from this Geometry that is less than or equal to the specified distance.

Specified by:
getBuffer in interface Geometry
Overrides:
getBuffer in class AbstractDefaultGeometry
Returns:
buffer geometry

getCentroid

public Point getCentroid()
Description copied from interface: Geometry
Returns the centroid of the geometry.

Specified by:
getCentroid in interface Geometry
Overrides:
getCentroid in class AbstractDefaultGeometry
Returns:
a Point that is the centroid of this geometry

getConvexHull

public Geometry getConvexHull()
Description copied from interface: Geometry
Returns the convex hull of the geometry.

Specified by:
getConvexHull in interface Geometry
Overrides:
getConvexHull in class AbstractDefaultGeometry
Returns:
convex hull of a Geometry

getCoordinateDimension

public int getCoordinateDimension()
Description copied from interface: Geometry
Returns the coordinate dimension, i.e. the dimension of the space that the geometry is embedded in.

Specified by:
getCoordinateDimension in interface Geometry
Returns:
the coordinate dimension

getEnvelope

public Envelope getEnvelope()
Description copied from interface: Geometry
Returns the minimal bounding box of the geometry.

Specified by:
getEnvelope in interface Geometry
Overrides:
getEnvelope in class AbstractDefaultGeometry
Returns:
the minimal bounding box of the geometry

getGeometryType

public Geometry.GeometryType getGeometryType()
Description copied from interface: GeometricPrimitive
Must always return Geometry.GeometryType#PRIMITIVE_GEOMETRY.

Specified by:
getGeometryType in interface Geometry
Specified by:
getGeometryType in interface GeometricPrimitive
Returns:
must always return Geometry.GeometryType#PRIMITIVE_GEOMETRY

getPatches

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

Specified by:
getPatches in interface Surface
Returns:
the patches that constitute this surface

getPerimeter

public Measure getPerimeter(Unit requestedUnit)
Specified by:
getPerimeter in interface Surface
Returns:
perimeter of the surface

getPrecision

public PrecisionModel getPrecision()
Description copied from interface: Geometry
Returns the PrecisionModel of the geometry.

Specified by:
getPrecision in interface Geometry
Overrides:
getPrecision in class AbstractDefaultGeometry
Returns:
the precision model

getPrimitiveType

public GeometricPrimitive.PrimitiveType getPrimitiveType()
Description copied from interface: Surface
Must always return GeometricPrimitive.PrimitiveType.Surface.

Specified by:
getPrimitiveType in interface GeometricPrimitive
Specified by:
getPrimitiveType in interface Surface
Returns:
GeometricPrimitive.PrimitiveType.Surface

getIntersection

public Geometry getIntersection(Geometry geometry)
Description copied from interface: Geometry
Returns the set-theoretic intersection of this and the passed Geometry.

Specified by:
getIntersection in interface Geometry
Overrides:
getIntersection in class AbstractDefaultGeometry
Parameters:
geometry - other geometry, must not be null
Returns:
intersection Geometry or null (empty set)

intersects

public boolean intersects(Geometry geometry)
Description copied from interface: Geometry
Tests whether this geometry intersects the specified geometry. TODO formal explanation (DE9IM)

Specified by:
intersects in interface Geometry
Overrides:
intersects in class AbstractDefaultGeometry
Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry intersects geometry

isDisjoint

public boolean isDisjoint(Geometry geometry)
Description copied from interface: Geometry
Tests whether this geometry is disjoint from the specified geometry. TODO formal explanation (DE9IM)

Specified by:
isDisjoint in interface Geometry
Overrides:
isDisjoint in class AbstractDefaultGeometry
Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry is disjoint from geometry

overlaps

public boolean overlaps(Geometry geometry)
Description copied from interface: Geometry
Tests whether this geometry overlaps the specified geometry. TODO formal explanation (DE9IM)

Specified by:
overlaps in interface Geometry
Overrides:
overlaps in class AbstractDefaultGeometry
Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry overlaps geometry

touches

public boolean touches(Geometry geometry)
Description copied from interface: Geometry
Tests whether this geometry touches the specified geometry. TODO formal explanation (DE9IM)

Specified by:
touches in interface Geometry
Overrides:
touches in class AbstractDefaultGeometry
Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry touches geometry

isBeyond

public boolean isBeyond(Geometry geometry,
                        Measure distance)
Description copied from interface: Geometry
Tests whether this geometry is beyond a specified distance of a second geometry.

Specified by:
isBeyond in interface Geometry
Overrides:
isBeyond in class AbstractDefaultGeometry
Parameters:
geometry - second geometry
Returns:
true, iff the minimum distance between this and the second geometry is greater than distance

isWithin

public boolean isWithin(Geometry geometry)
Description copied from interface: Geometry
tests whether the value of a geometric is topological located within this geometry. This method is the opposite of Geometry.contains(Geometry) method

Specified by:
isWithin in interface Geometry
Overrides:
isWithin in class AbstractDefaultGeometry
Returns:
true if passed geometry is located completly within this geometry

isWithinDistance

public boolean isWithinDistance(Geometry geometry,
                                Measure distance)
Description copied from interface: Geometry
Tests whether this geometry is within a specified distance of a second geometry.

Specified by:
isWithinDistance in interface Geometry
Overrides:
isWithinDistance in class AbstractDefaultGeometry
Parameters:
geometry - second geometry
Returns:
true, iff the distance between this and the second geometry is less than or equal distance

getUnion

public Geometry getUnion(Geometry geometry)
Description copied from interface: Geometry
Returns the set-theoretic union of this and the passed Geometry.

Specified by:
getUnion in interface Geometry
Overrides:
getUnion in class AbstractDefaultGeometry
Parameters:
geometry - other geometry, must not be null
Returns:
united Geometry (never null)

getExteriorRingCoordinates

public Points getExteriorRingCoordinates()
Description copied from interface: Surface
Convenience method for accessing the control points of the exterior ring of a simple polygon surface.

NOTE: This method is only safe to use when the surface consists of a single planar patch that has a linear interpolated exterior ring.

Specified by:
getExteriorRingCoordinates in interface Surface
Returns:
the control points

getInteriorRingsCoordinates

public List<Points> getInteriorRingsCoordinates()
Description copied from interface: Surface
Convenience method for accessing the control points of the interior rings of a simple polygon surface.

NOTE: This method is only safe to use when the surface consists of a single planar patch that has linear interpolated interior rings.

Specified by:
getInteriorRingsCoordinates in interface Surface
Returns:
the control points

getJTSGeometry

public com.vividsolutions.jts.geom.Geometry getJTSGeometry()
Description copied from class: AbstractDefaultGeometry
Returns an equivalent (or best-fit) JTS geometry object.

Overrides:
getJTSGeometry in class AbstractDefaultGeometry
Returns:
an equivalent (or best-fit) JTS geometry

deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org

]]>