code: private void writeFeature(JsonGenerator jsonGenerator, ResultSet rs, int geoFieldIndex) throws IOException, SQLException {
          // feature header
          jsonGenerator.writeStartObject();
          jsonGenerator.writeStringField("type", "Feature");
          //Write the first geometry
          writeGeometry((Geometry) rs.getObject(geoFieldIndex), jsonGenerator);
          //Write the properties
          writeProperties(jsonGenerator, rs);
          // feature footer
          jsonGenerator.writeEndObject();
      }
docs: Write a GeoJSON feature.
  
  Features in GeoJSON contain a geometry object and additional properties,
  and a feature collection represents a list of features.
  
  A complete GeoJSON data structure is always an object (in JSON terms). In
  GeoJSON, an object consists of a collection of name/value pairs -- also
  called members. For each member, the name is always a string. Member
  values are either a string, number, object, array or one of the literals:
  true, false, and null. An array consists of elements where each element
  is a value as described above.
  
  Syntax:
  
  { "type": "Feature", "geometry":{"type": "Point", "coordinates": [102.0,
  0.5]}, "properties": {"prop0": "value0"} }
  
  @param writer
  @param resultSetMetaData
  @param geoFieldIndex