rdf4j-postgis  Version 0.1.0.0
GeomCollFromText Class Reference

Returns a geometry collection from a WKT String. More...

Inheritance diagram for GeomCollFromText:
Collaboration diagram for GeomCollFromText:

Public Member Functions

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

Detailed Description

Returns a geometry collection from a WKT String.

Member Function Documentation

◆ construct()

Geometry construct ( String  input)

Reimplemented from GeometricConstructor.

20  {
21  GeoHash hash=GeoHash.fromGeohashString(input);
22  Coordinate coord=new Coordinate(hash.getOriginatingPoint().getLatitude(), hash.getOriginatingPoint().getLongitude());
23  List<Coordinate> coords=new LinkedList<Coordinate>();
24  coords.add(coord);
25  return LiteralUtils.createGeometry(coords, "Point", 4326);
26  }

References LiteralUtils.createGeometry().

◆ evaluate()

Value evaluate ( ValueFactory  valueFactory,
Value...  args 
) throws ValueExprEvaluationException
inherited
17  {
18  if (args.length != 1) {
19  throw new ValueExprEvaluationException(getURI() + " requires exactly 1 arguments, got " + args.length);
20  }
21  String geomString = args[0].stringValue();
22  Geometry result = construct(geomString);
23  return valueFactory.createLiteral(WKTDatatype.INSTANCE.unparse(result), WKTDatatype.LiteralIRI);
24  }

References GeometricConstructor.construct(), WKTDatatype.INSTANCE, WKTDatatype.LiteralIRI, and WKTDatatype.unparse().

Referenced by GeomFromGeoJSONTest.testGeomFromGeoJSON(), GeomFromTextTest.testGeomFromText(), GeomFromWKBTest.testGeomFromWKB(), MakeLineTest.testMakeLine1(), MakePointTest.testMakePoint1(), MakePointTest.testMakePointXYZ(), PointFromTextTest.testPointFromText(), and PolygonFromTextTest.testPolygonFromText().

◆ getURI()

String getURI ( )
29  {
30  return POSTGIS.st_geomCollFromText.stringValue();
31  }

References POSTGIS.st_geomCollFromText.