kiwi-postgis  Version 0.1.0.0
IsPointInRing Class Reference
Inheritance diagram for IsPointInRing:
Collaboration diagram for IsPointInRing:

Public Member Functions

boolean relation (Geometry ringgeom, Geometry pointgeom)
 
String getURI ()
 
Value evaluate (ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException
 

Member Function Documentation

◆ evaluate()

Value evaluate ( ValueFactory  valueFactory,
Value...  args 
) throws ValueExprEvaluationException
inherited

References LiteralRegistry.getLiteral(), and GeometricRelationBinaryFunction.relation().

16  {
17  if (args.length != 2) {
18  throw new ValueExprEvaluationException(getURI() + " requires exactly 2 arguments, got " + args.length);
19  }
20  LiteralType l=LiteralRegistry.getLiteral(((Literal)args[0]).getDatatype().toString());
21  LiteralType l2=LiteralRegistry.getLiteral(((Literal)args[1]).getDatatype().toString());
22  if(l instanceof VectorLiteral && l2 instanceof VectorLiteral) {
23  Geometry geom=((VectorLiteral)l).read(args[0].stringValue());
24  Geometry geom2=((VectorLiteral)l2).read(args[1].stringValue());
25  boolean result = relation(geom,geom2);
26  return valueFactory.createLiteral(result);
27  }
28  throw new ValueExprEvaluationException("Arguments given are not a geometry literal");
29 
30  }

◆ getURI()

String getURI ( )

References POSTGIS.st_isPointInRing.

18  {
19  return POSTGIS.st_isPointInRing.stringValue();
20  }

◆ relation()

boolean relation ( Geometry  ringgeom,
Geometry  pointgeom 
)
12  {
13  CGAlgorithms algos=new CGAlgorithms();
14  return algos.isPointInRing(pointgeom.getCoordinate(), ringgeom.getCoordinates());
15  }