org.deegree.geometry.standard.primitive
Class DefaultPoint

java.lang.Object
  extended by org.deegree.geometry.standard.AbstractDefaultGeometry
      extended by org.deegree.geometry.standard.primitive.DefaultPoint
All Implemented Interfaces:
GMLObject, Object, TypedObjectNode, Geometry, GeometricPrimitive, Point

public class DefaultPoint
extends AbstractDefaultGeometry
implements Point

Default implementation of Point.

Version:
$Revision: 31649 $, $Date: 2011-08-25 01:03:49 +0200 (Thu, 25 Aug 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.deegree.geometry.primitive.GeometricPrimitive
GeometricPrimitive.PrimitiveType
 
Nested classes/interfaces inherited from interface org.deegree.geometry.Geometry
Geometry.GeometryType
 
Field Summary
 
Fields inherited from class org.deegree.geometry.standard.AbstractDefaultGeometry
crs, env, id, jtsFactory, jtsGeometry, pm
 
Constructor Summary
DefaultPoint(String id, ICRS crs, PrecisionModel pm, double[] coordinates)
          Creates a new DefaultPoint instance from the given parameters.
 
Method Summary
protected  com.vividsolutions.jts.geom.Point buildJTSGeometry()
           
 boolean equals(Geometry geometry)
          Tests whether this geometry is equal to the specified geometry.
 double get(int dimension)
          Returns the value of the specified ordinate.
 double get0()
          Returns the value of the first ordinate.
 double get1()
          Returns the value of the second ordinate.
 double get2()
          Returns the value of the third ordinate.
 double[] getAsArray()
          Returns all ordinates.
 int getCoordinateDimension()
          Returns the coordinate dimension, i.e. the dimension of the space that the geometry is embedded in.
 Envelope getEnvelope()
          Returns the minimal bounding box of the geometry.
 Geometry.GeometryType getGeometryType()
          Must always return Geometry.GeometryType#PRIMITIVE_GEOMETRY.
 GeometricPrimitive.PrimitiveType getPrimitiveType()
          Must always return GeometricPrimitive.PrimitiveType.Point.
 boolean isSFSCompliant()
          Returns whether this geometry complies with the Simple Feature Specification (SFS).
 String toString()
           
 
Methods inherited from class org.deegree.geometry.standard.AbstractDefaultGeometry
contains, createFromJTS, crosses, getAsDefaultGeometry, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getDifference, getDistance, getGMLProperties, getId, getIntersection, getJTSGeometry, getPrecision, getUnion, intersects, isBeyond, isDisjoint, isWithin, isWithinDistance, overlaps, setCoordinateSystem, setGMLProperties, setId, setPrecision, touches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.geometry.Geometry
contains, crosses, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getDifference, getDistance, getId, getIntersection, getPrecision, getUnion, intersects, isBeyond, isDisjoint, isWithin, isWithinDistance, overlaps, setCoordinateSystem, setGMLProperties, setId, setPrecision, touches
 
Methods inherited from interface org.deegree.commons.tom.gml.GMLObject
getGMLProperties
 

Constructor Detail

DefaultPoint

public DefaultPoint(String id,
                    ICRS crs,
                    PrecisionModel pm,
                    double[] coordinates)
Creates a new DefaultPoint instance from the given parameters.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
pm - precision model, may be null
coordinates - coordinates of the point
Method Detail

getGeometryType

public Geometry.GeometryType getGeometryType()
Description copied from interface: GeometricPrimitive
Must always return Geometry.GeometryType#PRIMITIVE_GEOMETRY.

Specified by:
getGeometryType in interface Geometry
Specified by:
getGeometryType in interface GeometricPrimitive
Returns:
must always return Geometry.GeometryType#PRIMITIVE_GEOMETRY

getPrimitiveType

public GeometricPrimitive.PrimitiveType getPrimitiveType()
Description copied from interface: Point
Must always return GeometricPrimitive.PrimitiveType.Point.

Specified by:
getPrimitiveType in interface GeometricPrimitive
Specified by:
getPrimitiveType in interface Point
Returns:
GeometricPrimitive.PrimitiveType.Point

get

public double get(int dimension)
Description copied from interface: Point
Returns the value of the specified ordinate.

Specified by:
get in interface Point
Parameters:
dimension - ordinate to be returned (first dimension=0)
Returns:
ordinate value of the passed dimension, or Double.NAN if dimension is greater than the number of actual dimensions

getAsArray

public double[] getAsArray()
Description copied from interface: Point
Returns all ordinates.

Specified by:
getAsArray in interface Point
Returns:
all ordinates, the length of the array is equal to the number of dimensions

get0

public double get0()
Description copied from interface: Point
Returns the value of the first ordinate.

Specified by:
get0 in interface Point
Returns:
value of the first ordinate

get1

public double get1()
Description copied from interface: Point
Returns the value of the second ordinate.

Specified by:
get1 in interface Point
Returns:
value of the second ordinate, or Double.NAN if the point only has one dimension

get2

public double get2()
Description copied from interface: Point
Returns the value of the third ordinate.

Specified by:
get2 in interface Point
Returns:
value of the third ordinate, or Double.NAN if the point only has one or two dimensions

equals

public boolean equals(Geometry geometry)
Description copied from interface: Geometry
Tests whether this geometry is equal to the specified geometry. TODO formal explanation (DE9IM)

Specified by:
equals in interface Geometry
Overrides:
equals in class AbstractDefaultGeometry
Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry is equal to geometry

getCoordinateDimension

public int getCoordinateDimension()
Description copied from interface: Geometry
Returns the coordinate dimension, i.e. the dimension of the space that the geometry is embedded in.

Specified by:
getCoordinateDimension in interface Geometry
Returns:
the coordinate dimension

getEnvelope

public Envelope getEnvelope()
Description copied from interface: Geometry
Returns the minimal bounding box of the geometry.

Specified by:
getEnvelope in interface Geometry
Overrides:
getEnvelope in class AbstractDefaultGeometry
Returns:
the minimal bounding box of the geometry

isSFSCompliant

public boolean isSFSCompliant()
Description copied from interface: Geometry
Returns whether this geometry complies with the Simple Feature Specification (SFS).

Specified by:
isSFSCompliant in interface Geometry
Overrides:
isSFSCompliant in class AbstractDefaultGeometry
Returns:
true, if this geometry complies with the SFS, false otherwise

toString

public String toString()
Overrides:
toString in class AbstractDefaultGeometry

buildJTSGeometry

protected com.vividsolutions.jts.geom.Point buildJTSGeometry()
Overrides:
buildJTSGeometry in class AbstractDefaultGeometry


Copyright © 2011. All Rights Reserved.