rdf4j-postgis  Version 0.1.0.0
MinimumBoundingRadius Class Reference

Returns the mininum bounding radius of the minimum bounding circle surrounding the geometry. More...

Inheritance diagram for MinimumBoundingRadius:
Collaboration diagram for MinimumBoundingRadius:

Public Member Functions

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

Detailed Description

Returns the mininum bounding radius of the minimum bounding circle surrounding the geometry.

Member Function Documentation

◆ attribute()

double attribute ( Geometry  geom)

Reimplemented from GeometricDoubleAttributeFunction.

14  {
15  org.locationtech.jts.algorithm.MinimumBoundingCircle minCircle = new org.locationtech.jts.algorithm.MinimumBoundingCircle(geom);
16  return minCircle.getRadius();
17  }

◆ 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  double result = attribute(geom);
25  return valueFactory.createLiteral(result);
26  }
27  throw new ValueExprEvaluationException("Argument given is not a geometry literal");
28 
29  }

References GeometricDoubleAttributeFunction.attribute(), and LiteralRegistry.getLiteral().

Referenced by AreaTest.testArea(), CompactnessRatioTest.testCompactnessRatio(), CompactnessRatioTest.testCompactnessRatioNaN(), CircularityTest.testIsScaleneTriangleFalse(), CircularityTest.testIsScaleneTriangleTrue(), LengthTest.testLineString(), MTest.testM(), MinimumBoundingRadiusTest.testMinimumBoundingRadius(), MinimumClearanceTest.testMinimumClearance(), MinimumDiameterTest.testMinimumDiameter(), MaxMTest.testMMax(), MinMTest.testMMin(), PerimeterTest.testPerimeter(), XTest.testX(), MaxXTest.testXMax(), MinXTest.testXMin(), YTest.testY(), MaxYTest.testYMax(), MinYTest.testYMin(), ZTest.testZ(), MaxZTest.testZMax(), and MinZTest.testZMin().

◆ getURI()

String getURI ( )
20  {
21  return POSTGIS.st_minimumBoundingRadius.stringValue();
22  }

References POSTGIS.st_minimumBoundingRadius.