|
deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.geometry.standard.AbstractDefaultGeometry
public abstract class AbstractDefaultGeometry
Abstract base class for the default Geometry
implementation.
This implementation is built around JTS (Java Topology Suite)
geometries which are used to evaluate topological predicates (e.g. intersects) and perform spatial analysis
operations (e.g union). Simple geometries (e.g. LineString
s are mapped to a corresponding JTS object, for
complex ones (e.g. Curve
s with non-linear segments), the JTS geometry only approximates the original
geometry. See this page for a
discussion.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.deegree.geometry.Geometry |
---|
Geometry.GeometryType |
Field Summary | |
---|---|
protected CRS |
crs
Reference to a coordinate system. |
protected String |
id
Geometry identifier. |
protected static com.vividsolutions.jts.geom.GeometryFactory |
jtsFactory
Used to built JTS geometries. |
protected com.vividsolutions.jts.geom.Geometry |
jtsGeometry
|
protected PrecisionModel |
pm
|
Constructor Summary | |
---|---|
AbstractDefaultGeometry(String id,
CRS crs,
PrecisionModel pm)
|
Method Summary | |
---|---|
protected com.vividsolutions.jts.geom.Geometry |
buildJTSGeometry()
|
boolean |
contains(Geometry geometry)
Tests whether this geometry contains the specified geometry. |
AbstractDefaultGeometry |
createFromJTS(com.vividsolutions.jts.geom.Geometry jtsGeom)
Helper methods for creating AbstractDefaultGeometry from JTS geometries that have been derived from this
geometry by JTS spatial analysis methods. |
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. |
protected static AbstractDefaultGeometry |
getAsDefaultGeometry(Geometry geometry)
|
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. |
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. |
GMLStdProps |
getGMLProperties()
Returns the standard GML properties (e.g. |
String |
getId()
Returns the id of the geometry. |
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. |
PrecisionModel |
getPrecision()
Returns the PrecisionModel of the geometry. |
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 |
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. |
void |
setCoordinateSystem(CRS crs)
Sets the associated spatial reference system. |
void |
setGMLProperties(GMLStdProps standardProps)
Sets the attached properties (e.g. |
void |
setId(String id)
Sets the id of the geometry. |
void |
setPrecision(PrecisionModel pm)
Sets the PrecisionModel of the geometry. |
String |
toString()
|
boolean |
touches(Geometry geometry)
Tests whether this geometry touches the specified geometry. |
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 |
---|
getCoordinateDimension, getGeometryType |
Field Detail |
---|
protected static final com.vividsolutions.jts.geom.GeometryFactory jtsFactory
protected String id
protected CRS crs
protected PrecisionModel pm
protected com.vividsolutions.jts.geom.Geometry jtsGeometry
Constructor Detail |
---|
public AbstractDefaultGeometry(String id, CRS crs, PrecisionModel pm)
id
- crs
- pm
- Method Detail |
---|
public String getId()
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.
getId
in interface Geometry
getId
in interface GMLObject
public void setId(String id)
Geometry
setId
in interface Geometry
id
- id of the geometrypublic CRS getCoordinateSystem()
Geometry
getCoordinateSystem
in interface Geometry
public void setCoordinateSystem(CRS crs)
Geometry
setCoordinateSystem
in interface Geometry
crs
- spatial reference system, may be nullpublic PrecisionModel getPrecision()
Geometry
PrecisionModel
of the geometry.
getPrecision
in interface Geometry
public void setPrecision(PrecisionModel pm)
Geometry
PrecisionModel
of the geometry.
setPrecision
in interface Geometry
pm
- the precision model to setpublic boolean intersects(Geometry geometry)
Geometry
intersects
in interface Geometry
geometry
- the Geometry
to test this Geometry
against
Geometry
intersects geometry
public boolean isDisjoint(Geometry geometry)
Geometry
isDisjoint
in interface Geometry
geometry
- the Geometry
to test this Geometry
against
Geometry
is disjoint from geometry
public boolean overlaps(Geometry geometry)
Geometry
overlaps
in interface Geometry
geometry
- the Geometry
to test this Geometry
against
Geometry
overlaps geometry
public boolean touches(Geometry geometry)
Geometry
touches
in interface Geometry
geometry
- the Geometry
to test this Geometry
against
Geometry
touches geometry
public boolean isWithin(Geometry geometry)
Geometry
Geometry.contains(Geometry)
method
isWithin
in interface Geometry
public boolean isWithinDistance(Geometry geometry, Measure distance)
Geometry
isWithinDistance
in interface Geometry
geometry
- second geometry
distance
public boolean isBeyond(Geometry geometry, Measure distance)
Geometry
isBeyond
in interface Geometry
geometry
- second geometry
distance
public boolean contains(Geometry geometry)
Geometry
contains
in interface Geometry
geometry
- the Geometry
to test this Geometry
against
Geometry
contains geometry
public boolean crosses(Geometry geometry)
Geometry
crosses
in interface Geometry
geometry
- the Geometry
to test this Geometry
against
Geometry
crosses geometry
public boolean equals(Geometry geometry)
Geometry
equals
in interface Geometry
geometry
- the Geometry
to test this Geometry
against
Geometry
is equal to geometry
public Point getCentroid()
Geometry
getCentroid
in interface Geometry
Point
that is the centroid of this geometrypublic Measure getDistance(Geometry geometry, Unit requestedUnit)
Geometry
getDistance
in interface Geometry
geometry
- second geometryrequestedUnit
- unit of the
public Geometry getIntersection(Geometry geometry)
Geometry
Geometry
.
getIntersection
in interface Geometry
geometry
- other geometry, must not be null
null
(empty set)public Geometry getUnion(Geometry geometry)
Geometry
Geometry
.
getUnion
in interface Geometry
geometry
- other geometry, must not be null
public Geometry getDifference(Geometry geometry)
Geometry
Geometry
.
getDifference
in interface Geometry
geometry
- other geometry, must not be null
null
(empty set)public Geometry getBuffer(Measure distance)
Geometry
Geometry
that contains all points with a distance from this Geometry that is less than or
equal to the specified distance.
getBuffer
in interface Geometry
public Geometry getConvexHull()
Geometry
getConvexHull
in interface Geometry
public Envelope getEnvelope()
Geometry
getEnvelope
in interface Geometry
public com.vividsolutions.jts.geom.Geometry getJTSGeometry()
protected com.vividsolutions.jts.geom.Geometry buildJTSGeometry()
public GMLStdProps getGMLProperties()
GMLObject
gml:name
).
getGMLProperties
in interface GMLObject
public void setGMLProperties(GMLStdProps standardProps)
Geometry
gml:name
).
setGMLProperties
in interface Geometry
standardProps
- properties to be attachedpublic AbstractDefaultGeometry createFromJTS(com.vividsolutions.jts.geom.Geometry jtsGeom)
AbstractDefaultGeometry
from JTS geometries that have been derived from this
geometry by JTS spatial analysis methods.
jtsGeom
-
protected static AbstractDefaultGeometry getAsDefaultGeometry(Geometry geometry)
public String toString()
toString
in class Object
|
deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |