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

Public Member Functions

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

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 ( )
13  {
14  return POSTGIS.SRIDGetAxis1Orientation.stringValue();
15  }

References POSTGIS.SRIDGetAxis1Orientation.

◆ operation()

String operation ( Geometry  geom)

Reimplemented from GeometricStringExportFunction.

18  {
19  CoordinateReferenceSystem crs;
20  try {
21  crs = CRS.forCode("EPSG:"+geom.getSRID());
22  return crs.getCoordinateSystem().getAxis(0).getDirection().identifier();
23  } catch (FactoryException e) {
24  // TODO Auto-generated catch block
25  e.printStackTrace();
26  return null;
27  }
28 
29  }