|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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. LineStrings are mapped to a corresponding JTS object, for
complex ones (e.g. Curves 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 ICRS |
crs
Reference to a coordinate system. |
protected Envelope |
env
|
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,
ICRS 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,
ICRS crs)
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(org.deegree.commons.uom.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. |
ICRS |
getCoordinateSystem()
Returns the associated spatial reference system. |
Geometry |
getDifference(Geometry geometry)
Returns the set-theoretic difference of this and the passed Geometry. |
org.deegree.commons.uom.Measure |
getDistance(Geometry geometry,
org.deegree.commons.uom.Unit requestedUnit)
Returns the minimum distance between this and the specified geometry. |
Envelope |
getEnvelope()
Returns the minimal bounding box of the geometry. |
org.deegree.commons.tom.gml.GMLStdProps |
getGMLProperties()
|
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,
org.deegree.commons.uom.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 |
isSFSCompliant()
Returns whether this geometry complies with the Simple Feature Specification (SFS). |
boolean |
isWithin(Geometry geometry)
tests whether the value of a geometric is topological located within this geometry. |
boolean |
isWithinDistance(Geometry geometry,
org.deegree.commons.uom.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(ICRS crs)
Sets the associated spatial reference system. |
void |
setGMLProperties(org.deegree.commons.tom.gml.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 ICRS crs
protected PrecisionModel pm
protected com.vividsolutions.jts.geom.Geometry jtsGeometry
protected Envelope env
| Constructor Detail |
|---|
public AbstractDefaultGeometry(String id,
ICRS 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 org.deegree.commons.tom.ObjectgetId in interface Geometrypublic void setId(String id)
Geometry
setId in interface Geometryid - id of the geometrypublic ICRS getCoordinateSystem()
Geometry
getCoordinateSystem in interface Geometrypublic void setCoordinateSystem(ICRS crs)
Geometry
setCoordinateSystem in interface Geometrycrs - spatial reference system, may be nullpublic PrecisionModel getPrecision()
GeometryPrecisionModel of the geometry.
getPrecision in interface Geometrypublic void setPrecision(PrecisionModel pm)
GeometryPrecisionModel of the geometry.
setPrecision in interface Geometrypm - the precision model to setpublic boolean intersects(Geometry geometry)
Geometry
intersects in interface Geometrygeometry - the Geometry to test this Geometry against
Geometry intersects geometrypublic boolean isDisjoint(Geometry geometry)
Geometry
isDisjoint in interface Geometrygeometry - the Geometry to test this Geometry against
Geometry is disjoint from geometrypublic boolean overlaps(Geometry geometry)
Geometry
overlaps in interface Geometrygeometry - the Geometry to test this Geometry against
Geometry overlaps geometrypublic boolean touches(Geometry geometry)
Geometry
touches in interface Geometrygeometry - the Geometry to test this Geometry against
Geometry touches geometrypublic boolean isWithin(Geometry geometry)
GeometryGeometry.contains(Geometry) method
isWithin in interface Geometry
public boolean isWithinDistance(Geometry geometry,
org.deegree.commons.uom.Measure distance)
Geometry
isWithinDistance in interface Geometrygeometry - second geometry
distance
public boolean isBeyond(Geometry geometry,
org.deegree.commons.uom.Measure distance)
Geometry
isBeyond in interface Geometrygeometry - second geometry
distancepublic boolean contains(Geometry geometry)
Geometry
contains in interface Geometrygeometry - the Geometry to test this Geometry against
Geometry contains geometrypublic boolean crosses(Geometry geometry)
Geometry
crosses in interface Geometrygeometry - the Geometry to test this Geometry against
Geometry crosses geometrypublic boolean equals(Geometry geometry)
Geometry
equals in interface Geometrygeometry - the Geometry to test this Geometry against
Geometry is equal to geometrypublic Point getCentroid()
Geometry
getCentroid in interface GeometryPoint that is the centroid of this geometry
public org.deegree.commons.uom.Measure getDistance(Geometry geometry,
org.deegree.commons.uom.Unit requestedUnit)
Geometry
getDistance in interface Geometrygeometry - second geometryrequestedUnit - unit of the
public Geometry getIntersection(Geometry geometry)
GeometryGeometry.
getIntersection in interface Geometrygeometry - other geometry, must not be null
null (empty set)public Geometry getUnion(Geometry geometry)
GeometryGeometry.
getUnion in interface Geometrygeometry - other geometry, must not be null
public Geometry getDifference(Geometry geometry)
GeometryGeometry.
getDifference in interface Geometrygeometry - other geometry, must not be null
null (empty set)public Geometry getBuffer(org.deegree.commons.uom.Measure distance)
GeometryGeometry that contains all points with a distance from this Geometry that is less than or
equal to the specified distance.
getBuffer in interface Geometrypublic Geometry getConvexHull()
Geometry
getConvexHull in interface Geometrypublic Envelope getEnvelope()
Geometry
getEnvelope in interface Geometrypublic com.vividsolutions.jts.geom.Geometry getJTSGeometry()
protected com.vividsolutions.jts.geom.Geometry buildJTSGeometry()
public org.deegree.commons.tom.gml.GMLStdProps getGMLProperties()
getGMLProperties in interface org.deegree.commons.tom.gml.GMLObjectpublic void setGMLProperties(org.deegree.commons.tom.gml.GMLStdProps standardProps)
Geometrygml:name).
setGMLProperties in interface GeometrystandardProps - properties to be attached
public AbstractDefaultGeometry createFromJTS(com.vividsolutions.jts.geom.Geometry jtsGeom,
ICRS crs)
AbstractDefaultGeometry from JTS geometries that have been derived from this
geometry by JTS spatial analysis methods.
jtsGeom - crs -
protected static AbstractDefaultGeometry getAsDefaultGeometry(Geometry geometry)
public boolean isSFSCompliant()
Geometry
isSFSCompliant in interface Geometrytrue, if this geometry complies with the SFS, false otherwisepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||