use of org.wololo.jts2geojson.GeoJSONWriter in project teiid by teiid.
the class GeometryUtils method geometryToGeoJson.
public static ClobType geometryToGeoJson(GeometryType geometry) throws FunctionExecutionException {
Geometry jtsGeometry = getGeometry(geometry);
GeoJSONWriter writer = new GeoJSONWriter();
try {
GeoJSON geoJson = writer.write(jtsGeometry);
ClobType result = new ClobType(new ClobImpl(geoJson.toString()));
result.setType(Type.JSON);
return result;
} catch (Exception e) {
throw new FunctionExecutionException(e);
}
}
Aggregations