|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.geom.Point2D
java.awt.geom.Point2D.Double
org.geotools.geometry.DirectPosition2D
Holds the coordinates for a two-dimensional position within some coordinate reference system.
This class put no restriction on the axis order, i.e. it doesn't ensure that the value stored
in the x field increases toward East and the
value in the y field toward North. The rational
is that other DirectPosition
implementation do not have restriction on axis order, and
anyway such a restriction is hard to generalize (what to do with
North-East direction?).
Nested Class Summary |
Nested classes inherited from class java.awt.geom.Point2D |
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float |
Field Summary |
Fields inherited from class java.awt.geom.Point2D.Double |
x, y |
Constructor Summary | |
DirectPosition2D()
Construct a position initialized to (0,0) with a null
coordinate reference system. |
|
DirectPosition2D(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Construct a position with the specified coordinate reference system. |
|
DirectPosition2D(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
double x,
double y)
Construct a 2D position from the specified ordinates in the specified CRS. |
|
DirectPosition2D(org.opengis.spatialschema.geometry.DirectPosition point)
Construct a position initialized to the same values than the specified point. |
|
DirectPosition2D(double x,
double y)
Construct a 2D position from the specified ordinates. |
|
DirectPosition2D(java.awt.geom.Point2D point)
Construct a position from the specified Point2D . |
Method Summary | |
org.opengis.referencing.crs.CoordinateReferenceSystem |
getCoordinateReferenceSystem()
Returns the coordinate reference system in which the coordinate is given. |
double[] |
getCoordinates()
Returns a sequence of numbers that hold the coordinate of this position in its reference system. |
int |
getDimension()
The length of coordinate sequence (the number of entries). |
double |
getOrdinate(int dimension)
Returns the ordinate at the specified dimension. |
org.opengis.spatialschema.geometry.DirectPosition |
getPosition()
Returns always this , the direct position for this
position. |
int |
hashCode()
Returns a hash value for this coordinate. |
void |
setCoordinateReferenceSystem(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Set the coordinate reference system in which the coordinate is given. |
void |
setLocation(org.opengis.spatialschema.geometry.DirectPosition position)
Set this coordinate to the specified direct position. |
void |
setOrdinate(int dimension,
double value)
Sets the ordinate value along the specified dimension. |
java.awt.geom.Point2D |
toPoint2D()
Returns a Point2D with the same coordinate as this direct position. |
java.lang.String |
toString()
Returns a string representation of this coordinate. |
Methods inherited from class java.awt.geom.Point2D.Double |
getX, getY, setLocation |
Methods inherited from class java.awt.geom.Point2D |
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, setLocation |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.opengis.spatialschema.geometry.DirectPosition |
clone |
Constructor Detail |
public DirectPosition2D()
null
coordinate reference system.
public DirectPosition2D(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
public DirectPosition2D(double x, double y)
public DirectPosition2D(org.opengis.referencing.crs.CoordinateReferenceSystem crs, double x, double y)
public DirectPosition2D(java.awt.geom.Point2D point)
Point2D
.
public DirectPosition2D(org.opengis.spatialschema.geometry.DirectPosition point)
Method Detail |
public org.opengis.spatialschema.geometry.DirectPosition getPosition()
this
, the direct position for this
position.
getPosition
in interface org.opengis.spatialschema.geometry.geometry.Position
public final org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
null
if this particular DirectPosition
is included
in a larger object with such a reference to a coordinate reference system.
getCoordinateReferenceSystem
in interface org.opengis.spatialschema.geometry.DirectPosition
null
.public void setCoordinateReferenceSystem(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
crs
- The new coordinate reference system, or null
.public final int getDimension()
DirectPosition2D
objects.
getDimension
in interface org.opengis.spatialschema.geometry.DirectPosition
public double[] getCoordinates()
getCoordinates
in interface org.opengis.spatialschema.geometry.DirectPosition
public final double getOrdinate(int dimension) throws java.lang.IndexOutOfBoundsException
getOrdinate
in interface org.opengis.spatialschema.geometry.DirectPosition
dimension
- The dimension in the range 0 to 1 inclusive.
java.lang.IndexOutOfBoundsException
- if the specified dimension is out of bounds.public final void setOrdinate(int dimension, double value) throws java.lang.IndexOutOfBoundsException
setOrdinate
in interface org.opengis.spatialschema.geometry.DirectPosition
dimension
- the dimension for the ordinate of interest.value
- the ordinate value of interest.
java.lang.IndexOutOfBoundsException
- if the specified dimension is out of bounds.public void setLocation(org.opengis.spatialschema.geometry.DirectPosition position) throws org.opengis.spatialschema.geometry.MismatchedDimensionException
position
- The new position for this point.
org.opengis.spatialschema.geometry.MismatchedDimensionException
- if this point doesn't have the expected dimension.public java.awt.geom.Point2D toPoint2D()
Point2D
with the same coordinate as this direct position.
public java.lang.String toString()
public int hashCode()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |