use of org.apache.jena.geosparql.implementation.GeometryWrapper in project jena by apache.
the class SfIntersectsFFTest method testRelate_polygon_polygon_false.
@Test
public void testRelate_polygon_polygon_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> POLYGON((140 15, 140 45, 200 45, 200 15, 140 15))", WKTDatatype.INSTANCE));
SfIntersectsFF instance = new SfIntersectsFF();
Boolean expResult = false;
Boolean result = instance.relate(subjectGeometryWrapper, objectGeometryWrapper);
assertEquals(expResult, result);
}
use of org.apache.jena.geosparql.implementation.GeometryWrapper in project jena by apache.
the class RccDisconnectedFFTest method testRelate_polygon_polygon.
// Only 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((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> POLYGON((140 15, 140 45, 200 45, 200 15, 140 15))", WKTDatatype.INSTANCE));
RccDisconnectedFF instance = new RccDisconnectedFF();
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 SouthPFTest method testBuildSearchEnvelope.
/**
* Test of buildSearchEnvelope method, of class SouthPF.
*/
@Test
public void testBuildSearchEnvelope() {
GeometryWrapper geometryWrapper = SpatialIndexTestData.PARIS_GEOMETRY_WRAPPER;
SouthPF instance = new SouthPF();
SearchEnvelope expResult = SearchEnvelope.build(geometryWrapper, SpatialIndexTestData.WGS_84_SRS_INFO, CardinalDirection.SOUTH);
SearchEnvelope result = instance.buildSearchEnvelope(geometryWrapper, SpatialIndexTestData.WGS_84_SRS_INFO);
assertEquals(expResult, result);
}
use of org.apache.jena.geosparql.implementation.GeometryWrapper in project jena by apache.
the class WestPFTest method testBuildSearchEnvelope.
/**
* Test of buildSearchEnvelope method, of class WestPF.
*/
@Test
public void testBuildSearchEnvelope() {
GeometryWrapper geometryWrapper = SpatialIndexTestData.PARIS_GEOMETRY_WRAPPER;
WestPF instance = new WestPF();
SearchEnvelope expResult = SearchEnvelope.build(geometryWrapper, SpatialIndexTestData.WGS_84_SRS_INFO, CardinalDirection.WEST);
SearchEnvelope result = instance.buildSearchEnvelope(geometryWrapper, SpatialIndexTestData.WGS_84_SRS_INFO);
assertEquals(expResult, result);
}
use of org.apache.jena.geosparql.implementation.GeometryWrapper in project jena by apache.
the class WestPFTest method testCheckSearchEnvelope_wrap.
/**
* Test of checkSearchEnvelope method, of class WestPF.
*/
@Test
public void testCheckSearchEnvelope_wrap() {
SpatialIndex spatialIndex = SpatialIndexTestData.createTestIndex();
// Search Envelope
GeometryWrapper geometryWrapper = SpatialIndexTestData.HONOLULU_GEOMETRY_WRAPPER;
WestPF instance = new WestPF();
// Needed to initialise the search.
SearchEnvelope searchEnvelope = instance.buildSearchEnvelope(geometryWrapper, SpatialIndexTestData.WGS_84_SRS_INFO);
HashSet<Resource> expResult = new HashSet<>(Arrays.asList(SpatialIndexTestData.AUCKLAND_FEATURE, SpatialIndexTestData.PERTH_FEATURE, SpatialIndexTestData.HONOLULU_FEATURE));
HashSet<Resource> result = searchEnvelope.check(spatialIndex);
assertEquals(expResult, result);
}
Aggregations