code: public static String toKml(Geometry geometry, boolean extrude, int altitudeModeEnum) throws SQLException {
          StringBuilder sb = new StringBuilder();
          if (extrude) {
              KMLGeometry.toKMLGeometry(geometry, ExtrudeMode.TRUE, altitudeModeEnum, sb);
          } else {
              KMLGeometry.toKMLGeometry(geometry, ExtrudeMode.FALSE, altitudeModeEnum, sb);
          }
          return sb.toString();
      }
docs: Generates a KML geometry. Specifies the extrude and altitudeMode.
  
  Available extrude values are true, false or none.
  
  Supported altitude mode :
  
  For KML profil
  
  CLAMPTOGROUND = 1; RELATIVETOGROUND = 2; ABSOLUTE = 4;
  
  For GX profil CLAMPTOSEAFLOOR = 8; RELATIVETOSEAFLOOR = 16;
  
  No altitude : NONE = 0;
  
  @param geometry
  @param altitudeModeEnum
  @param extrude
  @return
  @throws SQLException