Unit 15 - Reprojection

In our example EU-DEM global dataset provided by Copernicus programme will be used. Oslo region is covered by tile E40N40. 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 oslo (EPSG:32632) location manually.

Note

To save space the original EU-DEM tile was clipped by larger region than Oslo AOI. Modified tile is available from 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 oslo-eu-dem based on input eu-dem-sample.tif data (similarly as done in Unit 02). Skip data import provided by location wizard since only subregion defined by Oslo region is planned to be imported.

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

Fig. 88 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. 89 Create new location based on sample DEM file.

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

Fig. 90 Don’t import input data from Location Wizard.

Enter new location (PERMANENT mapset) and reproject Oslo region vector map by v.proj (Vector ‣ Develop vector map ‣ Reproject vector map from different GRASS location) or simply from Data tab in Layer Manager just by copying and pasting the maps, see Fig. 91.

../_images/data-reproject.png

Fig. 91 Easy and quick way to reproject (copy-and-paste) raster or vector maps across locations from Data tab in Layer Manager.

v.proj location=oslo mapset=PERMANENT input=oslo

Before importing DEM set computation region extent based on reprojected Oslo region.

../_images/region-extent.png

Fig. 92 Set computational region extent based on Oslo region.

Launch r.in.gdal (File ‣ Import raster data ‣ Import of common raster formats) to import DEM tile, 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. 93 Imported DEM limited to current region extent. Displayed with elevation color table.

Reproject DEM into target location

Now switch back to our oslo-region location and create within this location a new mapset for eu-dem Settings ‣ GRASS working environment ‣ Change location and mapset.

../_images/switch-location.png

Fig. 94 Switch GRASS to oslo location and PERMANENT mapset.

Reproject DEM from oslo-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 a mask is enabled, it’s good idea to remove it before importing.

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

Fig. 95 Reproject raster data in Layer Manager.

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

r.proj location=oslo-eu-dem mapset=PERMANENT input=dem method=bilinear resolution=25

Todo

Create 3D view example screenshot