org.geotools.algorithms
Class RobustGeometryProperties

java.lang.Object
  extended byorg.geotools.algorithms.RobustGeometryProperties
All Implemented Interfaces:
GeometryProperties

public class RobustGeometryProperties
extends java.lang.Object
implements GeometryProperties

Robust implementation of the GeometryProperties interface.

Version:
$Id: RobustGeometryProperties.java,v 1.8 2004/02/24 10:50:37 aaime Exp $
Author:
Andy Turner, CCG
Task:
TODO: Update comments

Constructor Summary
RobustGeometryProperties()
           
 
Method Summary
 double getArea(com.vividsolutions.jts.geom.Geometry geometry)
          Calculates and returns the area of the specified geometry.
protected  double getArea(com.vividsolutions.jts.geom.GeometryCollection geometryCollection1)
          Returns the area of a GeometryCollection.
protected  double getArea(com.vividsolutions.jts.geom.MultiPolygon multiPolygon)
          Returns the area of a MultiPolygon.
protected  double getArea(com.vividsolutions.jts.geom.Polygon polygon)
          Returns the area of a Polygon.
 double getPerimeter(com.vividsolutions.jts.geom.Geometry geometry)
          Calculates and returns the perimeter of the specified geometry.
protected  double getPerimeter(com.vividsolutions.jts.geom.GeometryCollection geometryCollection)
          Returns.
protected  double getPerimeter(com.vividsolutions.jts.geom.LineString lineString)
          Returns the perimeter of a LineString.
protected  double getPerimeter(com.vividsolutions.jts.geom.MultiLineString multiLineString)
          Returns the perimeter of a MultiLineString.
protected  double getperimeter(com.vividsolutions.jts.geom.MultiPolygon multiPolygon)
          Returns the perimeter of a MultiPolygon.
protected  double getPerimeter(com.vividsolutions.jts.geom.Polygon polygon)
          Returns the perimeter of a Polygon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RobustGeometryProperties

public RobustGeometryProperties()
Method Detail

getArea

protected double getArea(com.vividsolutions.jts.geom.GeometryCollection geometryCollection1)
Returns the area of a GeometryCollection.

Parameters:
geometryCollection1 - The GeometryCollection for which the area is calulated.
Returns:
The total area of all geometries in the collection.

getPerimeter

protected double getPerimeter(com.vividsolutions.jts.geom.GeometryCollection geometryCollection)
Returns.

Parameters:
geometryCollection - The GeometryCollection for which the perimeter is calulated.
Returns:
the perimeter of a GeometryCollection.

getArea

public double getArea(com.vividsolutions.jts.geom.Geometry geometry)
Calculates and returns the area of the specified geometry.
For Polygons, this is the total area inside the external ring less the total of any contained by interior rings. GeometryCollections (including MultiPolygons) are iterated through so the result is the sum of all polygons anywhere within the collection. Any geometry other than Polgyon or a collection returns 0;

Specified by:
getArea in interface GeometryProperties
Parameters:
geometry - The Geometry to calculate the area of.
Returns:
The total area of the Geometry.

getPerimeter

public double getPerimeter(com.vividsolutions.jts.geom.Geometry geometry)
Calculates and returns the perimeter of the specified geometry.
For Polygons, this is the total length of the exterior ring and all internal rings. For LineStrings the total line length is returned. GeometryCollections are iterated through so the result is the sum of all Polygon and Line geometries anywhere within the collection. Any point geometries return a value of 0;

Specified by:
getPerimeter in interface GeometryProperties
Parameters:
geometry - The Geometry to calculate the area of.
Returns:
The total area of the Geometry.

getArea

protected double getArea(com.vividsolutions.jts.geom.MultiPolygon multiPolygon)
Returns the area of a MultiPolygon.

Parameters:
multiPolygon - the MultiPolygon for which the area is calculated.
Returns:
Total area of all polygons in multiPolygon.

getperimeter

protected double getperimeter(com.vividsolutions.jts.geom.MultiPolygon multiPolygon)
Returns the perimeter of a MultiPolygon.

Parameters:
multiPolygon - the MultiPolygon for which the perimeter is calculated.
Returns:
Total perimeter of all polygons in the multiPolygon.

getArea

protected double getArea(com.vividsolutions.jts.geom.Polygon polygon)
Returns the area of a Polygon.

Parameters:
polygon - the Polygon for which the area is calculated.
Returns:
The area of the polygon.

getPerimeter

protected double getPerimeter(com.vividsolutions.jts.geom.Polygon polygon)
Returns the perimeter of a Polygon.

Parameters:
polygon - the Polygon for which the perimeter is calculated.
Returns:
The perimeter of the polygon.

getPerimeter

protected double getPerimeter(com.vividsolutions.jts.geom.MultiLineString multiLineString)
Returns the perimeter of a MultiLineString.

Parameters:
multiLineString - the MultiLineString for which the perimeter is calculated.
Returns:
the total perimter (length) of the lines in multiLineString.

getPerimeter

protected double getPerimeter(com.vividsolutions.jts.geom.LineString lineString)
Returns the perimeter of a LineString.

Parameters:
lineString - the LineString for which the perimeter is calculated.
Returns:
the perimeter (length) of the lineString.


Copyright © GeoTools. All Rights Reserved.