Details
Description
Currently the geojson tools only support writing json with 2d coordinates. It does support reading both 2d and 3d coordinates.
The following code snippet shows the problem. Of writing a 3d point.
GeometryJSON geoJson = new GeometryJSON();
GeometryFactory factory = new GeometryFactory();
Point point = factory.createPoint(new Coordinate(10,11,12));
String json = geoJson.toString(point);
System.out.println("wrote json:"+json);
Point p = (Point)geoJson.read(json);
WKTWriter writer = new WKTWriter(3);
String jp = writer.write(p);
System.out.println("read json:"+jp);
A simple patch is required to the CoordinateSequenceEncoder inside the GeometryJSON class. I have attached a patch that is working for me.