7.1 Spatio-temporal intro in GRASS GIS¶
GRASS GIS, commonly referred to as GRASS (Geographic Resources Analysis Support System), is a free and open-source Geographic Information System (GIS) software suite used for geospatial data management and analysis, image processing, graphics and maps production, spatial modelling, and visualization. In this lesson, we will use GRASS for simple and spatio-temporal flooding analyses. More info about the software is available on its project website: GRASS GIS.
We will use GRASS GIS in the version of 8 which has completely new startup mechanism and graphical user interface.
GRASS data structure¶
GRASS motivates users to organize their data from an early beginning. GRASS uses a consistent structure of so-called locations and mapsets to organize its data. Hierarchical data structure is as follows:
-
Layers = Vector, raster, 3D raster, time series...
-
Mapset = Contains task-related layers within one project. Helps organizing layers into logical groups or to separate parallel work of different users on the same project.
-
Location = All geodata stored within one location must have the same spatial coordinate system (GRASS doesn’t support on-the-fly projection for several reasons).
-
Database directory = A directory on local or network disc which contains all data accessed by GRASS. It’s usually a directory called grassdata located in users’ home directory.
Content¶
1) GRASS data hierarchy and data import
2) Flooding simulation
3) Spatio-temporal flooding simulation
4) Space-time Data Querying
Data preparations¶
In this unit EU-DEM global dataset provided by Copernicus programme will be used Copernicus download. Prague DEM is covered by tile E40N30. EU-DEM normally covers quite large region. Currently the DEM available for you at /shares/K155/Public/155ISDP/07/eu_dem_v11_E40N30.tif has the size of 4.8 GB. (It can also be accessed through https://geo.fsv.cvut.cz/courses/155isdp/data/07/.)
To limit the needed DEM for aur analysis to the Prague city, we will utilize the Prague boundaries layer downloaded from OpenStreetMap project. We will prepare the data for export at Overpass-Turbo using its Wizard tool:
/*
This has been generated by the overpass-turbo wizard.
The original search was:
“boundary=administrative and admin_level=6”
*/
[out:json][timeout:25];
// gather results
(
// query part for: “boundary=administrative and admin_level=6”
node["boundary"="administrative"]["admin_level"="6"]({{bbox}});
way["boundary"="administrative"]["admin_level"="6"]({{bbox}});
relation["boundary"="administrative"]["admin_level"="6"]({{bbox}});
);
// print results
out body;
>;
out skel qt;
Besides DEM, we will also need rivers (larger natural waterways) and streams (small waterways) that can be downloaded similarly as boundaries. We will generate the URL using Overpass-Turbo:
/*
This has been generated by the overpass-turbo wizard.
The original search was:
“waterway=river or waterway=stream”
*/
[out:json][timeout:25];
// gather results
(
// query part for: “waterway=river”
node["waterway"="river"]({{bbox}});
way["waterway"="river"]({{bbox}});
relation["waterway"="river"]({{bbox}});
// query part for: “waterway=stream”
node["waterway"="stream"]({{bbox}});
way["waterway"="stream"]({{bbox}});
relation["waterway"="stream"]({{bbox}});
);
// print results
out body;
>;
out skel qt;
Data are in different coordinate systems. DEM is in EPSG:3035 (ETRS89-extended / LAEA Europe) while river streams and administrative boundaries are in EPSG:4326 (WGS84 - World Geodetic System 1984).
Create a location and import data¶
We will first create the location. The location is associated to the coordinate reference system (CRS). For common data analyses, we need to have all data in one location. Therefore, we need to set up one main location for our analysis and reprojected other layers into that location using r.proj module.
We will choose the CRS of EU-DEM as the main CRS to which data with different projections will be reprojected.
1) Start a new GRASS session and create new location prague-flooding based on input /shares/K155/Public/155ISDP/07/eu_dem_v11_E40N30.tif file or from EPSG code (EPSG:3035).
2) Import boundaries into prague-flooding location using v.import module which is used to import and automatically reproject data into target location.
3) Set computation region extent based on reprojected Prague boundary region. (First create a layer containing only the Prague boundary).
4) Import DEM by using -r flag in r.in.gdal GRASS module which import only a subregion covering AOI (in our case Prague boundaries).
5) Import rivers similarly as Prague boundaries (v.import)
Flooding simulation¶
0) Restrict computational extent to Prague center part.
1) Find out the height of the flooding starting point (seed point).
The desired height should be 189.10 meters above sea.
Further, base maps should be stored in PERMANENT mapset while layers resulting from analysis should be organized in own mapsets.
2) Create a new mapset called flooding.
3) Compute flooding raster (the resulting raster map contains cells with values representing lake depth (NULL for all other cells beyond the lake)). Set the water_level value a bit higher than the height of the seed point.
Spatio-temporal flooding simulation¶
0) Install r.lake.series addon by g.extension
1) Compute multiple raster maps registered in space-time raster dataset (6 levels with 10 minute time step).
r.lake.series elevation=dem out=lakes start_water_level=190 end_water_level=193 \
water_level_step=1 coordinates=4636538,3006218 \
time_step=10 nproc=3
2) Show basic info about space-time raster dataset.
3) Show simple animation
Space-time data querying¶
1) Print raster maps within given time period (first thirty minutes of flooding)
2) Count statistics for first thirty minutes of flooding