Search in sources :

Example 1 with GMLReader

use of org.apache.jena.geosparql.implementation.parsers.gml.GMLReader 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());
    }
}
Also used : GMLReader(org.apache.jena.geosparql.implementation.parsers.gml.GMLReader) Geometry(org.locationtech.jts.geom.Geometry) DatatypeFormatException(org.apache.jena.datatypes.DatatypeFormatException) DimensionInfo(org.apache.jena.geosparql.implementation.DimensionInfo) GeometryWrapper(org.apache.jena.geosparql.implementation.GeometryWrapper) IOException(java.io.IOException) JDOMException(org.jdom2.JDOMException)

Aggregations

IOException (java.io.IOException)1 DatatypeFormatException (org.apache.jena.datatypes.DatatypeFormatException)1 DimensionInfo (org.apache.jena.geosparql.implementation.DimensionInfo)1 GeometryWrapper (org.apache.jena.geosparql.implementation.GeometryWrapper)1 GMLReader (org.apache.jena.geosparql.implementation.parsers.gml.GMLReader)1 JDOMException (org.jdom2.JDOMException)1 Geometry (org.locationtech.jts.geom.Geometry)1