Unit 15 - Reprojection

In order to perform simple flooding simulation (see Unit 16 - Flooding simulation) we need digital elevation model (DEM) for our area of interest (AOI), Jena city region. There are several options like global DEM datasets (SRTM, EU-DEM, …), local DEMs created as a product of laser scanning techniques.

In our example we will use EU-DEM global dataset provided by Copernicus programme. Let’s download tile covering our region (E40N30), be aware data are quite big (4GB), see note below. There is no need to import into GRASS the whole big DEM tile. By using -r flag of r.in.gdal we can import just a subregion covering our AOI. Unfortunately r.import do not offer such flag. So we need to create a new location for imported data and reproject data to target location (jena-utm) manually.

Note

For simplification the downloaded data clipped by larger region than our AOI is available in sample dataset (download 7z-archive), check out the eu-dem folder.

For those who are interested, sample raster file was created by GDAL utility gdal_translate, see command below.

gdal_translate -of GTiff -projwin 11 51.5 12 50.5 -projwin_srs EPSG:4326
eu_dem_v11_E40N30.TIF eu_dem_sample.tif

EU-DEM dataset is provided in ETRS-89 (EPSG:3035). Let’s start GRASS and create a new location based on input data (similarly as we did in Unit 02).

../_images/create-location-01.png

Fig. 85 Define name for new location.

Location will be created based on input sample DEM file (Read projection and datum terms from a georeferenced data file).

../_images/create-location-11.png

Fig. 86 Create new location based on sample DEM file.

Important

We will skip automatic import since we want to import just subregion defined by Jena city area.

../_images/create-location-2.svg

Fig. 87 Don’t import input data.

Enter new location (PERMANENT mapset) and reproject Jena city region vector map by v.proj (Vector ‣ Develop vector map ‣ Reproject vector map from different GRASS location).

v.proj location=jena-utm mapset=PERMANENT input=jena_boundary

Tip

In GRASS 7.4 you can easily reproject maps between different locations also from Data tab in Layer Manager just by copying and pasting them.

../_images/data-reproject.png

Fig. 88 Easy and quick way how to reproject (copy-and-paste) raster and vector maps in Data tab from Layer Manager.

Before importing DEM set computation region extent based on reprojected Jena city region.

../_images/region-extent.png

Fig. 89 Set region extent based on Jena city region.

After this step import process can be started. Launch r.in.gdal (File ‣ Import raster data ‣ Import of common raster formats), don’t forget to enable -r flag.

r.in.gdal -r input=/path/to/eu_dem_sample.tif output=dem
../_images/dem-imported.png

Fig. 90 Imported DEM limited to current region extent. Displayed with color table elevation.

Now we can switch back to our jena-utm location Settings ‣ GRASS working environment ‣ Change location and mapset.

../_images/switch-location.png

Fig. 91 Switch GRASS to jena-utm location and PERMANENT mapset.

And reproject DEM from jena-eu-dem location by r.proj (Raster ‣ Develop raster map ‣ Reproject raster map from different GRASS location) or directly from Data tab in Layer Manager. Set desired resolution (25m) and choose appropriate resampling method (in our case bilinear).

Note

If you have a mask enabled, it’s good idea to remove it before importing.

../_images/data-reproject-raster.png

Fig. 92 Reproject raster data in Layer Manager.

Example of reprojecting raster data using r.proj command below.

r.proj location=jena-eu-dem mapset=PERMANENT input=dem method=bilinear resolution=25
../_images/dem-3d.svg

Fig. 93 Reprojected DEM displayed in 3D view.