Does any has any experience with converting string geojson into com.vividsolutions.jts geometry object (point, polygon, etc). Maybe there is some java library I cannot find.
Greets!
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityFor a much more lightweight alternative to GeoTools, check out jts2geojson:
GeoJSONReader reader = new GeoJSONReader();
Geometry geometry = reader.read(json);
GeoTools provides a GeoJSON module which will read in GeoJSON files and convert them to GeoTools Feature Collections - the geometry elements of these collections is stored as a JTS object. So all you need is
Geometry geom = (Geometry) feature.getDefaultGeometry();
There seems to be nowadays also native GeoJSON reader/writer code in JTS trunk:
EDIT
OpenJUMP can read and write GeoJSON with code that is in https://sourceforge.net/p/jump-pilot/code/HEAD/tree/core/trunk/src/com/vividsolutions/jump/io/geojson/. Perhaps it could be reused.