

This folder will be set to operate in the projection of your data. Within your directory you will need to build a ‘PERMANENT’ folder in order for GRASS to do its magic.
Starting grass gis install#
If interested, but not necessary, you can install functionality for building GRASS plug-ins: $ sudo apt-get install grass-devĬreate yourself a directory to work in: $ mkdir grass_testĭownload a piece of elevation data from the LINZ Data Service, place in your directory:įrom the Tiles Table, I downloaded the JM tile in EPSG:2193. If you do not all ready have it, you can install GRASS as follows: $ sudo apt-get install grass-core

I tested this process using Ubuntu 18.04 and GRASS 7.4. The following assumes you are working in a Linux environment and have a basic knowledge of BASH scripting. Export the vector catchments to shapefile Perform some basic GRASS operations (fill and watershed)ħ. Import the elevation into the GRASS environmentĥ. Build a BASH script to process the catchmentsĤ. Build a GRASS environment to process these dataģ. Download a small piece of elevation data from the LINZ Data ServiceĢ. Also please note, catchment extraction on a square raster is will not give accurate results at the edges of the raster.ġ. The 8m elevation data is not the best data for hydrological extraction however, these data do provide a nicely sized dataset to use as practice and will give results.
Starting grass gis how to#
The example is only for demonstration of running a basic BASH/GRASS set up with a hydrology command and NOT a demonstration for how to do hydrology using GRASS. The following example provides the steps for a simple catchment extraction on a piece of LINZ 8m elevation data. During the process I thought how useful it would have been, way back, to have a simple example for setting up an environment and scripting a BASH process using GRASS. Recently I scripted a model for extracting river centrelines from high resolution elevation data. GRASS GIS is pretty amazing and is a wonderfully easy tool to script. I am here to officially say I’ve been very wrong for a very long time. It was ‘too hard to set-up’, ‘never worked well with QGIS’, and ‘made my scripting processes a nightmare’.

I formulated any number of excuses to work around the software and could not be convinced it had practical use in my daily work. GRASS GIS was, for a long time, something I dismissed as ‘too complex’ for my everyday geospatial operations.
