org.geotools.renderer.geom
Class JTSGeometries

java.lang.Object
  extended byorg.geotools.renderer.geom.Geometry
      extended byorg.geotools.renderer.geom.GeometryCollection
          extended byorg.geotools.renderer.geom.JTSGeometries
All Implemented Interfaces:
java.lang.Cloneable, org.opengis.util.Cloneable, java.lang.Comparable, java.io.Serializable, java.awt.Shape

public class JTSGeometries
extends GeometryCollection

A geometry collection backed by one or many JTS Geometry objects.

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

Field Summary
 
Fields inherited from class org.geotools.renderer.geom.Geometry
DEFAULT_COORDINATE_SYSTEM
 
Constructor Summary
JTSGeometries()
          Construct an initially empty collection using the default coordinate system.
JTSGeometries(CoordinateSystem cs)
          Construct an initialy empty collection.
JTSGeometries(com.vividsolutions.jts.geom.Geometry geometry)
          Construct a collection for the specified geometry.
 
Method Summary
 Geometry add(com.vividsolutions.jts.geom.Geometry geometry)
          Add the specified geometry to this collection.
 
Methods inherited from class org.geotools.renderer.geom.GeometryCollection
add, add, add, assemble, assemble, clip, clone, compareTo, compress, contains, contains, contains, contains, equals, getBounds2D, getCoordinateSystem, getGeometries, getGeometries, getGeometriesContaining, getGeometriesIntersecting, getName, getPathIterator, getPointCount, getPolygonName, getRenderingResolution, getResolution, getValue, hashCode, intersects, intersects, isEmpty, readObject, remove, removeAll, setCoordinateSystem, setRenderingResolution, setResolution, setValue, setValue, writeObject
 
Methods inherited from class org.geotools.renderer.geom.Geometry
contains, getBounds, getID, getPathIterator, getStyle, getUserObject, intersects, setID, setStyle, setUserObject, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JTSGeometries

public JTSGeometries()
Construct an initially empty collection using the default coordinate system. Geometries can be added using add(com.vividsolutions.jts.geom.Geometry) method.


JTSGeometries

public JTSGeometries(CoordinateSystem cs)
Construct an initialy empty collection. Geometries can be added using add(com.vividsolutions.jts.geom.Geometry) method.

Parameters:
cs - The coordinate system to use for all points in this geometry, or null if unknow.

JTSGeometries

public JTSGeometries(com.vividsolutions.jts.geom.Geometry geometry)
Construct a collection for the specified geometry. The value is computed from the mean value of all Coordinate.z in the specified geometry.

Parameters:
geometry - The geometry to wrap, or null if none.
Task:
TODO: The coordinate system currently default to PROMISCUOUS. We should find it from the SRID code.
Method Detail

add

public Geometry add(com.vividsolutions.jts.geom.Geometry geometry)
             throws org.opengis.referencing.operation.TransformException,
                    java.lang.IllegalArgumentException
Add the specified geometry to this collection. The geometry must be one of the following classes: Point, LineString, Polygon or GeometryCollection.

Parameters:
geometry - The geometry to add.
Returns:
The geometry as a Geometry wrapper. The style can be set using add(geometry).setStyle(style).
Throws:
org.opengis.referencing.operation.TransformException - if the specified geometry can't be transformed in this collection's coordinate system.
java.lang.IllegalArgumentException - if the geometry is not a a valid class.


Copyright © GeoTools. All Rights Reserved.