Unit 15 - DMT 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.
Location will be created based on input sample DEM file (Read projection and datum terms from a georeferenced data file).
Enter new location (PERMANENT mapset) and reproject Oslo region vector map by v.proj ( ) or simply from Data tab in Layer Manager just by copying and pasting the maps, see Fig. 91.
v.proj location=oslo mapset=PERMANENT input=oslo
Before importing DEM set computation region extent based on reprojected Oslo region.
Launch r.in.gdal ( ) to import DEM tile, don’t
forget to enable -r
flag.
r.in.gdal -r input=/path/to/eu_dem_sample.tif output=dem
Reproject DEM into target location¶
Now switch back to our oslo-region location and create within this location a new mapset for eu-dem
.Reproject DEM from oslo-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.
Example of reprojecting raster data using r.proj command below.
r.proj location=oslo-eu-dem mapset=PERMANENT input=dem method=bilinear resolution=25