Unit 15 - DTM reprojection¶
In this unit EU-DEM global dataset provided by Copernicus programme will be used. Jena region is covered by tile E40N30. Be aware that EU-DEM tiles covers large regions (4GB per tile).
Normally r.import could be used to import and
automatically reproject data into target location. In this case there
is no need to import into GRASS a whole big DEM tile. By using -r
flag of r.in.gdal GRASS module only a subregion covering
AOI could be imported. Unfortunately r.import do not offer
such flag. In this unit manual reprojection will be presented. A new
location for imported data (EPSG:4258) must be created and data
reprojected into target jena-region (EPSG:32632) location manually.
Note
In order to save space of disk the original EU-DEM tile was
clipped by larger region than Jena AOI. Modified tile is available
from geodata/eu-dem directory.
Create location for data import¶
EU-DEM dataset is provided in ETRS-89 (EPSG:4258). Start a new
GRASS session and create a new location jena-eu-dem based on input
geodata/eu-dem/dem_sample.tif data (similarly as done in
Unit 02). Skip data import provided by
location wizard since only subregion defined by Jena city region is
planned to be imported.
Fig. 87 Define name for a new location.
Location will be created based on input sample DEM file (Read projection and datum terms from a georeferenced data file).
Fig. 88 Create a new location based on a sample DEM file.
Fig. 89 Don’t import input data from Location Wizard.
Enter new location (PERMANENT mapset) and reproject Jena region vector map by v.proj () or simply from Data tab in Layer Manager just by copying and pasting the maps, see Fig. 90.
Fig. 90 Easy and quick way to reproject (copy-and-paste) raster or vector maps across locations from Data tab in Layer Manager.
v.proj location=jena-region mapset=PERMANENT input=jena_boundary
Before importing DEM set computation region extent based on reprojected Jena city region.
Fig. 91 Set computational region extent based on Jena city region.
Launch r.in.gdal () to import DEM tile, don’t
forget to enable -r flag.
r.in.gdal -r input=/home/user/geodata/eu-dem/dem_sample.tif output=dem
Fig. 92 Imported DEM limited to current region extent. Displayed with
elevation color table.
Reproject DEM into target location¶
Now switch back to jena-region location ().
Fig. 93 Switch GRASS to jena-region location and PERMANENT mapset.
Reproject DEM from jena-eu-dem location by r.proj () or directly from Data tab in Layer Manager. Set desired resolution (25m) and choose appropriate resampling method (in our case bilinear).
Note
If a mask is enabled, it’s good idea to remove it before importing.
Fig. 94 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
Fig. 95 DTM in 3D view.