Search in sources :

Example 1 with GeoJSONReader

use of org.wololo.jts2geojson.GeoJSONReader in project teiid by teiid.

the class GeometryUtils method geometryFromGeoJson.

public static GeometryType geometryFromGeoJson(ClobType json, int srid) throws FunctionExecutionException {
    try {
        GeoJSONReader reader = new GeoJSONReader();
        String jsonText = ClobType.getString(json);
        Geometry jtsGeometry = reader.read(jsonText);
        return getGeometryType(jtsGeometry, srid);
    } catch (SQLException e) {
        throw new FunctionExecutionException(e);
    } catch (IOException e) {
        throw new FunctionExecutionException(e);
    }
}
Also used : GeoJSONReader(org.wololo.jts2geojson.GeoJSONReader) FunctionExecutionException(org.teiid.api.exception.query.FunctionExecutionException) SQLException(java.sql.SQLException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 SQLException (java.sql.SQLException)1 FunctionExecutionException (org.teiid.api.exception.query.FunctionExecutionException)1 GeoJSONReader (org.wololo.jts2geojson.GeoJSONReader)1