org.geotools.geometry
Class Geometry

java.lang.Object
  extended byorg.geotools.geometry.Geometry
All Implemented Interfaces:
org.opengis.spatialschema.geometry.Geometry, java.io.Serializable, org.opengis.spatialschema.geometry.TransfiniteSet

public abstract class Geometry
extends java.lang.Object
implements org.opengis.spatialschema.geometry.Geometry, java.io.Serializable

Root class of the Geotools default implementation of geometric object. instances are sets of direct positions in a particular coordinate reference system.

Since:
2.0
Version:
$Id: Geometry.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
Serialized Form

Field Summary
protected  org.opengis.referencing.crs.CoordinateReferenceSystem crs
          The coordinate reference system used in direct position coordinates.
 
Constructor Summary
Geometry(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
          Constructs a geometry with the specified coordinate reference system.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this geometry with deep copy semantic.
 int getCoordinateDimension()
          Returns the dimension of the coordinates that define this , which must be the same as the coordinate dimension of the coordinate reference system for this .
 org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
          Returns the coordinate reference system used in direct position coordinates.
 org.opengis.spatialschema.geometry.Geometry transform(org.opengis.referencing.crs.CoordinateReferenceSystem newCRS)
          Returns a new that is the coordinate transformation of this into the passed coordinate reference system within the accuracy of the transformation.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opengis.spatialschema.geometry.Geometry
getBoundary, getBuffer, getCentroid, getClosure, getConvexHull, getDimension, getDistance, getEnvelope, getMaximalComplex, getMbRegion, getRepresentativePoint, isCycle, isMutable, isSimple, toImmutable, transform
 
Methods inherited from interface org.opengis.spatialschema.geometry.TransfiniteSet
contains, contains, difference, equals, intersection, intersects, symmetricDifference, union
 

Field Detail

crs

protected final org.opengis.referencing.crs.CoordinateReferenceSystem crs
The coordinate reference system used in direct position coordinates.

Constructor Detail

Geometry

public Geometry(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Constructs a geometry with the specified coordinate reference system.

Parameters:
crs - The coordinate reference system used in direct position coordinates.
Method Detail

getCoordinateReferenceSystem

public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
Returns the coordinate reference system used in direct position coordinates.

Specified by:
getCoordinateReferenceSystem in interface org.opengis.spatialschema.geometry.Geometry
Returns:
The coordinate reference system used in direct position coordinates.
See Also:
getCoordinateDimension()

getCoordinateDimension

public int getCoordinateDimension()
Returns the dimension of the coordinates that define this , which must be the same as the coordinate dimension of the coordinate reference system for this .

Specified by:
getCoordinateDimension in interface org.opengis.spatialschema.geometry.Geometry
Returns:
The coordinate dimension.
See Also:
Geometry.getDimension(org.opengis.spatialschema.geometry.DirectPosition), getCoordinateReferenceSystem()

transform

public org.opengis.spatialschema.geometry.Geometry transform(org.opengis.referencing.crs.CoordinateReferenceSystem newCRS)
                                                      throws org.opengis.referencing.operation.TransformException
Returns a new that is the coordinate transformation of this into the passed coordinate reference system within the accuracy of the transformation.

Specified by:
transform in interface org.opengis.spatialschema.geometry.Geometry
Parameters:
newCRS - The new coordinate reference system.
Returns:
The transformed .
Throws:
org.opengis.referencing.operation.TransformException - if the transformation failed.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a clone of this geometry with deep copy semantic. Any change on this object will have no impact on the returned clone, and conversely. For big geometries, implementations are encouraged to share as much internal data as possible (as opposed to performing a real copy of the data), while preserving the deep copy semantic.

The default implementation throws CloneNotSupportedException. If subclasses implements Cloneable, then they should overrides this method.

Specified by:
clone in interface org.opengis.spatialschema.geometry.Geometry
Throws:
java.lang.CloneNotSupportedException - if this object do not support clone. This exception is never throws if this object implements Cloneable.


Copyright © GeoTools. All Rights Reserved.