svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.expressionevaluator / org.gvsig.expressionevaluator.lib / org.gvsig.expressionevaluator.lib.impl / src / main / java / org / gvsig / expressionevaluator / impl / function / spatial / STCentroidFunction.java @ 44006
History | View | Annotate | Download (584 Bytes)
1 |
package org.gvsig.expressionevaluator.impl.function.spatial; |
---|---|
2 |
|
3 |
import org.apache.commons.lang3.Range; |
4 |
import org.gvsig.expressionevaluator.Interpreter; |
5 |
import org.gvsig.expressionevaluator.spi.AbstractFunction; |
6 |
import org.gvsig.fmap.geom.primitive.Point; |
7 |
|
8 |
public class STCentroidFunction extends AbstractFunction { |
9 |
|
10 |
public STCentroidFunction() {
|
11 |
super("OGC", "ST_Centroid", Range.is(1)); |
12 |
} |
13 |
|
14 |
@Override
|
15 |
public Object call(Interpreter interpreter, Object[] args) throws Exception { |
16 |
Point r = getGeom(args, 0).centroid(); |
17 |
return r;
|
18 |
} |
19 |
|
20 |
} |