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

Public Member Functions

Value evaluate (ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException
 
abstract Geometry construct (String input, Integer srid)
 

Member Function Documentation

◆ construct()

abstract Geometry construct ( String  input,
Integer  srid 
)
abstract

Reimplemented in Polygon.

Referenced by GeometricConstructorInteger.evaluate().

◆ evaluate()

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

References GeometricConstructorInteger.construct(), and LiteralRegistry.getLiteral().