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

Public Member Functions

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

Member Function Documentation

◆ attribute()

boolean attribute ( Geometry  geom)
17  {
18  Boolean is3D=true;
19  for(Coordinate coord:geom.getCoordinates()) {
20  if(Double.isNaN(coord.getZ())) {
21  is3D=false;
22  }
23  }
24  return is3D;
25  }

◆ evaluate()

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

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

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

◆ getURI()

String getURI ( )

References POSTGIS.st_is3D.

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