Package org.geotools.filter
Class AreaFunction
Object
ExpressionAbstract
DefaultExpression
FunctionExpressionImpl
AreaFunction
- All Implemented Interfaces:
Expression
,Function
,FunctionExpression
,Factory
Area of provided geometry.
- Author:
- James
-
Field Summary
FieldsFields inherited from class FunctionExpressionImpl
fallback, functionName, name, params
Fields inherited from interface Expression
NIL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSubclass should override, default implementation returns null.double
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.protected double
getArea
(GeometryCollection geometryCollection1) Returns the area of a GeometryCollection.protected double
getArea
(MultiPolygon multiPolygon) Returns the area of a MultiPolygon.protected double
Returns the area of a Polygon.protected double
getperimeter
(MultiPolygon multiPolygon) Returns the perimeter of a MultiPolygon.double
getPerimeter
(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.protected double
getPerimeter
(GeometryCollection geometryCollection) Returns.protected double
getPerimeter
(LineString lineString) Returns the perimeter of a LineString.protected double
getPerimeter
(MultiLineString multiLineString) Returns the perimeter of a MultiLineString.protected double
getPerimeter
(Polygon polygon) Returns the perimeter of a Polygon.Methods inherited from class FunctionExpressionImpl
accept, equals, functionName, getExpression, getFallbackValue, getFunctionName, getImplementationHints, getName, getParameters, hashCode, setFallbackValue, setParameters, toString
Methods inherited from class DefaultExpression
isAttributeExpression, isExpression, isFunctionExpression, isGeometryExpression, isLiteralExpression, isMathExpression
Methods inherited from class ExpressionAbstract
evaluate
Methods inherited from interface Expression
evaluate
-
Field Details
-
NAME
-
-
Constructor Details
-
AreaFunction
public AreaFunction()Creates a new instance of AreaFunction
-
-
Method Details
-
evaluate
Description copied from class:ExpressionAbstract
Subclass should override, default implementation returns null.- Specified by:
evaluate
in interfaceExpression
- Overrides:
evaluate
in classFunctionExpressionImpl
- Returns:
- default implementation returns null
-
getArea
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
Returns.- Parameters:
geometryCollection
- The GeometryCollection for which the perimeter is calulated.- Returns:
- the perimeter of a GeometryCollection.
-
getArea
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:
geometry
- The Geometry to calculate the area of.- Returns:
- The total area of the Geometry.
-
getPerimeter
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:
geometry
- The Geometry to calculate the area of.- Returns:
- The total area of the Geometry.
-
getArea
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
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
Returns the area of a Polygon.- Parameters:
polygon
- the Polygon for which the area is calculated.- Returns:
- The area of the polygon.
-
getPerimeter
Returns the perimeter of a Polygon.- Parameters:
polygon
- the Polygon for which the perimeter is calculated.- Returns:
- The perimeter of the polygon.
-
getPerimeter
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
Returns the perimeter of a LineString.- Parameters:
lineString
- the LineString for which the perimeter is calculated.- Returns:
- the perimeter (length) of the lineString.
-