rdf4j-postgis  Version 0.1.0.0
Dump Class Reference
Inheritance diagram for Dump:
Collaboration diagram for Dump:

Public Member Functions

String getURI ()
 
String operation (org.locationtech.jts.geom.Geometry geom)
 
Value evaluate (ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException
 
abstract String operation (Geometry geom)
 

Member Function Documentation

◆ evaluate()

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

References LiteralRegistry.getLiteral(), and GeometricStringExportFunction.operation().

Referenced by AsBinaryTest.testAsBinary(), AsEncodedPolylineTest.testAsEncodedPolyline(), AsGARSTest.testAsGARS(), AsGeoJSONTest.testAsGeoJSON(), AsGeoRSSTest.testAsGeoRSS(), AsGeoURITest.testAsGeoURI(), AsLatLonTextTest.testAsLatLonText(), AsOSMLinkTest.testAsOSMLink(), AsPolyshapeTest.testAsPolyShape(), AsTextTest.testAsText(), AsTextRawTest.testAsTextRaw(), AsTextTest.testAsTextZ(), DumpTest.testDump(), GeomCRSToWKTTest.testGeomCRSToWKT(), GeometryTypeTest.testLineString(), SridGetAxis1OrientationTest.testSridAxis1Orientation(), SridGetAxis2OrientationTest.testSridAxis2Orientation(), SridGetAxis1NameTest.testSridGetAxis1Name(), SridGetAxis2NameTest.testSridGetAxis2Name(), and SridGetDatumTest.testSridGetDatum().

◆ getURI()

String getURI ( )
15  {
16  return POSTGIS.st_dump.stringValue();
17  }

References POSTGIS.st_dump.

◆ operation() [1/2]

◆ operation() [2/2]

String operation ( org.locationtech.jts.geom.Geometry  geom)
20  {
21  List<String> results = new ArrayList<>(geom.getNumGeometries());
22  for (int i = 0; i < geom.getNumGeometries(); i++) {
23  Geometry res = geom.getGeometryN(i);
24  String resString = res.toText();
25  results.add(resString);
26  }
27  return String.join(" ", results);
28  }