use of org.apache.jena.geosparql.implementation.GeometryWrapper in project jena by apache.
the class EqualsFFTest method testRelate_linestring_linestring_false.
@Test
public void testRelate_linestring_linestring_false() throws FactoryException, MismatchedDimensionException, TransformException {
GeometryWrapper subjectGeometryWrapper = GeometryWrapper.extract(ResourceFactory.createTypedLiteral("<http://www.opengis.net/def/crs/EPSG/0/27700> LINESTRING(50 50, 60 50, 80 50)", WKTDatatype.INSTANCE));
GeometryWrapper objectGeometryWrapper = GeometryWrapper.extract(ResourceFactory.createTypedLiteral("<http://www.opengis.net/def/crs/EPSG/0/27700> LINESTRING(40 50, 60 50, 80 50)", WKTDatatype.INSTANCE));
EqualsFF instance = new EqualsFF();
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 EqualsFFTest 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));
EqualsFF instance = new EqualsFF();
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 EqualsFFTest 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));
EqualsFF instance = new EqualsFF();
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 EqualsFFTest method testRelate_point_point_false.
@Test
public void testRelate_point_point_false() throws FactoryException, MismatchedDimensionException, TransformException {
GeometryWrapper subjectGeometryWrapper = GeometryWrapper.extract(ResourceFactory.createTypedLiteral("<http://www.opengis.net/def/crs/EPSG/0/27700> POINT(60 60)", WKTDatatype.INSTANCE));
GeometryWrapper objectGeometryWrapper = GeometryWrapper.extract(ResourceFactory.createTypedLiteral("<http://www.opengis.net/def/crs/EPSG/0/27700> POINT(65 65)", WKTDatatype.INSTANCE));
EqualsFF instance = new EqualsFF();
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 GMLDatatype method read.
@Override
public GeometryWrapper read(String geometryLiteral) {
try {
GMLReader gmlReader = GMLReader.extract(geometryLiteral);
Geometry geometry = gmlReader.getGeometry();
String srsURI = gmlReader.getSrsURI();
DimensionInfo dimensionInfo = gmlReader.getDimensionInfo();
return new GeometryWrapper(geometry, srsURI, URI, dimensionInfo, geometryLiteral);
} catch (JDOMException | IOException ex) {
throw new DatatypeFormatException("Illegal GML literal:" + geometryLiteral + ". " + ex.getMessage());
}
}
Aggregations