rdf4j-postgis  Version 0.1.0.0
GeometricStringExportIntegerFunction Class Referenceabstract
Inheritance diagram for GeometricStringExportIntegerFunction:
Collaboration diagram for GeometricStringExportIntegerFunction:

Public Member Functions

Value evaluate (ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException
 
abstract String operation (Geometry geom, Integer value)
 

Member Function Documentation

◆ evaluate()

Value evaluate ( ValueFactory  valueFactory,
Value...  args 
) throws ValueExprEvaluationException
16  {
17  if (args.length != 2) {
18  throw new ValueExprEvaluationException(getURI() + " requires exactly 2 arguments, got " + args.length);
19  }
20 
21  LiteralType l=LiteralRegistry.getLiteral(((Literal)args[0]).getDatatype().toString());
22  Integer value=Integer.valueOf(args[1].stringValue());
23  if(l instanceof VectorLiteral) {
24  Geometry geom=((VectorLiteral)l).read(args[0].stringValue());
25  String result = operation(geom,value);
26  return valueFactory.createLiteral(result);
27  }
28  throw new ValueExprEvaluationException("Argument given is not a geometry literal");
29 
30  }

References LiteralRegistry.getLiteral(), and GeometricStringExportIntegerFunction.operation().

Referenced by AsTextRoundTest.testAsTextRound().

◆ operation()

abstract String operation ( Geometry  geom,
Integer  value 
)
abstract