use of org.apache.jena.geosparql.spatial.SearchEnvelope in project jena by apache.
the class GenericCardinalPropertyFunctionTest method testExtractObjectArguments_3args_pos2_fail.
/**
* Test of extractObjectArguments method, of class
* GenericCardinalPropertyFunction.
*/
@Test(expected = ExprEvalException.class)
public void testExtractObjectArguments_3args_pos2_fail() {
Node predicate = NodeFactory.createURI(SpatialExtension.NORTH_PROP);
float lat = 0;
float lon = 1;
int limit = 10;
Literal geometry = ConvertLatLon.toLiteral(lat, lon);
List<Node> objectNodes = Arrays.asList(NodeValue.makeFloat(lat).asNode(), NodeValue.makeFloat(lon).asNode(), NodeValue.makeString("10").asNode());
PropFuncArg object = new PropFuncArg(objectNodes);
GeometryWrapper geometryWrapper = GeometryWrapper.extract(geometry);
NorthPF instance = new NorthPF();
SearchEnvelope searchEnvelope = instance.buildSearchEnvelope(geometryWrapper, SpatialIndexTestData.WGS_84_SRS_INFO);
SpatialArguments expResult = new SpatialArguments(limit, geometryWrapper, searchEnvelope);
SpatialArguments result = instance.extractObjectArguments(predicate, object, SpatialIndexTestData.WGS_84_SRS_INFO);
assertEquals(expResult, result);
}
use of org.apache.jena.geosparql.spatial.SearchEnvelope in project jena by apache.
the class GenericCardinalPropertyFunctionTest method testExtractObjectArguments_3args_pos0_fail.
/**
* Test of extractObjectArguments method, of class
* GenericCardinalPropertyFunction.
*/
@Test(expected = ExprEvalException.class)
public void testExtractObjectArguments_3args_pos0_fail() {
Node predicate = NodeFactory.createURI(SpatialExtension.NORTH_PROP);
float lat = 0;
float lon = 1;
int limit = 10;
Literal geometry = ConvertLatLon.toLiteral(lat, lon);
List<Node> objectNodes = Arrays.asList(NodeValue.makeString("e").asNode(), NodeValue.makeFloat(lon).asNode(), NodeValue.makeInteger(limit).asNode());
PropFuncArg object = new PropFuncArg(objectNodes);
GeometryWrapper geometryWrapper = GeometryWrapper.extract(geometry);
NorthPF instance = new NorthPF();
SearchEnvelope searchEnvelope = instance.buildSearchEnvelope(geometryWrapper, SpatialIndexTestData.WGS_84_SRS_INFO);
SpatialArguments expResult = new SpatialArguments(limit, geometryWrapper, searchEnvelope);
SpatialArguments result = instance.extractObjectArguments(predicate, object, SpatialIndexTestData.WGS_84_SRS_INFO);
assertEquals(expResult, result);
}
use of org.apache.jena.geosparql.spatial.SearchEnvelope in project jena by apache.
the class NorthPFTest method testBuildSearchEnvelope.
/**
* Test of buildSearchEnvelope method, of class NorthPF.
*/
@Test
public void testBuildSearchEnvelope() {
GeometryWrapper geometryWrapper = SpatialIndexTestData.PARIS_GEOMETRY_WRAPPER;
NorthPF instance = new NorthPF();
SearchEnvelope expResult = SearchEnvelope.build(geometryWrapper, SpatialIndexTestData.WGS_84_SRS_INFO, CardinalDirection.NORTH);
SearchEnvelope result = instance.buildSearchEnvelope(geometryWrapper, SpatialIndexTestData.WGS_84_SRS_INFO);
assertEquals(expResult, result);
}
use of org.apache.jena.geosparql.spatial.SearchEnvelope 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.spatial.SearchEnvelope 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);
}
Aggregations