docs: def getAsKmlGrid(self, session, path=None, documentName=None, colorRamp=ColorRampEnum.COLOR_RAMP_HUE, alpha=1.0,
                       noDataValue=None):
          """
          Retrieve the raster as a KML document with each cell of the raster represented as a vector polygon. The result
          is a vector grid of raster cells. Cells with the no data value are excluded.
  
          Args:
              session (:mod:`sqlalchemy.orm.session.Session`): SQLAlchemy session object bound to PostGIS enabled database.
              path (str, optional): Path to file where KML file will be written. Defaults to None.
              documentName (str, optional): Name of the KML document. This will be the name that appears in the legend.
                  Defaults to 'Stream Network'.
              colorRamp (:mod:`mapkit.ColorRampGenerator.ColorRampEnum` or dict, optional): Use ColorRampEnum to select a
                  default color ramp or a dictionary with keys 'colors' and 'interpolatedPoints' to specify a custom color
                  ramp. The 'colors' key must be a list of RGB integer tuples (e.g.: (255, 0, 0)) and the
                  'interpolatedPoints' must be an integer representing the number of points to interpolate between each
                  color given in the colors list.
              alpha (float, optional): Set transparency of visualization. Value between 0.0 and 1.0 where 1.0 is 100%
                  opaque and 0.0 is 100% transparent. Defaults to 1.0.
              noDataValue (float, optional): The value to treat as no data when generating visualizations of rasters.
                  Defaults to 0.0.
  
          Returns:
              str: KML string
          """
          if type(self.raster) != type(None):
              # Set Document Name
              if documentName is None:
                  try:
                      documentName = self.filename
                  except AttributeError:
                      documentName = 'default'
  
              # Set no data value to default
              if noDataValue is None:
                  noDataValue = self.defaultNoDataValue
  
              # Make sure the raster field is valid
              converter = RasterConverter(sqlAlchemyEngineOrSession=session)
  
              # Configure color ramp
              if isinstance(colorRamp, dict):
                  converter.setCustomColorRamp(colorRamp['colors'], colorRamp['interpolatedPoints'])
              else:
                  converter.setDefaultColorRamp(colorRamp)
  
              kmlString = converter.getAsKmlGrid(tableName=self.tableName,
                                                 rasterId=self.id,
                                                 rasterIdFieldName='id',
                                                 rasterFieldName=self.rasterColumnName,
                                                 documentName=documentName,
                                                 alpha=alpha,
                                                 noDataValue=noDataValue,
                                                 discreet=self.discreet)
  
              if path:
                  with open(path, 'w') as f:
                      f.write(kmlString)
  
              return kmlString