Get Info#
Starting GRASS in Python:
>>> import grass.script as grass
Environments#
Command |
Description |
|---|---|
|
Get GRASS environment info as a dictionary |
'GISDBASE': 'C:/GRASS/GIS DataBase',
'GRASS_GUI': 'wxpython',
'LOCATION_NAME': 'WGS84',
'MAPSET': 'PERMANENT'
Command |
Description |
|---|---|
|
Set system variables to run scripts |
>>> gisbase = os.environ['GISBASE']
>>> gisdbase = 'C:/GRASS/GIS DataBase'
>>> location = 'LAEA'
>>> mapset = 'PERMANENT'
>>> import grass.script.setup as gsetup
>>> gsetup.init(gisbase, gisdbase, location, mapset)
Region#
Command |
Description |
|---|---|
|
Dictionary of region definition |
'cells': Number of cells
'rows': Rows
'cols': Columns
'nsres': Y pixel resolution
'ewres': X pixel resolution
'w': X min
's': Y min
'e': X max
'n': Y max
List of Layers#
Command |
Description |
Output |
|---|---|---|
|
List of elements as strings |
|
|
List grouped by mapsets as a dictionary |
|
|
List of elements as strings in the mapset |
|
|
List of elements as strings in all mapsets |
|