|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Geometry
This interface is equivalent to the GM_Object specified in ISO 19107. It is the root class of the geometric object taxonomy and supports interfaces common to all geographically referenced geometric objects.
Geometry instances are sets of direct positions in a particular coordinate reference system. A Geometry can be regarded as an infinite set of points that satisfies the set operation interfaces for a set of direct positions.
A geometric object shall be a combination of a coordinate geometry and a coordinate reference system. In all of the operations, all geometric calculations shall be done in the coordinate reference system of the first geometric object accessed, which is normally the object whose operation is being invoked. Returned objects shall be in the coordinate reference system in which the calculations are done unless explicitly stated otherwise.
This class extends of the Shape
class by historical reasons but this
inheritance will disappear in future versions.
Nested Class Summary | |
---|---|
static interface |
Geometry.DIMENSIONS
|
static interface |
Geometry.OPERATIONS
|
static interface |
Geometry.SUBTYPES
The subtype of a geometry is related with the dimension of the geometry, that is a combination between the spatial dimension (2D, 2ZD, 3D) and the M coordinate or "measure". |
static interface |
Geometry.TYPES
Predefined geometry types in the model. |
Field Summary | |
---|---|
static int |
BEST
|
static int |
E
East. |
static int |
EXTENDED_GEOMSUBTYPE_OFFSET
Initial value for new geometry subtypes (it must not overlap with the basic ones defined in SUBTYPES). |
static int |
EXTENDED_GEOMTYPE_OFFSET
Initial value for new geometry types (it must not overlap with the basic ones defined in TYPES). |
static int |
N
North. |
static int |
NE
North - East. |
static int |
NW
North - West. |
static int |
S
South. |
static int |
SE
South - East. |
static int |
SELECTHANDLER
|
static int |
STRETCHINGHANDLER
|
static int |
SW
South - West. |
static int |
W
West. |
Method Summary | |
---|---|
double |
area()
|
Geometry |
buffer(double distance)
Computes a buffer area around this geometry having the given width This is a utility method to wrap the invocation to the operation Geometry.OPERATIONS.BUFFER . |
Point |
centroid()
|
Geometry |
cloneGeometry()
Creates a clone of this geometry. |
boolean |
contains(Geometry geometry)
Tests whether this geometry contains the specified geometry. |
byte[] |
convertToWKB()
Return a byte array with the equivalent in WKB format of the Geometry. |
String |
convertToWKT()
Return a string with the equivalent in WKT format of the Geometry. |
Geometry |
convexHull()
|
boolean |
coveredBy(Geometry geometry)
|
boolean |
crosses(Geometry geometry)
|
Geometry |
difference(Geometry other)
|
boolean |
disjoint(Geometry geometry)
|
double |
distance(Geometry geometry)
Returns the minimum distance between this Geometry and the specified geometry. |
boolean |
fastIntersects(double x,
double y,
double w,
double h)
Used by the drawing strategies to quickly test whether this geometry intersects with the visible rectangle. |
Rectangle2D |
getBounds2D()
Deprecated. use getEnvelope. |
int |
getDimension()
Returns the largest number n such that each direct position in a geometric set can be associated with a subset that has the direct position in its interior and is similar (isomorphic) to Rn, Euclidean n-space. |
Envelope |
getEnvelope()
Returns the minimum bounding box for this Geometry. |
GeneralPathX |
getGeneralPath()
Get GeneralPathIterator, to do registered operations to it. |
GeometryType |
getGeometryType()
Instance of the GeometryType associated to this geometry. |
Handler[] |
getHandlers(int type)
It returns the handlers of the geometry, these they can be of two types is straightening and of selection. |
Shape |
getInternalShape()
Useful to have the real shape behind the scenes. |
PathIterator |
getPathIterator(AffineTransform at)
If applies an affine transformation and returns the GeneralPathXIterator with this geometry's information. |
PathIterator |
getPathIterator(AffineTransform at,
double flatness)
If applies an affine transformation and returns the GeneralPathXIterator with this geometry's information. |
Shape |
getShape()
Deprecated. this class inherits of Shape by historical
reasons. This method has been added just to control the usage of
the Shape class but it will removed in a future. |
Shape |
getShape(AffineTransform affineTransform)
Deprecated. this class inherits of Shape by historical
reasons. This method has been added just to control the usage of
the Shape class but it will removed in a future. |
int |
getType()
If this geometry is a predefined interface then this method returns one of Geometry.TYPES contants. |
Geometry |
intersection(Geometry other)
|
boolean |
intersects(Geometry geometry)
|
boolean |
intersects(Rectangle2D r)
Returns true if this geometry intersects the rectangle passed as parameter. |
Object |
invokeOperation(int index,
GeometryOperationContext ctx)
Invokes a geometry operation given its index and context. |
Object |
invokeOperation(String opName,
GeometryOperationContext ctx)
Invokes a geometry operation given its name and context. |
boolean |
isSimple()
Returns true if this Geometry has no interior point of
self-intersection or self-tangency. |
boolean |
overlaps(Geometry geometry)
Tests whether this geometry overlaps the specified geometry. |
double |
perimeter()
|
void |
reProject(org.cresques.cts.ICoordTrans ct)
Reprojects this geometry by the coordinate transformer passed as parameter. |
boolean |
touches(Geometry geometry)
|
void |
transform(AffineTransform at)
It applies an affine transformation to the geometry. |
Geometry |
union(Geometry other)
|
boolean |
within(Geometry geometry)
|
Methods inherited from interface java.awt.Shape |
---|
contains, contains, contains, contains, getBounds, intersects |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Field Detail |
---|
static final int EXTENDED_GEOMTYPE_OFFSET
static final int EXTENDED_GEOMSUBTYPE_OFFSET
static final int BEST
static final int N
static final int NE
static final int E
static final int SE
static final int S
static final int SW
static final int W
static final int NW
static final int SELECTHANDLER
static final int STRETCHINGHANDLER
Method Detail |
---|
int getType()
Geometry.TYPES
contants.
Geometry.TYPES
or a runtime constant if it is an extended
type.Geometry cloneGeometry()
boolean intersects(Rectangle2D r)
intersects
in interface Shape
r
- Rectangle.
this
intersects r
.boolean fastIntersects(double x, double y, double w, double h)
x
- The minimum X coordinate.y
- The minimum Y coordinate.w
- The width of the envelope.h
- The height of the envelope.
this
intersects the rectangle defined by the
parameters.Rectangle2D getBounds2D()
getBounds2D
in interface Shape
Envelope getEnvelope()
Returns the minimum bounding box for this Geometry. This shall be the coordinate region spanning the minimum and maximum value for each ordinate taken on by DirectPositions in this Geometry. The simplest representation for an envelope consists of two DirectPositions, the first one containing all the minimums for each ordinate, and second one containing all the maximums.
void reProject(org.cresques.cts.ICoordTrans ct)
ct
- Coordinate Transformer.PathIterator getPathIterator(AffineTransform at)
getPathIterator
in interface Shape
at
- The transformation to apply.
Handler[] getHandlers(int type)
type
- Type of handlers.
void transform(AffineTransform at)
at
- The transformation to apply.PathIterator getPathIterator(AffineTransform at, double flatness)
getPathIterator
in interface Shape
at
- The affine transformation.flatness
-
Shape getInternalShape()
int getDimension()
boolean isSimple()
true
if this Geometry has no interior point of
self-intersection or self-tangency. In mathematical formalisms, this
means that every point in the interior of the object must have a metric
neighborhood whose intersection with the object is isomorphic to an
n-sphere, where n is the dimension of this Geometry.
Object invokeOperation(int index, GeometryOperationContext ctx) throws GeometryOperationNotSupportedException, GeometryOperationException
index
- Unique index of the operation. Operation code.ctx
- The context of the geometry operation.
GeometryOperationNotSupportedException
- It is thrown when the operation has been not registered for
this geometry.
GeometryOperationException
- It is thrown when there is an error executing the operation.Object invokeOperation(String opName, GeometryOperationContext ctx) throws GeometryOperationNotSupportedException, GeometryOperationException
opName
- Operation name.ctx
- The context of the geometry operation.
GeometryOperationNotSupportedException
- It is thrown when the operation has been not registered for
this geometry.
GeometryOperationException
- It is thrown when there is an error executing the operation.GeometryType getGeometryType()
GeneralPathX getGeneralPath()
byte[] convertToWKB() throws GeometryOperationNotSupportedException, GeometryOperationException
Geometry.OPERATIONS.CONVERTTOWKB
.
GeometryOperationNotSupportedException
GeometryOperationException
String convertToWKT() throws GeometryOperationNotSupportedException, GeometryOperationException
Geometry.OPERATIONS.CONVERTTOWKT
.
GeometryOperationNotSupportedException
GeometryOperationException
Geometry buffer(double distance) throws GeometryOperationNotSupportedException, GeometryOperationException
Geometry.OPERATIONS.BUFFER
.
distance
- the width of the buffer
GeometryOperationNotSupportedException
GeometryOperationException
boolean contains(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
Geometry.OPERATIONS.CONTAINS
.
geometry
- the Geometry with which to compare this Geometry
GeometryOperationNotSupportedException
GeometryOperationException
double distance(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
Geometry.OPERATIONS.DISTANCE
.
geometry
- the Geometry from which to compute the distance
GeometryOperationNotSupportedException
GeometryOperationException
boolean overlaps(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
Geometry.OPERATIONS.OVERLAPS
.
geometry
- the Geometry with which to compare this Geometry
GeometryOperationNotSupportedException
GeometryOperationException
Geometry convexHull() throws GeometryOperationNotSupportedException, GeometryOperationException
GeometryOperationNotSupportedException
GeometryOperationException
boolean coveredBy(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
GeometryOperationNotSupportedException
GeometryOperationException
boolean crosses(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
GeometryOperationNotSupportedException
GeometryOperationException
Geometry difference(Geometry other) throws GeometryOperationNotSupportedException, GeometryOperationException
GeometryOperationNotSupportedException
GeometryOperationException
boolean disjoint(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
GeometryOperationNotSupportedException
GeometryOperationException
Geometry intersection(Geometry other) throws GeometryOperationNotSupportedException, GeometryOperationException
GeometryOperationNotSupportedException
GeometryOperationException
boolean intersects(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
GeometryOperationNotSupportedException
GeometryOperationException
boolean touches(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
GeometryOperationNotSupportedException
GeometryOperationException
Geometry union(Geometry other) throws GeometryOperationNotSupportedException, GeometryOperationException
GeometryOperationNotSupportedException
GeometryOperationException
boolean within(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
GeometryOperationNotSupportedException
GeometryOperationException
Point centroid() throws GeometryOperationNotSupportedException, GeometryOperationException
GeometryOperationNotSupportedException
GeometryOperationException
double area() throws GeometryOperationNotSupportedException, GeometryOperationException
GeometryOperationNotSupportedException
GeometryOperationException
double perimeter() throws GeometryOperationNotSupportedException, GeometryOperationException
GeometryOperationNotSupportedException
GeometryOperationException
Shape getShape(AffineTransform affineTransform)
Shape
by historical
reasons. This method has been added just to control the usage of
the Shape
class but it will removed in a future.
Shape getShape()
Shape
by historical
reasons. This method has been added just to control the usage of
the Shape
class but it will removed in a future.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |