use of org.apache.jena.geosparql.implementation.DimensionInfo in project jena by apache.
the class EqualsFFTest method testPermittedTopology_polygon_polygon.
/**
* Test of permittedTopology method, of class EqualsFF.
*/
@Test
public void testPermittedTopology_polygon_polygon() {
DimensionInfo sourceDimensionInfo = DimensionInfo.XY_POLYGON;
DimensionInfo targetDimensionInfo = DimensionInfo.XY_POLYGON;
EqualsFF instance = new EqualsFF();
boolean expResult = true;
boolean result = instance.permittedTopology(sourceDimensionInfo, targetDimensionInfo);
assertEquals(expResult, result);
}
use of org.apache.jena.geosparql.implementation.DimensionInfo 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());
}
}
use of org.apache.jena.geosparql.implementation.DimensionInfo in project jena by apache.
the class GeometryTransformIndex method transform.
private static GeometryWrapper transform(GeometryWrapper sourceGeometryWrapper, String srsURI) throws MismatchedDimensionException, FactoryException, TransformException {
CoordinateReferenceSystem sourceCRS = sourceGeometryWrapper.getCRS();
CoordinateReferenceSystem targetCRS = SRSRegistry.getCRS(srsURI);
MathTransform transform = MathTransformRegistry.getMathTransform(sourceCRS, targetCRS);
Geometry parsingGeometry = sourceGeometryWrapper.getParsingGeometry();
// Transform the coordinates into a new Geometry.
Geometry transformedGeometry = GeometryTransformation.transform(parsingGeometry, transform);
// Construct a new GeometryWrapper using info from original GeometryWrapper.
String geometryDatatypeURI = sourceGeometryWrapper.getGeometryDatatypeURI();
DimensionInfo dimensionInfo = sourceGeometryWrapper.getDimensionInfo();
return new GeometryWrapper(transformedGeometry, srsURI, geometryDatatypeURI, dimensionInfo);
}
use of org.apache.jena.geosparql.implementation.DimensionInfo in project jena by apache.
the class RccEqualsFFTest method testPermittedTopology_point_point.
/**
* Test of permittedTopology method, of class RccEqualsFF.
*/
@Test
public void testPermittedTopology_point_point() {
DimensionInfo sourceDimensionInfo = DimensionInfo.XY_POINT;
DimensionInfo targetDimensionInfo = DimensionInfo.XY_POINT;
RccEqualsFF instance = new RccEqualsFF();
boolean expResult = false;
boolean result = instance.permittedTopology(sourceDimensionInfo, targetDimensionInfo);
assertEquals(expResult, result);
}
use of org.apache.jena.geosparql.implementation.DimensionInfo in project jena by apache.
the class RccEqualsFFTest method testPermittedTopology_polygon_polygon.
/**
* Test of permittedTopology method, of class RccEqualsFF.
*/
@Test
public void testPermittedTopology_polygon_polygon() {
DimensionInfo sourceDimensionInfo = DimensionInfo.XY_POLYGON;
DimensionInfo targetDimensionInfo = DimensionInfo.XY_POLYGON;
RccEqualsFF instance = new RccEqualsFF();
boolean expResult = true;
boolean result = instance.permittedTopology(sourceDimensionInfo, targetDimensionInfo);
assertEquals(expResult, result);
}
Aggregations