code: public static void toGeojsonCoordinate(Coordinate coord, StringBuilder sb) {
          sb.append("[");
          sb.append(coord.x).append(",").append(coord.y);
          if (!Double.isNaN(coord.z)) {
              sb.append(",").append(coord.z);
          }
          sb.append("]");
      }
docs: Convert a JTS coordinate to a GeoJSON representation.
  
  Only x, y and z values are supported.
  
  Syntax:
  
  [X,Y] or [X,Y,Z]
  
  @param coord
  @param sb