use of org.apache.jena.geosparql.implementation.GeometryWrapper in project jena by apache.
the class IsValidPFTest method testApplyPredicate_true.
/**
* Test of applyPredicate method, of class IsValidPF.
*/
@Test
public void testApplyPredicate_true() {
GeometryWrapper geometryWrapper = GeometryWrapper.extract("<http://www.opengis.net/def/crs/EPSG/0/27700> LINESTRING(0 0, 1 1)", WKTDatatype.URI);
IsValidPF instance = new IsValidPF();
NodeValue expResult = NodeValue.makeNodeBoolean(true);
NodeValue result = instance.applyPredicate(geometryWrapper);
assertEquals(expResult, result);
}
use of org.apache.jena.geosparql.implementation.GeometryWrapper in project jena by apache.
the class CoordinateDimensionPFTest method testApplyPredicate_2_Dimension.
/**
* Test of applyPredicate method, of class CoordinateDimensionPF.
*/
@Test
public void testApplyPredicate_2_Dimension() {
GeometryWrapper geometryWrapper = GeometryWrapper.extract("<http://www.opengis.net/def/crs/EPSG/0/27700> POINT(90 60)", WKTDatatype.URI);
CoordinateDimensionPF instance = new CoordinateDimensionPF();
NodeValue expResult = NodeValue.makeNodeInteger(2);
NodeValue result = instance.applyPredicate(geometryWrapper);
assertEquals(expResult, result);
}
use of org.apache.jena.geosparql.implementation.GeometryWrapper in project jena by apache.
the class IsEmptyPFTest method testApplyPredicate_true.
/**
* Test of applyPredicate method, of class IsEmptyPF.
*/
@Test
public void testApplyPredicate_true() {
GeometryWrapper geometryWrapper = GeometryWrapper.extract("<http://www.opengis.net/def/crs/EPSG/0/27700> POINT EMPTY", WKTDatatype.URI);
IsEmptyPF instance = new IsEmptyPF();
NodeValue expResult = NodeValue.makeNodeBoolean(true);
NodeValue result = instance.applyPredicate(geometryWrapper);
assertEquals(expResult, result);
}
use of org.apache.jena.geosparql.implementation.GeometryWrapper in project jena by apache.
the class SfIntersectsFFTest method testRelate_polygon_polygon.
@Test
public void testRelate_polygon_polygon() throws FactoryException, MismatchedDimensionException, TransformException {
GeometryWrapper subjectGeometryWrapper = GeometryWrapper.extract(ResourceFactory.createTypedLiteral("<http://www.opengis.net/def/crs/EPSG/0/27700> POLYGON((140 15, 140 45, 200 45, 200 15, 140 15))", WKTDatatype.INSTANCE));
GeometryWrapper objectGeometryWrapper = GeometryWrapper.extract(ResourceFactory.createTypedLiteral("<http://www.opengis.net/def/crs/EPSG/0/27700> POLYGON((145 30, 145 40, 160 40, 160 30, 145 30))", WKTDatatype.INSTANCE));
SfIntersectsFF instance = new SfIntersectsFF();
Boolean expResult = true;
Boolean result = instance.relate(subjectGeometryWrapper, objectGeometryWrapper);
assertEquals(expResult, result);
}
use of org.apache.jena.geosparql.implementation.GeometryWrapper in project jena by apache.
the class SfIntersectsFFTest method testRelate_polygon_linestring_false.
@Test
public void testRelate_polygon_linestring_false() throws FactoryException, MismatchedDimensionException, TransformException {
GeometryWrapper subjectGeometryWrapper = GeometryWrapper.extract(ResourceFactory.createTypedLiteral("<http://www.opengis.net/def/crs/EPSG/0/27700> POLYGON((30 40, 30 70, 90 70, 90 40, 30 40))", WKTDatatype.INSTANCE));
GeometryWrapper objectGeometryWrapper = GeometryWrapper.extract(ResourceFactory.createTypedLiteral("<http://www.opengis.net/def/crs/EPSG/0/27700> LINESTRING(75 30, 145 30)", WKTDatatype.INSTANCE));
SfIntersectsFF instance = new SfIntersectsFF();
Boolean expResult = false;
Boolean result = instance.relate(subjectGeometryWrapper, objectGeometryWrapper);
assertEquals(expResult, result);
}
Aggregations