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

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)
18  {
19  try {
20  return CRS.isHorizontalCRS(CRS.forCode("ESPG:"+geom.getSRID()));
21  } catch (FactoryException e) {
22  // TODO Auto-generated catch block
23  e.printStackTrace();
24  }
25  return false;
26  }

◆ 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_hasHorizontalCRS.

12  {
13  // TODO Auto-generated method stub
14  return POSTGIS.ST_hasHorizontalCRS.stringValue();
15  }