org.geotools.algorithms
Interface GeometryProperties
- All Known Implementing Classes:
- RobustGeometryProperties
- public interface GeometryProperties
- Version:
- $Id: GeometryProperties.java,v 1.6 2004/02/24 10:50:37 aaime Exp $
- Author:
- James Macgill, CCG
Method Summary |
double |
getArea(com.vividsolutions.jts.geom.Geometry g)
Calculates and returns the area of the specified geometry. |
double |
getPerimeter(com.vividsolutions.jts.geom.Geometry g)
Calculates and returns the perimeter of the specified geometry. |
getArea
public double getArea(com.vividsolutions.jts.geom.Geometry g)
- 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;
- Parameters:
g
- The Geometry to calculate the area of.
- Returns:
- The total area of the Geometry.
getPerimeter
public double getPerimeter(com.vividsolutions.jts.geom.Geometry g)
- 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;
- Parameters:
g
- The Geometry to calculate the area of.
- Returns:
- The total area of the Geometry.
Copyright © GeoTools. All Rights Reserved.