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 / STStartPointFunction.java @ 43518
History | View | Annotate | Download (759 Bytes)
1 | 43512 | jjdelcerro | package org.gvsig.expressionevaluator.impl.function.spatial; |
---|---|---|---|
2 | |||
3 | import org.apache.commons.lang3.Range; |
||
4 | import org.gvsig.expressionevaluator.spi.AbstractFunction; |
||
5 | 43518 | jjdelcerro | import org.gvsig.fmap.geom.Geometry; |
6 | import org.gvsig.fmap.geom.primitive.OrientablePrimitive; |
||
7 | import org.gvsig.fmap.geom.primitive.Point; |
||
8 | 43512 | jjdelcerro | |
9 | 43518 | jjdelcerro | public class STStartPointFunction extends AbstractFunction { |
10 | 43512 | jjdelcerro | |
11 | 43518 | jjdelcerro | public STStartPointFunction() {
|
12 | super("OGC", "ST_StartPoint", Range.is(1)); |
||
13 | 43512 | jjdelcerro | } |
14 | |||
15 | @Override
|
||
16 | public Object call(Object[] args) throws Exception { |
||
17 | 43518 | jjdelcerro | Geometry geom = getGeom(args, 0);
|
18 | if ( geom instanceof OrientablePrimitive ) { |
||
19 | Point n = ((OrientablePrimitive) geom).getVertex(0); |
||
20 | return n;
|
||
21 | } |
||
22 | return null; |
||
23 | 43512 | jjdelcerro | } |
24 | |||
25 | } |