Search in sources :

Example 21 with GeometryWrapper

use of org.apache.jena.geosparql.implementation.GeometryWrapper in project jena by apache.

the class SfTouchesFFTest 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 60, 145 60)", WKTDatatype.INSTANCE));
    SfTouchesFF instance = new SfTouchesFF();
    Boolean expResult = false;
    Boolean result = instance.relate(subjectGeometryWrapper, objectGeometryWrapper);
    assertEquals(expResult, result);
}
Also used : GeometryWrapper(org.apache.jena.geosparql.implementation.GeometryWrapper) Test(org.junit.Test)

Example 22 with GeometryWrapper

use of org.apache.jena.geosparql.implementation.GeometryWrapper in project jena by apache.

the class SfTouchesFFTest method testRelate_polygon_linestring.

@Test
public void testRelate_polygon_linestring() throws FactoryException, MismatchedDimensionException, TransformException {
    GeometryWrapper subjectGeometryWrapper = GeometryWrapper.extract(ResourceFactory.createTypedLiteral("<http://www.opengis.net/def/crs/EPSG/0/27700> POLYGON((80 15, 80 45, 140 45, 140 15, 80 15))", WKTDatatype.INSTANCE));
    GeometryWrapper objectGeometryWrapper = GeometryWrapper.extract(ResourceFactory.createTypedLiteral("<http://www.opengis.net/def/crs/EPSG/0/27700> LINESTRING(80 85, 80 30)", WKTDatatype.INSTANCE));
    SfTouchesFF instance = new SfTouchesFF();
    Boolean expResult = true;
    Boolean result = instance.relate(subjectGeometryWrapper, objectGeometryWrapper);
    assertEquals(expResult, result);
}
Also used : GeometryWrapper(org.apache.jena.geosparql.implementation.GeometryWrapper) Test(org.junit.Test)

Example 23 with GeometryWrapper

use of org.apache.jena.geosparql.implementation.GeometryWrapper in project jena by apache.

the class SfTouchesFFTest 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((80 15, 80 45, 140 45, 140 15, 80 15))", 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));
    SfTouchesFF instance = new SfTouchesFF();
    Boolean expResult = true;
    Boolean result = instance.relate(subjectGeometryWrapper, objectGeometryWrapper);
    assertEquals(expResult, result);
}
Also used : GeometryWrapper(org.apache.jena.geosparql.implementation.GeometryWrapper) Test(org.junit.Test)

Example 24 with GeometryWrapper

use of org.apache.jena.geosparql.implementation.GeometryWrapper in project jena by apache.

the class SfTouchesFFTest method testRelate_polygon_point_false.

@Test
public void testRelate_polygon_point_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> POINT(30 20)", WKTDatatype.INSTANCE));
    SfTouchesFF instance = new SfTouchesFF();
    Boolean expResult = false;
    Boolean result = instance.relate(subjectGeometryWrapper, objectGeometryWrapper);
    assertEquals(expResult, result);
}
Also used : GeometryWrapper(org.apache.jena.geosparql.implementation.GeometryWrapper) Test(org.junit.Test)

Example 25 with GeometryWrapper

use of org.apache.jena.geosparql.implementation.GeometryWrapper in project jena by apache.

the class SfOverlapsFFTest 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((80 15, 80 45, 140 45, 140 15, 80 15))", WKTDatatype.INSTANCE));
    GeometryWrapper objectGeometryWrapper = 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));
    SfOverlapsFF instance = new SfOverlapsFF();
    Boolean expResult = true;
    Boolean result = instance.relate(subjectGeometryWrapper, objectGeometryWrapper);
    assertEquals(expResult, result);
}
Also used : GeometryWrapper(org.apache.jena.geosparql.implementation.GeometryWrapper) Test(org.junit.Test)

Aggregations

GeometryWrapper (org.apache.jena.geosparql.implementation.GeometryWrapper)356 Test (org.junit.Test)297 DimensionInfo (org.apache.jena.geosparql.implementation.DimensionInfo)70 Node (org.apache.jena.graph.Node)64 SearchEnvelope (org.apache.jena.geosparql.spatial.SearchEnvelope)63 Literal (org.apache.jena.rdf.model.Literal)59 PropFuncArg (org.apache.jena.sparql.pfunction.PropFuncArg)53 LineString (org.locationtech.jts.geom.LineString)52 SpatialArguments (org.apache.jena.geosparql.spatial.property_functions.SpatialArguments)51 Geometry (org.locationtech.jts.geom.Geometry)48 CustomCoordinateSequence (org.apache.jena.geosparql.implementation.jts.CustomCoordinateSequence)39 ExprEvalException (org.apache.jena.sparql.expr.ExprEvalException)36 DatatypeFormatException (org.apache.jena.datatypes.DatatypeFormatException)32 NodeValue (org.apache.jena.sparql.expr.NodeValue)24 TransformException (org.opengis.referencing.operation.TransformException)21 FactoryException (org.opengis.util.FactoryException)21 Envelope (org.locationtech.jts.geom.Envelope)19 MismatchedDimensionException (org.opengis.geometry.MismatchedDimensionException)19 Coordinate (org.locationtech.jts.geom.Coordinate)15 Resource (org.apache.jena.rdf.model.Resource)13