rdf4j-postgis  Version 0.1.0.0
CompactnessRatioTest Class Reference
Collaboration diagram for CompactnessRatioTest:

Public Member Functions

void testCompactnessRatioNaN () throws ParseException
 
void testCompactnessRatio () throws ParseException
 

Static Public Attributes

static final String testGeometry ="POINT(0 0)"
 
static final String testPolygon ="POLYGON((0 0 2,0 5 2,5 0 2,0 0 2))"
 

Member Function Documentation

◆ testCompactnessRatio()

void testCompactnessRatio ( ) throws ParseException
30  {
31  CompactnessRatio instance=new CompactnessRatio();
32  ValueFactory valfac=SimpleValueFactory.getInstance();
33  Value geo=valfac.createLiteral(testPolygon, WKTDatatype.LiteralIRI);
34  Value result=instance.evaluate(valfac, geo);
35  Value expResult=valfac.createLiteral(0.7341744237254845);
36  assertEquals(expResult, result);
37  }
static final String testPolygon
Definition: CompactnessRatioTest.java:17

References GeometricDoubleAttributeFunction.evaluate(), WKTDatatype.LiteralIRI, and CompactnessRatioTest.testPolygon.

◆ testCompactnessRatioNaN()

void testCompactnessRatioNaN ( ) throws ParseException
20  {
21  CompactnessRatio instance=new CompactnessRatio();
22  ValueFactory valfac=SimpleValueFactory.getInstance();
23  Value geo=valfac.createLiteral(testGeometry, WKTDatatype.LiteralIRI);
24  Value result=instance.evaluate(valfac, geo);
25  Value expResult=valfac.createLiteral(Double.NaN);
26  assertEquals(expResult, result);
27  }
static final String testGeometry
Definition: CompactnessRatioTest.java:15

References GeometricDoubleAttributeFunction.evaluate(), WKTDatatype.LiteralIRI, and CompactnessRatioTest.testGeometry.

Member Data Documentation

◆ testGeometry

final String testGeometry ="POINT(0 0)"
static

◆ testPolygon

final String testPolygon ="POLYGON((0 0 2,0 5 2,5 0 2,0 0 2))"
static