|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.model.spatialschema.GeometryImpl
public abstract class GeometryImpl
Default implementation of the Geometry interface from package deegree.model. The implementation is abstract because only the management of the spatial reference system is unique for all geometries.
Field Summary | |
---|---|
protected Boundary |
boundary
|
protected Point |
centroid
|
protected Geometry |
convexHull
|
protected CoordinateSystem |
crs
|
protected boolean |
empty
|
protected Envelope |
envelope
|
protected double |
mute
|
protected boolean |
valid
|
Fields inherited from interface org.deegree.model.spatialschema.Geometry |
---|
BUFFER_CAP_BUTT, BUFFER_CAP_ROUND, BUFFER_CAP_SQUARE |
Constructor Summary | |
---|---|
protected |
GeometryImpl(CoordinateSystem crs)
constructor that sets the spatial reference system |
Method Summary | |
---|---|
protected abstract void |
calculateParam()
recalculates internal parameters |
java.lang.Object |
clone()
|
boolean |
contains(Geometry that)
The Boolean valued operation "contains" shall return TRUE if this Geometry contains another Geometry. |
boolean |
contains(Position position)
The Boolean valued operation "contains" shall return TRUE if this Geometry contains a single point given by a coordinate. |
Geometry |
difference(Geometry that)
The "difference" operation shall return the set theoretic difference of this Geometry and the passed Geometry. |
double |
distance(Geometry gmo)
The operation "distance" shall return the distance between this Geometry and another Geometry. |
boolean |
equals(java.lang.Object that)
Compares the Geometry to be equal to another Geometry. |
Boundary |
getBoundary()
returns the boundary of the surface as general boundary |
Geometry |
getBuffer(double distance)
The operation "buffer" shall return a Geometry containing all points whose distance from this Geometry is less than or equal to the "distance" passed as a parameter. |
Geometry |
getBuffer(double distance,
int segments,
int capStyle)
The operation "buffer" shall return a Geometry containing all points whose distance from this Geometry is less than or equal to the "distance" passed as a parameter. |
Point |
getCentroid()
The operation "centroid" shall return the mathematical centroid for this Geometry. |
Geometry |
getConvexHull()
The operation "convexHull" shall return a Geometry that represents the convex hull of this Geometry. |
CoordinateSystem |
getCoordinateSystem()
|
Envelope |
getEnvelope()
returns the bounding box / envelope of a geometry |
double |
getTolerance()
returns the tolerance value use for topological operations |
Geometry |
intersection(Geometry that)
The "intersection" operation shall return the set theoretic intersection of this Geometry and the passed Geometry. |
boolean |
intersects(Geometry that)
The Boolean valued operation "intersects" shall return TRUE if this Geometry intersects another Geometry. |
boolean |
isEmpty()
|
protected boolean |
isValid()
|
boolean |
isWithinDistance(Geometry that,
double distance)
provide optimized proximity queries within for a distance . calvin added on 10/21/2003 |
void |
setCoordinateSystem(CoordinateSystem crs)
sets the spatial reference system |
void |
setEmpty(boolean empty)
|
void |
setTolerance(double tolerance)
sets tolerance value use for topological operations |
protected void |
setValid(boolean valid)
|
java.lang.String |
toString()
|
void |
translate(double[] d)
dummy implementation of this method |
Geometry |
union(Geometry that)
The "union" operation shall return the set theoretic union of this Geometry and the passed Geometry. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.deegree.model.spatialschema.Geometry |
---|
getCoordinateDimension, getDimension |
Field Detail |
---|
protected double mute
protected CoordinateSystem crs
protected Boundary boundary
protected Envelope envelope
protected Geometry convexHull
protected Point centroid
protected boolean empty
protected boolean valid
Constructor Detail |
---|
protected GeometryImpl(CoordinateSystem crs)
crs
- new spatial reference systemMethod Detail |
---|
public CoordinateSystem getCoordinateSystem()
getCoordinateSystem
in interface Geometry
public void setCoordinateSystem(CoordinateSystem crs)
crs
- new spatial reference systempublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean isEmpty()
isEmpty
in interface Geometry
public void setEmpty(boolean empty)
empty
- indicates the geometry as emptypublic Boundary getBoundary()
getBoundary
in interface Geometry
public void translate(double[] d)
translate
in interface Geometry
d
- vector to translate the geometry withpublic double distance(Geometry gmo)
The operation "distance" shall return the distance between this Geometry and another Geometry. This distance is defined to be the greatest lower bound of the set of distances between all pairs of points that include one each from each of the two Geometries. A "distance" value shall be a positive number associated to distance units such as meters or standard foot. If necessary, the second geometric object shall be transformed into the same coordinate reference system as the first before the distance is calculated.
If the geometric objects overlap, or touch, then their distance apart shall be zero. Some current implementations use a "negative" distance for such cases, but the approach is neither consistent between implementations, nor theoretically viable.
distance
in interface Geometry
public Point getCentroid()
The operation "centroid" shall return the mathematical centroid for this Geometry. The result is not guaranteed to be on the object. For heterogeneous collections of primitives, the centroid only takes into account those of the largest dimension. For example, when calculating the centroid of surfaces, an average is taken weighted by area. Since curves have no area they do not contribute to the average.
getCentroid
in interface Geometry
public Envelope getEnvelope()
getEnvelope
in interface Geometry
public Geometry getConvexHull()
getConvexHull
in interface Geometry
an may has an useful implementation in extending classes
public Geometry getBuffer(double distance)
getBuffer
in interface Geometry
public Geometry getBuffer(double distance, int segments, int capStyle)
Geometry
getBuffer
in interface Geometry
public boolean contains(Geometry that)
contains
in interface Geometry
that
- the Geometry to test (whether is is contained)
public boolean contains(Position position)
contains
in interface Geometry
position
- Position to test (whether is is contained)
public boolean intersects(Geometry that)
intersects
in interface Geometry
that
- the Geometry to intersect with
public Geometry union(Geometry that)
union
in interface Geometry
that
- the Geometry to unify
public Geometry intersection(Geometry that) throws GeometryException
intersection
in interface Geometry
that
- the Geometry to intersect with
GeometryException
public Geometry difference(Geometry that)
difference
in interface Geometry
that
- the Geometry to calculate the difference with
public boolean equals(java.lang.Object that)
equals
in class java.lang.Object
that
- the Geometry to test for equality
public boolean isWithinDistance(Geometry that, double distance)
isWithinDistance
in interface Geometry
public void setTolerance(double tolerance)
setTolerance
in interface Geometry
tolerance
- public double getTolerance()
getTolerance
in interface Geometry
protected void setValid(boolean valid)
valid
- invalidates the calculated parameters of the Geometryprotected boolean isValid()
protected abstract void calculateParam()
public java.lang.String toString()
toString
in class java.lang.Object
|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org