A GeoScript Function either wraps an existing GeoTools Function or an CQL String.
You can create a Function from CQL:
Function f = new Function("centroid(the_geom)")
You can also create a Function from CQL and a Closure:
See GeoServer's Function Reference for more details.Function f = new Function("my_centroid(the_geom)", {g-> g.centroid})
Fields inherited from class | Fields |
---|---|
interface org.opengis.filter.expression.Expression |
NIL |
Type | Name and description |
---|---|
org.opengis.filter.expression.Function |
function The GeoTools Function |
Constructor and description |
---|
Function
(org.opengis.filter.expression.Function f) Create a Function from a GeoTools Function |
Function
(java.lang.String str) Create a new Function from a CQL compatible string |
Function
(java.lang.String name, Expression... expressions) Create a new Function from a name and one or more Expressions |
Function
(java.lang.String name, groovy.lang.Closure closure, Expression... expressions) Create a new Function from a Closure with one or more Expressions. |
Function
(java.lang.String cql, groovy.lang.Closure closure) Create a new Function from CQL and a Closure. |
Function
(Process process, Function... functions) Create a Rendering Transformation Function from a Process and a variable List of Functions. |
Type | Name and description |
---|---|
static java.util.List<java.lang.String> |
getFunctionNames() Get a List of all Function names |
static void |
registerFunction(java.lang.String name, groovy.lang.Closure closure) Register a new Function by name with a Closure. |
java.lang.String |
toString() The string presentation |
Methods inherited from class | Name |
---|---|
interface org.opengis.filter.expression.Expression |
org.opengis.filter.expression.Expression#accept(org.opengis.filter.expression.ExpressionVisitor, java.lang.Object), org.opengis.filter.expression.Expression#evaluate(java.lang.Object, java.lang.Class), org.opengis.filter.expression.Expression#evaluate(java.lang.Object) |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Create a Function from a GeoTools Function
f
- The GeoTools FunctionCreate a new Function from a CQL compatible string
str
- A CQL StringCreate a new Function from a name and one or more Expressions
name
- The Function nameexpressions
- One or more ExpressionsCreate a new Function from a Closure with one or more Expressions.
name
- The name of the new Functionclosure
- The Closureexpressions
- One or more ExpressionsCreate a new Function from CQL and a Closure.
cql
- The CQL statementclosure
- The ClosureGet a List of all Function names
Register a new Function by name with a Closure.
name
- The name of the new Functionclosure
- The ClosureThe string presentation
Groovy Documentation