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

Public Member Functions

Value evaluate (ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException
 
abstract Double attribute (GridCoverage geom, Integer noband, Integer x, Integer y, Boolean excludenodata)
 

Member Function Documentation

◆ attribute()

abstract Double attribute ( GridCoverage  geom,
Integer  noband,
Integer  x,
Integer  y,
Boolean  excludenodata 
)
abstract

◆ evaluate()

Value evaluate ( ValueFactory  valueFactory,
Value...  args 
) throws ValueExprEvaluationException
17  {
18  if (args.length != 3) {
19  throw new ValueExprEvaluationException(getURI() + " requires exactly 4 arguments, got " + args.length);
20  }
21  LiteralType l=LiteralRegistry.getLiteral(((Literal)args[0]).getDatatype().toString());
22  if(l instanceof RasterLiteral) {
23  GridCoverage geom=((RasterLiteral)l).read(args[0].stringValue());
24  Integer noband = Integer.valueOf(args[1].stringValue());
25  Integer x = Integer.valueOf(args[2].stringValue());
26  Integer y = Integer.valueOf(args[2].stringValue());
27  Boolean excludenodata = Boolean.valueOf(args[3].stringValue());
28  Double result = attribute(geom,noband,x,y,excludenodata);
29  return valueFactory.createLiteral(result);
30  }
31  return null;
32  }
abstract Double attribute(GridCoverage geom, Integer noband, Integer x, Integer y, Boolean excludenodata)

References RasterAttributeIntIntIntStringFunction.attribute(), and LiteralRegistry.getLiteral().