|
Spatial DataBlade JAVA API v8.21 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Geometry
Geometry is the root in a hierarchy of interfaces encapsulating the abstract model of OpenGIS Simple Features Specification.
For simplicity reasons, the Geometry interface provide a minimum number of essential members. Particular implementations of Geometry may choose to implement just a subset of the methods defined here, or provide additional convenience methods.
Method Summary | |
---|---|
java.io.ByteArrayOutputStream |
asBinary()
Exports this geometry to a specific well-known binary representation. |
java.lang.String |
asText()
Exports this geometry to a specific well-known text representation. |
Geometry |
boundary()
Returns the combined boundary of this geometry object. |
Geometry |
buffer(double distance)
Generates a geometry by encircling this object at a specified distance. |
boolean |
contains(Geometry geometry)
Returns whether or not this object completely contains the geometry argument. |
Geometry |
convexHull()
Returns the convex hull of any geometry that has at least three vertices forming a convex. |
boolean |
crosses(Geometry geometry)
Determines whether this geometry crosses the argument geometry. |
Geometry |
difference(Geometry geometry)
Returns the portion of this geometry that is not intersected by the argument geometry - the logical AND NOT of space. |
int |
dimension()
Returns the dimension of this geometry object. |
boolean |
disjoint(Geometry geometry)
Returns whether this geometry does not intersect, overlap, or touch the argument geometry. |
double |
distance(Geometry geometry)
Returns the shortest distance separating this geometry from the argument. |
Geometry |
envelope()
Returns a Geometry that represents this object's envelope. |
boolean |
envelopesIntersect(Geometry geometry)
Returns true if the envelope of this geometry object intersects the envelope of the argument. |
boolean |
equals(java.lang.Object geometry)
Tests this geometry object for equality with the given object. |
Envelope |
extent()
Returns an Envelope object that represents this geometry's envelope. |
Geometry |
exterior()
Returns the exterior of a geometry, that is, all space not occupied by the geometry. |
Geometry |
interior()
Returns the interior of a geometry, that is, the space occupied by the geometry. |
Geometry |
intersection(Geometry geometry)
Returns the intersection set of this geometry object with the argument. |
boolean |
intersects(Geometry geometry)
Tests this geometry object for intersection with the argument. |
boolean |
is3D()
Tests whether or not this geometry object has three-dimensional coordinates. |
boolean |
isEmpty()
Tests whether this geometry object is empty. |
boolean |
isMeasured()
Tests whether or not this geometry object has measures. |
boolean |
isSimple()
Tests whether this geometry object is simple (has no anomalous geometric points, such as self intersection or self tangency). |
boolean |
isValid()
Tests for the validity of this object (the object obeys all the Simple Feature rules for its type). |
Geometry |
locateAlong(double measure)
Takes a geometry object and a measure to return the set of points found having that measure. |
Geometry |
locateBetween(double fromMeasure,
double toMeasure)
Returns the points or line segments of the given geometry between the specified measure values (fromMeasure and toMeasure). |
int |
numPoints()
Returns the number of points in this geometry. |
boolean |
overlaps(Geometry geometry)
Determines whether the argument overlaps this geometry object. |
int |
srid()
Returns this object's spatial reference system identity. |
Geometry |
symmetricDiff(Geometry geometry)
Returns a geometry object that is composed of the parts of this object and the argument that aren't common to both. |
boolean |
touches(Geometry geometry)
This geometry object touches the argument if and only if the interiors do not intersect and the boundary of either geometry intersects the other's interior or boundary. |
Geometry |
union(Geometry geometry)
Returns the union set (the boolean logical OR of space) of this geometry object and the argument. |
boolean |
within(Geometry geometry)
Tests whether this geometry object is completely within the argument geometry. |
Method Detail |
---|
java.lang.String asText()
java.io.ByteArrayOutputStream asBinary()
Geometry boundary()
Returns the combined boundary of this geometry object.
The dimension of the resulting geometry is always one less than the input geometry. Points and MultiPoints always result in a boundary that is an empty geometry, dimension -1. Linestrings and MultiLinestrings return a multipoint boundary, dimension 0. A Polygon or MultiPolygon always returns a MultiLinestring boundary, dimension 1.
Geometry buffer(double distance)
Generates a geometry by encircling this object at a specified distance.
A single polygon results when a primary geometry is buffered or when the buffer polygons of a collection are close enough to overlap. When enough separation exists between the elements of a buffered collection, individual buffer polygons result in MultiPolygon object.
Buffer accepts both positive and negative distances, but only geometries with a dimension of 2 (Polygon and MultiPolygon) can apply a negative buffer. The absolute value of the buffer distance is used when the dimension of the source geometry is less than 2 (all geometries that are neither Polygon nor MultiPolygon). Generally speaking, positive buffer distances generate polygon rings that are away from the center of the source geometry, and for the exterior ring of a Polygon or MultiPolygon, toward the center when the distance is negative. For interior rings of a Polygon or MultiPolygon, the buffer ring is toward the center when the buffer distance is positive and away from the center when it is negative.
The buffering process merges buffer polygons that overlap. Negative distances greater than one-half the maximum interior width of a polygon result in an empty geometry.
distance
- The distance at which the encircling geometry is
generated.
boolean contains(Geometry geometry)
Returns whether or not this object completely contains the geometry argument. The boundary and interior of the argument geometry are not allowed to intersect the exterior of this object.
This function returns the opposite result of within.
geometry
- The geometry tested for inclusion.
within(Geometry)
Geometry convexHull()
Returns the convex hull of any geometry that has at least three vertices forming a convex.
Creating a convex hull is often the first step when tessellating a set of points to create a triangulated irregular network (TIN). If vertices of the geometry do not form a convex, convexHull returns null.
boolean crosses(Geometry geometry)
Determines whether this geometry crosses the argument geometry. Returns true if their intersection results in a geometry object whose dimension is one less than the maximum dimension of the source objects.
The following pairs of geometries cross each other:
MultiPoint and Polygon MultiPoint and LineString LineString and LineString LineString and Polygon LineString and MultiPolygon
Geometry difference(Geometry geometry)
Returns the portion of this geometry that is not intersected by the argument geometry - the logical AND NOT of space.
This function only operates on geometries of like dimension and returns a GeometryCollection that has the same dimension as the source geometries. In the event that the source geometries are equal, an empty geometry is returned.
geometry
- The geometry tested for inclusion.
int dimension()
Returns the dimension of this geometry object. A geometry can have one of three dimensions:
boolean disjoint(Geometry geometry)
geometry
- The geometry tested for non-intersection.
intersects(com.ibm.spatial.geom.Geometry)
double distance(Geometry geometry)
geometry
- The geometry to which the distance is calculated.
Geometry envelope()
Returns a Geometry that represents this object's envelope.
The envelope of a geometry is the bounding geometry formed by the minimum and maximum (x,y) coordinates. The envelopes of most geometries form a boundary rectangle; however, the envelope of a point is the point itself, since its minimum and maximum coordinates are the same, and the envelope of a horizontal or vertical linestring is a linestring represented by the endpoints of the source linestring.
Envelope extent()
Returns an Envelope object that represents this geometry's envelope.
The envelope of a geometry is the bounding geometry formed by the minimum and maximum (x,y) coordinates. The envelopes of most geometries form a boundary rectangle; however, the envelope of a point is the point itself, since its minimum and maximum coordinates are the same, and the envelope of a horizontal or vertical linestring is a linestring represented by the endpoints of the source linestring.
boolean envelopesIntersect(Geometry geometry)
geometry
- The geometry tested for envelope intersection
boolean equals(java.lang.Object geometry)
equals
in class java.lang.Object
geometry
- The object to be compared with this geometry
boolean intersects(Geometry geometry)
Tests this geometry object for intersection with the argument.
Within the Dimensionally Extended 9 Intersection Model (DE-9IM), this function function returns true if and only if any of the following conditions are true:
geometry
- The geometry tested for intersection
Geometry intersection(Geometry geometry)
Returns the intersection set of this geometry object with the argument. The intersection set is returned as a collection that is the minimum dimension of the source geometries. For example, for a LineString that intersects a Polygon, this function returns that portion of the LineString common to the interior and boundary of the Polygon as a MultiLineString. The MultiLineString contains more than one LineString if the source LineString intersects the Polygon with two or more discontinuous segments.
If the geometries do not intersect or if the intersection results in a dimension less than both source geometries, an empty geometry is returned.
geometry
- The geometry to intersect with
boolean is3D()
boolean isEmpty()
boolean isSimple()
Tests whether this geometry object is simple (has no anomalous geometric points, such as self intersection or self tangency).
For example, a LineString is simple if it does not intersect its interior. A MultiPoint is simple if none of its elements occupy the same coordinate space. A MultiLineString is simple if none of its element's interiors intersect.
boolean overlaps(Geometry geometry)
Determines whether the argument overlaps this geometry object.
Two geometries overlap if and only if their intersection results in a geometry object of the same dimension but not equal to either source object. In other words, if the intersection of two Polygon geometries results in a Polygon, then this function returns true.
geometry
- The geometry to test for overlapping
int srid()
int numPoints()
Geometry symmetricDiff(Geometry geometry)
Returns a geometry object that is composed of the parts of this object and the argument that aren't common to both.
The symmetric difference of two geometries is the logical XOR of space (the portions of the source geometries that are not part of the intersection set). The source geometries must have the same dimension. If the geometries are equal, this function returns an empty geometry; otherwise, it returns the result as a GeometryCollection.
geometry
- The second operand of the symmetric difference
boolean touches(Geometry geometry)
This geometry object touches the argument if and only if the interiors do not intersect and the boundary of either geometry intersects the other's interior or boundary. At least one geometry must be a LineString, Polygon, MultiLineString, or MultiPolygon.
geometry
- The geometry to test for touching
Geometry union(Geometry geometry)
geometry
- The second operand of the union
boolean within(Geometry geometry)
geometry
- The geometry to test for within
contains(Geometry)
boolean isMeasured()
boolean isValid()
Tests for the validity of this object (the object obeys all the Simple Feature rules for its type).
The IBM Informix Spatial DataBlade validates spatial data before accepting it, Geometries returned as a result of SQL queries are always valid. This function may be used to validate spatial data supplied by other implementations of the OpenGIS spatial data specification.
Geometry exterior()
Geometry interior()
Geometry locateAlong(double measure)
Geometry locateBetween(double fromMeasure, double toMeasure)
|
Spatial DataBlade JAVA API v8.21 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |