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

Public Member Functions

Geometry construct (String input)
 
String getURI ()
 
Value evaluate (ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException
 

Member Function Documentation

◆ construct()

Geometry construct ( String  input)
13  {
14  WKBReader reader=new WKBReader();
15  Geometry geom=null;
16  try {
17  geom = reader.read(input.getBytes());
18  } catch (ParseException e) {
19  // TODO Auto-generated catch block
20  e.printStackTrace();
21  }
22  return geom;
23  }

◆ evaluate()

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

References GeometricConstructor.construct(), and LiteralRegistry.getLiteral().

16  {
17  if (args.length != 1) {
18  throw new ValueExprEvaluationException(getURI() + " requires exactly 1 arguments, got " + args.length);
19  }
20  LiteralType l=LiteralRegistry.getLiteral(((Literal)args[0]).getDatatype().toString());
21  String geomString = args[0].stringValue();
22  Geometry result = construct(geomString);
23  return valueFactory.createLiteral(((VectorLiteral) l).unparse(result),((Literal)args[0]).getDatatype());
24  }

◆ getURI()

String getURI ( )

References POSTGIS.st_geomFromWKB.

26  {
27  return POSTGIS.st_geomFromWKB.stringValue();
28  }