def viewshed(point, path_input, path_output, tile_name, max_distance, crs):
    '\n    Perform a viewshed using GRASS.\n\n    Parameters\n    ---------\n    point : tuple\n        The point being queried.\n    tile_lookup : dict\n        A lookup table containing raster tile boundary coordinates\n        as the keys, and the file paths as the values.\n    path_output : string\n        The directory path for the output folder.\n    tile_name : string\n        The name allocated to the viewshed tile.\n    max_distance : int\n        The maximum distance a path can be.\n    crs : string\n        The coordinate reference system in use.\n\n    Returns\n    -------\n    grid : dataframe\n        A geopandas dataframe containing the created grid.\n\n    '
    with Session(gisdb=path_output, location='location', create_opts=crs):
        gcore.run_command('r.external', input=path_input, output=tile_name, overwrite=True)
        gcore.run_command('r.external.out', directory='viewsheds', format='GTiff')
        gcore.run_command('g.region', raster=tile_name)
        gcore.run_command('r.viewshed', input=tile_name, output='{}.tif'.format(tile_name), coordinate=[point[0], point[1]], observer_elevation=30, target_elevation=30, memory=5000, overwrite=True, quiet=True, max_distance=max_distance)
Perform a viewshed using GRASS.

Parameters
---------
point : tuple
    The point being queried.
tile_lookup : dict
    A lookup table containing raster tile boundary coordinates
    as the keys, and the file paths as the values.
path_output : string
    The directory path for the output folder.
tile_name : string
    The name allocated to the viewshed tile.
max_distance : int
    The maximum distance a path can be.
crs : string
    The coordinate reference system in use.

Returns
-------
grid : dataframe
    A geopandas dataframe containing the created grid.
def viewshed(point, path_input, path_output, tile_name, max_distance, crs):
    '\n    Perform a viewshed using GRASS.\n\n    Parameters\n    ---------\n    point : tuple\n        The point being queried.\n    tile_lookup : dict\n        A lookup table containing raster tile boundary coordinates\n        as the keys, and the file paths as the values.\n    path_output : string\n        The directory path for the output folder.\n    tile_name : string\n        The name allocated to the viewshed tile.\n    max_distance : int\n        The maximum distance a path can be.\n    crs : string\n        The coordinate reference system in use.\n\n    Returns\n    -------\n    grid : dataframe\n        A geopandas dataframe containing the created grid.\n\n    '
    with Session(gisdb=path_output, location='location', create_opts=crs):
        gcore.run_command('r.external', input=path_input, output=tile_name, overwrite=True)
        gcore.run_command('r.external.out', directory='viewsheds', format='GTiff')
        gcore.run_command('g.region', raster=tile_name)
        gcore.run_command('r.viewshed', input=tile_name, output='{}.tif'.format(tile_name), coordinate=[point[0], point[1]], observer_elevation=30, target_elevation=30, memory=5000, overwrite=True, quiet=True, max_distance=max_distance)