deegree 2.2 (2008/12/22 11:33 build-3038-official)

org.deegree.model.spatialschema
Class PositionImpl

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

 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: 9343 $ $Date: 2007-12-27 14:30:32 +0100 (Do, 27 Dez 2007) $
Author:
Andreas Poth, last edited by: $Author: apoth $

Constructor Summary
PositionImpl()
          constructor. initializes a point to the coordinate 0/0
PositionImpl(double[] coords)
          constructor.
PositionImpl(double x, double y)
          constructor
PositionImpl(double x, double y, double z)
          constructor
 
Method Summary
 Object clone()
           
 boolean equals(Object other)
          compares if all field of other are equal to the corresponding fields of this position
 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.
 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. the dz- value will be ignored.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PositionImpl

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


PositionImpl

PositionImpl(double x,
             double y)
constructor

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

PositionImpl

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

PositionImpl(double[] coords)
constructor.

Parameters:
coords - the Coordinates from which the position is build.
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.

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. the dz- value will be ignored.

Specified by:
translate in interface Position
Parameters:
d -

equals

public boolean equals(Object other)
compares if all field of other are equal to the corresponding fields of this position

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:
getAccuracy()

toString

public String toString()
Overrides:
toString in class Object

deegree 2.2 (2008/12/22 11:33 build-3038-official)

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