docs: def addRoughnessMapFromLandUse(self, name,
                                           session,
                                           land_use_grid,
                                           land_use_to_roughness_table=None,
                                           land_use_grid_id=None,
                                           ):
          """
          Adds a roughness map from land use file
  
          Example::
  
              from gsshapy.orm import ProjectFile
              from gsshapy.lib import db_tools as dbt
  
              from os import path, chdir
  
              gssha_directory = '/gsshapy/tests/grid_standard/gssha_project'
              land_use_grid = 'LC_5min_global_2012.tif'
              land_use_to_roughness_table = ''/gsshapy/gridtogssha/land_cover/land_cover_glcf_modis.txt'
  
              # Create Test DB
              sqlalchemy_url, sql_engine = dbt.init_sqlite_memory()
  
              # Create DB Sessions
              db_session = dbt.create_session(sqlalchemy_url, sql_engine)
  
              # Instantiate GSSHAPY object for reading to database
              project_manager = ProjectFile()
  
              # Call read method
              project_manager.readInput(directory=gssha_directory,
                                        projectFileName='grid_standard.prj',
                                        session=db_session)
  
              project_manager.mapTableFile.addRoughnessMapFromLandUse("roughness",
                                                                      db_session,
                                                                      land_use_to_roughness_table,
                                                                      land_use_grid,
                                                                      )
              # WRITE OUT UPDATED GSSHA PROJECT FILE
              project_manager.writeInput(session=db_session,
                                         directory=gssha_directory,
                                         name='grid_standard')
  
          """
          LAND_USE_GRID_TABLES = {
                                   'nga'  : 'land_cover_nga.txt',
                                   'glcf' : 'land_cover_glcf_modis.txt',
                                   'nlcd' : 'land_cover_nlcd.txt',
                                  }
  
          # read in table
          if isinstance(land_use_to_roughness_table, pd.DataFrame):
              df = land_use_to_roughness_table
          else:
              if land_use_to_roughness_table is None:
                  if land_use_grid_id is None:
                      raise ValueError("Must have land_use_to_roughness_table or land_use_grid_id set ...")
  
                  land_use_to_roughness_table = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                                             '..', 'grid',
                                                             'land_cover',
                                                             LAND_USE_GRID_TABLES[land_use_grid_id])
  
              # make sure paths are absolute as the working directory changes
              land_use_to_roughness_table = os.path.abspath(land_use_to_roughness_table)
  
              df = pd.read_table(land_use_to_roughness_table, delim_whitespace=True,
                                 header=None, skiprows=1,
                                 names=('id', 'description', 'roughness'),
                                 dtype={'id':'int', 'description':'str', 'roughness':'float'},
                                 )
  
          # make sure paths are absolute as the working directory changes
          land_use_grid = os.path.abspath(land_use_grid)
  
          # resample land use grid to gssha grid
          land_use_resampled = resample_grid(land_use_grid,
                                             self.projectFile.getGrid(),
                                             resample_method=gdalconst.GRA_NearestNeighbour,
                                             as_gdal_grid=True)
  
          unique_land_use_ids = np.unique(land_use_resampled.np_array())
  
          # only add ids in index map subset
          df = df[df.id.isin(unique_land_use_ids)]
  
          # make sure all needed land use IDs exist
          for land_use_id in unique_land_use_ids:
              if land_use_id not in df.id.values:
                  raise IndexError("Land use ID {0} not found in table.".format(land_use_id))
  
          # delete duplicate/old tables with same name if they exist
          self.deleteMapTable("ROUGHNESS", session)
  
          # get num ids
          mapTable = MapTable(name="ROUGHNESS",
                              numIDs=len(df.index),
                              maxNumCells=0,
                              numSed=0,
                              numContam=0)
  
          # Create GSSHAPY IndexMap object from result object
          indexMap = IndexMap(name=name)
          indexMap.mapTableFile = self
          mapTable.indexMap = indexMap
  
          # Associate MapTable with this MapTableFile and IndexMaps
          mapTable.mapTableFile = self
          # add values to table
          for row in df.itertuples():
              idx = MTIndex(str(row.id), row.description, '')
              idx.indexMap = indexMap
              val = MTValue('ROUGH', row.roughness)
              val.index = idx
              val.mapTable = mapTable
  
          # remove MANNING_N card becasue it is mutually exclusive
          manningn_card = self.projectFile.getCard('MANNING_N')
          if manningn_card:
              session.delete(manningn_card)
              session.commit()
  
          mapTable.indexMap.filename = '{0}.idx'.format(name)
          # write file
          with tmp_chdir(self.projectFile.project_directory):
              land_use_resampled.to_grass_ascii(mapTable.indexMap.filename,
                                                print_nodata=False)
  
          # update project card
          if not self.projectFile.getCard('MAPPING_TABLE'):
              self.projectFile.setCard('MAPPING_TABLE',
                                       '{0}.cmt'.format(self.projectFile.name),
                                       add_quotes=True)