Framework project: Digital Elevation Models (DEMs)

Setup processing for Copernicus DEM

This post is the first in a series of manuals for how to process the global Digital Elevation Model (DEM) provided by the European Space Agency (ESA) Copernicus program. This first part deals with setting up a user defined project inlcuding a spatial processing region (called tract in the Framework), and how to add basic data on the layout of DEM data to the Framework.

Copernicus DEM is available in different resoltuons as well as from different online repositories. The next three posts in this series deals with three didifferent alterantives for accessing and importing the Copernicus DEM data to the Framework. You need to select one of these. At time of writing this (January 2022) the 90 m version available from gisco-service lacks data between -180 and -179 degrees latitude. Thus I recommend using one of the AWS alternatives; alternatives for downloading and organising Copernicus DEM (CopDEM):

  • CopDEM 90 m from gisco-services
  • CopDEM 90 m from AWS
  • CopDEM 30 m from AWS

After you have downloaded and organised the CopDEM version you want to process, the processing is the same, covered by the following insturction-posts:

  • Fisksoppa
  • Gurkstuvning

Introduction

Processing a global DEM all the way from downloading tiles to create coherent indices and metrics of landscapes, is a typical task for which Karttur’s GeoImagine Framework was built. Once the DEM is imported and organized within the Framework, it is easy to test different algorithms and visualizations. If you have access to some ground data you can also apply the Framework for comparing the results of different algorithms and parameters against ground data, and thus select the most appropriate landscape model.

Prerequisits

You must have installed Karttur’s GeoImagine Framework. You also need a registered project that covers the geographic regions of the DEM you want to process. The latter can, however, be done as part of the project itself.

Process chain

The process chain is available at Kartturs GitHub account and also found under the Hide/show button below. The process chain is an ordinary text file linking to a series of json files. Empty rows and rows starting with a “#” are ignored. When called from karttur’s GeoImagine Framework, the processes of each json file are sequentially run. In the process chain below you can click on each json file name to see the complete content. The following sections also explain in more detail the processes of each jscon command file.

Create a project

0000_ManageDefRegProj_copdem-ease2n.json

Data specific processing requires that your user has a predefined project that includes a predefined tract, where the tract must be linked to a default region. All spatial processing that you process from that user and with that project will then operate on system tiles linked to parent default region of your project tract. The whole processing is set up in thin manner to minimise double processing.

Unless you have done so before you must setup the project and tract to use for processing the Copernicus DEM data. The example is for processing the DEM for the entire basins draining into Arctic waters. Thus the example assign the default region northlandease2n as the parent region. Both the user specific project and its region are called karttur-northlandease2n.

Layout

To produce symbolised and labeled maps using the Framework, you have to define some Layout features and parameters. All map layout is done using unsigned byte range maps with values ranging from 0 to 255, Values 251 to 255 are reserved for specific purposes and not allowed for representing map values. The Framework Layout processes include:

  • CreateScaling,
  • AddRasterPalette,
  • CreateLegend, and
  • ExportLegend.

Create Scaling

0001_CreatesScaling_DEM_v090.json

The CreateScaling process converts any input raster into an unsigned byte (0-255) range file. The byte file is then used for assigning a color ramp (defined in the process AddRasterPalette, see next section).

Scaling is thus not defined on the fly, instead each map composition (see the post on ??? for an explanation on the Framework map composition concept) must be associated with a predefined scaling. Once defined, this scaling can not be changed.

Add Raster Palette

0002_AddRasterPalette_DEM_v090.json

In contrast to scaling, a palette can be freely set for any map composition (but always using the same scaling). The palette to use for any map layout is defined when calling the process that generates the layout. Thus the palette must exist beforehand, created by using the process AddRasterPalette.

Create Legend

0003_createlegends_DEM_v090.json

With the scaling set and a palette defined, you can define a legend - that is how the combined scaling and palette will be presented in graphical layouts.

Export Legend

0005_exportlegend_DEM_v090.json

Once created you can export a legend. All legends are experted as png, csv and pdf. Exporting a legend requires that you have installed the application inkscape as outlined in the post Python virtual environment. The exported legends are stored under a director legends on the destiantion disk/volume. The image represented the raster palette is under a subfolder images (saved as a png image) adn the legends with text added are under a subfolder layouts, and saved as three different versions:

  • svg
  • png
  • pdf