rdf4j-postgis  Version 0.1.0.0
BandNoDataValue Class Reference
Inheritance diagram for BandNoDataValue:
Collaboration diagram for BandNoDataValue:

Public Member Functions

String getURI ()
 
Integer attribute (GridCoverage coverage, Integer bandno)
 
Value evaluate (ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException
 

Member Function Documentation

◆ attribute()

Integer attribute ( GridCoverage  coverage,
Integer  bandno 
)

Reimplemented from RasterAttributeIntIntFunction.

15  {
16  return coverage.getSampleDimensions().get(bandno).getNoDataValues().iterator().next().intValue();
17  }

◆ evaluate()

Value evaluate ( ValueFactory  valueFactory,
Value...  args 
) throws ValueExprEvaluationException
inherited
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  if(l instanceof RasterLiteral) {
22  GridCoverage geom=((RasterLiteral)l).read(args[0].stringValue());
23  Integer parameter = Integer.valueOf(args[1].stringValue());
24  Integer result = attribute(geom,parameter);
25  return valueFactory.createLiteral(result);
26  }
27  return null;
28 }

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

Referenced by BandTest.testBand(), and BandNoDataValueTest.testBandNoDataValue().

◆ getURI()

String getURI ( )
10  {
11  return POSTGIS.ST_BANDNODATAVALUE.stringValue();
12  }

References POSTGIS.ST_BANDNODATAVALUE.