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

Public Member Functions

Value evaluate (ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException
 
abstract GridCoverage modify (GridCoverage coverage, Integer band, Double constt)
 

Member Function Documentation

◆ evaluate()

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

References LiteralRegistry.getLiteral(), and RasterAlgebraConstFunction.modify().

Referenced by AddConstTest.testAddConst(), AndConstTest.testAndConst(), DivConstTest.testDivConst(), MultConstTest.testMultConst(), OrConstTest.testOrConst(), SubtractConstTest.testSubtractConst(), and XorConstTest.testXorConst().

◆ modify()

abstract GridCoverage modify ( GridCoverage  coverage,
Integer  band,
Double  constt 
)
abstract