public class DirectPosition3D extends Object implements DirectPosition, Serializable, Cloneable
Constructor and Description |
---|
DirectPosition3D()
Constructs a position initialized to (0,0,0) with a
null coordinate reference system. |
DirectPosition3D(CoordinateReferenceSystem crs)
Constructs a position with the specified coordinate reference system.
|
DirectPosition3D(CoordinateReferenceSystem crs,
double x,
double y,
double z)
Constructs a 2D position from the specified ordinates in the specified CRS.
|
DirectPosition3D(DirectPosition point)
Constructs a position initialized to the same values than the specified point.
|
DirectPosition3D(double x,
double y,
double z)
Constructs a 3D position from the specified ordinates.
|
Modifier and Type | Method and Description |
---|---|
DirectPosition3D |
clone()
Returns a clone of this point.
|
boolean |
equals(Object object)
Compares this point with the specified object for equality.
|
double[] |
getCoordinate()
Returns a sequence of numbers that hold the coordinate of this position in its reference
system.
|
CoordinateReferenceSystem |
getCoordinateReferenceSystem()
Returns the coordinate reference system in which the coordinate is given.
|
int |
getDimension()
The length of coordinate sequence (the number of entries).
|
DirectPosition |
getDirectPosition()
Returns always
this , the direct position for this position. |
double |
getOrdinate(int dimension)
Returns the ordinate at the specified dimension.
|
int |
hashCode()
Returns a hash value for this coordinate.
|
void |
setCoordinateReferenceSystem(CoordinateReferenceSystem crs)
Set the coordinate reference system in which the coordinate is given.
|
void |
setLocation(DirectPosition position)
Set this coordinate to the specified direct position.
|
void |
setOrdinate(int dimension,
double value)
Sets the ordinate value along the specified dimension.
|
String |
toString()
Returns a string representation of this coordinate.
|
public DirectPosition3D()
null
coordinate reference system.public DirectPosition3D(CoordinateReferenceSystem crs)
crs
- The coordinate reference system, or null
.public DirectPosition3D(double x, double y, double z)
x
- The x value.y
- The y value.z
- The z value.public DirectPosition3D(CoordinateReferenceSystem crs, double x, double y, double z)
crs
- The coordinate reference system, or null
.x
- The x value.y
- The y value.z
- The z value.public DirectPosition3D(DirectPosition point)
point
- The point to copy.public DirectPosition getDirectPosition()
this
, the direct position for this position.getDirectPosition
in interface Position
this
).public final 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 DirectPosition
null
.public void setCoordinateReferenceSystem(CoordinateReferenceSystem crs)
crs
- The new coordinate reference system, or null
.public final int getDimension()
DirectPosition3D
objects.getDimension
in interface DirectPosition
public double[] getCoordinate()
getCoordinate
in interface DirectPosition
public final double getOrdinate(int dimension) throws IndexOutOfBoundsException
getOrdinate
in interface DirectPosition
dimension
- The dimension in the range 0 to 2 inclusive.IndexOutOfBoundsException
- if the specified dimension is out of bounds.public final void setOrdinate(int dimension, double value) throws IndexOutOfBoundsException
setOrdinate
in interface DirectPosition
dimension
- the dimension for the ordinate of interest.value
- the ordinate value of interest.IndexOutOfBoundsException
- if the specified dimension is out of bounds.public void setLocation(DirectPosition position) throws MismatchedDimensionException
position
- The new position for this point.MismatchedDimensionException
- if this point doesn't have the expected dimension.public String toString()
public int hashCode()
DirectPosition.hashCode()
contract.hashCode
in interface DirectPosition
hashCode
in class Object
public boolean equals(Object object)
DirectPosition
interface, then the comparison is performed as specified in its
DirectPosition.equals(java.lang.Object)
contract.equals
in interface DirectPosition
equals
in class Object
object
- The object to compare with this position.true
if the given object is equals to this position.public DirectPosition3D clone()
clone
in class Object
Object.clone()
Copyright © 1996–2019 Geotools. All rights reserved.