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

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  GeoJSONReader reader = new GeoJSONReader();
15  Geometry geom = reader.read(input);
16  return geom;
17  }

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

20  {
21  return POSTGIS.st_geomFromGeoJSON.toString();
22  }