kiwi-postgis  Version 0.1.0.0
YMax Class Reference
Inheritance diagram for YMax:
Collaboration diagram for YMax:

Public Member Functions

String getURI ()
 
double attribute (Geometry geom)
 
Value evaluate (ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException
 

Member Function Documentation

◆ attribute()

double attribute ( Geometry  geom)
17  {
18  Geometry geo=geom;
19  Double maxY=0.;
20  for(Coordinate coord:geo.getCoordinates()) {
21  if(maxY<coord.getY()) {
22  maxY=coord.getY();
23  }
24  }
25  return maxY;
26  }

◆ evaluate()

Value evaluate ( ValueFactory  valueFactory,
Value...  args 
) throws ValueExprEvaluationException
inherited

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

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

◆ getURI()

String getURI ( )

References POSTGIS.st_yMax.

12  {
13  return POSTGIS.st_yMax.stringValue();
14  }