oracle.sdoapi.geom
Interface Geometry

All Superinterfaces:
java.lang.Cloneable, java.io.Serializable
All Known Subinterfaces:
Curve, CurvePolygon, CurveString, GeometryCollection, LineString, MultiCurve, MultiCurvePolygon, MultiCurveString, MultiLineString, MultiPoint, MultiPolygon, MultiSurface, Point, Polygon, Surface

public interface Geometry
extends java.lang.Cloneable, java.io.Serializable

Geometry is an interface that represents an OGC-specified geometry. This interface is the root of the geometric interface hierarchy.

Interfaces in this hierarchy is a superset of OGC-specified hierarchy. It contains all OGC-specified geometric types (linear geometric types) on which one can build an OGC-compliant geometric class hierarchy, and additional geometric types (like curvestring, curvepolygon, etc.) that extend the OGC simple feature geometric object model.

Geo-relationship methods like 'relate()', 'overlaps()', etc., are defined in interface oracle.sdoapi.geosp.SpatialRelation, and geo-operations are defined in interface oracle.sdoapi.geosp.SpatialOperator. Users may extend these two interfaces to add more geoprocessing capability.

An additional set of convenient geometric data accessors is added to benefit simple visualizers. Once a client-side geometry object is formed (either by querying the database or by invoking the constructor), it should be ready for geoprocessing and visualization. While a set of geoprocessing accessors has been defined in OGC, there are no standard methods yet to conveniently visualize OGC-compliant geometry objects. For example, given an OGC geometry, users have to first determine if this geometry is a subtype of 'Curve' before invoking its 'getStartPoint()' method. For geoanalysis, this is probably fine, since advanced users could be very clear on what they are working on. On the other hand, simple visualizers just do not care that much. They might simply want a set of interfaces to draw a geometry object without knowing if this geometry is a point or a polygon.

Thus, in addition to OGC-specified data accessing methods, new methods like 'getIsolatedPoints()' and 'getAllSegments()' are provided to satisfy simple visualizers. A visulaizer can simply get all standalone points and all line segments in this geometry object and paint them, regardless of the geometry type. However, user-implemented geoprocessing functions should to use OGC standard data accessing methods, for compatibility reasons.


Method Summary
 java.lang.Object clone()
          Clones this geometry to generate another geometric object.
 java.util.Enumeration getAllIsolatedPoints()
          Gets all isolated points in this geometry.
 java.util.Enumeration getAllSegments()
          Gets all segments in this geometry.
 int getCoordinateDimension()
          Gets the dimension of the coordinates that define this geometry, which must be the same as the coodinate dimension of the spatial reference system for this geometry.
 int getDimensionality()
          Gets the dimensionality of this geometry, which might be different from the coodinate dimension of the spatial reference system for this geometry.
 Envelope getEnvelope()
          Gets the envelope for this geometry.
 java.lang.Class getGeometryType()
          Gets the geometry type as defined in this interface package.
 CoordPoint getLabelPoint()
          Gets the label point for this geometry.
 void getLabelPoint(CoordPoint point)
          Gets the label point for this geometry.
 SpatialReference getSpatialReference()
          Gets the spatial reference system object.
 boolean isEmpty()
          Determines if this geometric object is empty, that is, containing no coordinate points.
 boolean isSimple()
          Determines if this geometric object is simple, that is, containing no anomalous points such as self insersection or self tangency.
 boolean isValid()
          Determines if this geometric object is valid.
 Geometry linearize(double tolerance)
          Linearizes this geometry into a linear OGC geometry.
 

Method Detail

getCoordinateDimension

public int getCoordinateDimension()
Gets the dimension of the coordinates that define this geometry, which must be the same as the coodinate dimension of the spatial reference system for this geometry.
Returns:
the dimension of the coordinates that define this geometry
Since:
JDK1.1

getDimensionality

public int getDimensionality()
Gets the dimensionality of this geometry, which might be different from the coodinate dimension of the spatial reference system for this geometry. For example, users may store non-spatial values such as timestamp and measurement, which make the dimensionality of geometry higher than that of the spatial reference system.
Returns:
the dimension of the data that defines this geometry object
See Also:
getCoordinateDimension()

getSpatialReference

public SpatialReference getSpatialReference()
Gets the spatial reference system object.
Returns:
a spatial reference system object

getGeometryType

public java.lang.Class getGeometryType()
Gets the geometry type as defined in this interface package. Implementation classes should always return an appropriate interface type to standardize the geometry usage and hide implementation details. For example, a point implementation class should return a Point interface so that users can compare it with Point.class to determine that this geometry object is a Point. This method could be helpful to avoid extensive use of the instanceof operator.
Returns:
an interface representing the type of this geometry

getLabelPoint

public CoordPoint getLabelPoint()
Gets the label point for this geometry.
Returns:
a coordinate point that can be used to label this geometry

getLabelPoint

public void getLabelPoint(CoordPoint point)
Gets the label point for this geometry. This method can be more memory efficient when you can reuse the coordinate point object.
Parameters:
point - a preallocated coordinate point that is to be filled with the ordinates of the label point for this geometry

getEnvelope

public Envelope getEnvelope()
Gets the envelope for this geometry. Usually this envelope will be the aligned Minimal Bounding Rectangle for this geometry.
Returns:
the envelope for this geometry

isEmpty

public boolean isEmpty()
Determines if this geometric object is empty, that is, containing no coordinate points.
Returns:
true if this geometric object is empty; false otherwise

isSimple

public boolean isSimple()
Determines if this geometric object is simple, that is, containing no anomalous points such as self insersection or self tangency.
Returns:
true if this geometric object is simple; false otherwise

isValid

public boolean isValid()
Determines if this geometric object is valid. For performance reasons, full validation might not have been done when geometry object was constructed. Users need to invoke this method if they want a geometry object to be completely valid.
Returns:
true if this geometric object is valid; false otherwise

linearize

public Geometry linearize(double tolerance)
                   throws InvalidGeometryException
Linearizes this geometry into a linear OGC geometry.
Parameters:
tolerance - the maximum tolarable distance between the orginal geometry and the result linear geometry
Returns:
the linearized geometry

getAllIsolatedPoints

public java.util.Enumeration getAllIsolatedPoints()
Gets all isolated points in this geometry. An isolated point is a geometric point that is not a vertex of a curve or surface. This method is designed for a simple visualizer.
Returns:
an enumeration of all standalone coordinate points in this geometry

getAllSegments

public java.util.Enumeration getAllSegments()
Gets all segments in this geometry. This method is also designed for simple visualization use and is not recommended for geoprocessing methods (complex geoanalyzers should probably use specific methods in various geometry subtypes for higher efficiency).
Returns:
an enumeration of all segments in this geometry

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones this geometry to generate another geometric object.
Overrides:
clone in class java.lang.Object
Returns:
a geometry object with the same content as in this geometry