Search in sources :

Example 11 with GeometryWrapper

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

the class SpatialDimensionPFTest method testApplyPredicate_2_Dimension.

/**
 * Test of applyPredicate method, of class SpatialDimensionPF.
 */
@Test
public void testApplyPredicate_2_Dimension() {
    GeometryWrapper geometryWrapper = GeometryWrapper.extract("<http://www.opengis.net/def/crs/EPSG/0/27700> POINT(90 60)", WKTDatatype.URI);
    SpatialDimensionPF instance = new SpatialDimensionPF();
    NodeValue expResult = NodeValue.makeNodeInteger(2);
    NodeValue result = instance.applyPredicate(geometryWrapper);
    assertEquals(expResult, result);
}
Also used : NodeValue(org.apache.jena.sparql.expr.NodeValue) GeometryWrapper(org.apache.jena.geosparql.implementation.GeometryWrapper) Test(org.junit.Test)

Example 12 with GeometryWrapper

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

the class SpatialDimensionPFTest method testApplyPredicate_3_Dimension.

/**
 * Test of applyPredicate method, of class SpatialDimensionPF.
 */
@Test
public void testApplyPredicate_3_Dimension() {
    GeometryWrapper geometryWrapper = GeometryWrapper.extract("<http://www.opengis.net/def/crs/EPSG/0/27700> POINT Z (90 60 30)", WKTDatatype.URI);
    SpatialDimensionPF instance = new SpatialDimensionPF();
    NodeValue expResult = NodeValue.makeNodeInteger(3);
    NodeValue result = instance.applyPredicate(geometryWrapper);
    assertEquals(expResult, result);
}
Also used : NodeValue(org.apache.jena.sparql.expr.NodeValue) GeometryWrapper(org.apache.jena.geosparql.implementation.GeometryWrapper) Test(org.junit.Test)

Example 13 with GeometryWrapper

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

the class SpatialDimensionPFTest method testApplyPredicate_3M_Dimension.

/**
 * Test of applyPredicate method, of class SpatialDimensionPF.
 */
@Test
public void testApplyPredicate_3M_Dimension() {
    GeometryWrapper geometryWrapper = GeometryWrapper.extract("<http://www.opengis.net/def/crs/EPSG/0/27700> POINT ZM (90 60 30 10)", WKTDatatype.URI);
    SpatialDimensionPF instance = new SpatialDimensionPF();
    NodeValue expResult = NodeValue.makeNodeInteger(3);
    NodeValue result = instance.applyPredicate(geometryWrapper);
    assertEquals(expResult, result);
}
Also used : NodeValue(org.apache.jena.sparql.expr.NodeValue) GeometryWrapper(org.apache.jena.geosparql.implementation.GeometryWrapper) Test(org.junit.Test)

Example 14 with GeometryWrapper

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

the class SpatialDimensionPFTest method testApplyPredicate_2M_Dimension.

/**
 * Test of applyPredicate method, of class SpatialDimensionPF.
 */
@Test
public void testApplyPredicate_2M_Dimension() {
    GeometryWrapper geometryWrapper = GeometryWrapper.extract("<http://www.opengis.net/def/crs/EPSG/0/27700> POINT M (90 60 30)", WKTDatatype.URI);
    SpatialDimensionPF instance = new SpatialDimensionPF();
    NodeValue expResult = NodeValue.makeNodeInteger(2);
    NodeValue result = instance.applyPredicate(geometryWrapper);
    assertEquals(expResult, result);
}
Also used : NodeValue(org.apache.jena.sparql.expr.NodeValue) GeometryWrapper(org.apache.jena.geosparql.implementation.GeometryWrapper) Test(org.junit.Test)

Example 15 with GeometryWrapper

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

the class IsValidPFTest method testApplyPredicate_false.

/**
 * Test of applyPredicate method, of class IsValidPF.
 */
@Test
public void testApplyPredicate_false() {
    GeometryWrapper geometryWrapper = GeometryWrapper.extract("<http://www.opengis.net/def/crs/EPSG/0/27700> LINESTRING(0 0, 0 0, 0 0)", WKTDatatype.URI);
    IsValidPF instance = new IsValidPF();
    NodeValue expResult = NodeValue.makeNodeBoolean(false);
    NodeValue result = instance.applyPredicate(geometryWrapper);
    assertEquals(expResult, result);
}
Also used : NodeValue(org.apache.jena.sparql.expr.NodeValue) 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