deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.model.spatialschema
Class PositionImpl

java.lang.Object
  extended by org.deegree.model.spatialschema.PositionImpl
All Implemented Interfaces:
Serializable, Position

public class PositionImpl
extends Object
implements Position, Serializable

A sequence of decimals numbers which when written on a width are a sequence of coordinate positions. The width is derived from the CRS or coordinate dimension of the container.

-----------------------------------------------------------------------

Version:
$Revision: 18195 $ $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Andreas Poth, last edited by: $Author: mschneider $
See Also:
Serialized Form

Constructor Summary
protected PositionImpl()
          constructor. initializes a point to the coordinate 0/0
protected PositionImpl(double[] coords)
          constructor.
protected PositionImpl(double x, double y)
          constructor
protected PositionImpl(double x, double y, double z)
          constructor
protected PositionImpl(javax.vecmath.Point3d other)
          Constructor from another point3d
 
Method Summary
 Object clone()
           
 boolean equals(Object other)
           
 double getAccuracy()
          returns the accuracy the position is defined.
 double[] getAsArray()
          NOTE: The returned array always has a length of 3, regardless of the dimension.
 javax.vecmath.Point3d getAsPoint3d()
           
 int getCoordinateDimension()
           
 double getX()
           
 double getY()
           
 double getZ()
           
 void setAccuracy(double accuracy)
           
 String toString()
           
 void translate(double[] d)
          translate the point by the submitted values.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PositionImpl

protected PositionImpl()
constructor. initializes a point to the coordinate 0/0


PositionImpl

protected PositionImpl(double x,
                       double y)
constructor

Parameters:
x - x-value of the point
y - y-value of the point

PositionImpl

protected PositionImpl(double x,
                       double y,
                       double z)
constructor

Parameters:
x - x-value of the point
y - y-value of the point
z - z-value of the point

PositionImpl

protected PositionImpl(double[] coords)
constructor.

Parameters:
coords - the Coordinates from which the position is build.

PositionImpl

protected PositionImpl(javax.vecmath.Point3d other)
Constructor from another point3d

Parameters:
other - the Coordinates from which the position is build if null the default values 0,0,0 with a dim of 3 is assumed.
Method Detail

getCoordinateDimension

public int getCoordinateDimension()
Specified by:
getCoordinateDimension in interface Position
Returns:
the coordinate dimension of the position

clone

public Object clone()
Overrides:
clone in class Object
Returns:
a shallow copy of the geometry.

getX

public double getX()
Specified by:
getX in interface Position
Returns:
the x-value of this point

getY

public double getY()
Specified by:
getY in interface Position
Returns:
the y-value of this point

getZ

public double getZ()
Specified by:
getZ in interface Position
Returns:
the z-value of this point, if dimension is 2, this value will be Double.NaN

getAsArray

public double[] getAsArray()
Description copied from interface: Position
NOTE: The returned array always has a length of 3, regardless of the dimension. This is due to a limitation in the coordinate transformation package (proj4), which expects coordinates to have 3 dimensions.

Specified by:
getAsArray in interface Position
Returns:
the position as a array the first field contains the x- the second field the y-value etc. NOTE: The returned array always has a length of 3, regardless of the dimension. This is due to a limitation in the coordinate transformation package (proj4), which expects coordinates to have 3 dimensions.

translate

public void translate(double[] d)
translate the point by the submitted values.

Specified by:
translate in interface Position
Parameters:
d -

equals

public boolean equals(Object other)
Overrides:
equals in class Object

getAccuracy

public double getAccuracy()
Description copied from interface: Position
returns the accuracy the position is defined. The accuracy is measured in values of the CRS the positions coordinates are stored

Specified by:
getAccuracy in interface Position
Returns:
the accuracy the position is defined. The accuracy is measured in values of the CRS the positions coordinates are stored

setAccuracy

public void setAccuracy(double accuracy)
Specified by:
setAccuracy in interface Position
Parameters:
accuracy -
See Also:
Position.getAccuracy()

toString

public String toString()
Overrides:
toString in class Object

getAsPoint3d

public final javax.vecmath.Point3d getAsPoint3d()
Specified by:
getAsPoint3d in interface Position
Returns:
the position as a point3d

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org