deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.model.spatialschema
Class PositionImpl

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

public class PositionImpl
extends java.lang.Object
implements Position, java.io.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: 25061 $ $Date: 2010-06-24 15:44:25 +0200 (Do, 24 Jun 2010) $
Author:
Andreas Poth, last edited by: $Author: apoth $
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
 java.lang.Object clone()
           
 boolean equals(java.lang.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)
           
 java.lang.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 java.lang.Object clone()
Overrides:
clone in class java.lang.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(java.lang.Object other)
Overrides:
equals in class java.lang.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 java.lang.String toString()
Overrides:
toString in class java.lang.Object

getAsPoint3d

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

deegree 2.5 (2011/06/29 09:44 build-8-official)

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