Skip to content
Main site » Terrain as a basemap

Terrain as a basemap

TERRAIN

From a previous post we already know how to load ready-made basemaps.

But what if they do not meet our expectations and we have some time? Here’s a tip: We can create our own basemap 😁

Creating our own basemap will make our website or product a distinctive feature.

This time, we present how to generate terrain relief map for a selected area.

WELCOME

You will find information like:

  1. WHERE TO OBTAIN DATA FOR THE PROJECT
  2. HOW TO LOAD ELEVATION DATA
  3. HOW TO EDIT ELEVATION DATA
  4. HOW TO ADD ELEMENTS TO BASEMAPS
  5. HOW TO CLIP VECTOR AND RASTER LAYERS

LET’S START, AND WE CLAIM THAT IT’S NOT DIFFICULT 😁

PREPARATION FOR WORK

What will we need?

Nothing has changed from previous posts, so mainly ENTHUSIASM, and additionally:

SOFTWARE

If anyone can create a map, it must be free software like QGIS. Downloading is very simple and does not require any secret knowledge from the user, just knowing their operating system 🙂 Just visit the website and download it.

sing the QGIS program, we will show you how to easily create your own terrain relief map. GIVE IT A TRY

DATA

As we always say, if something already exists, why create it from scratch? Therefore, if data is available under open licenses, let’s use it, edit it, and add new value. Where to get it? You don’t have to scour the internet. We did it for you. WELCOME. [You will find information about the source, currency, data formats, and the license they are provided under]

For our map, we will need the following data:

For our project, we will need both raster and vector data [you’ll feel the difference]. We will show you how to load and process them a bit.

TERRAIN

If you want a detailed basemap of the terrain relief for the entire world [including ocean floors], we recommend the GEBCO side.

For our project, we need data in GeoTIFF format. (Most of you will probably complete the entire project faster than downloading the data, so we suggest taking a coffee break 😊). However, considering it’s data for the entire world, it’s still very quick.

BOUNDARIES

You can obtain country borders from many portals. However, it is important to remember the scale for which the layer was developed. In short, how detailed the vector layer is. It may seem insignificant, but when we overlay different elements, there might be situations where they do not align.

For our project, data from Natural Earth at a scale of 1:50,000,000 [1 cm = 500 km 😊] in .shp format will be sufficient. On this site, you will also find more detailed data that you can use for your projects.

WATERS

Rivers and lakes are probably some of the most frequently downloaded data, right after borders. Therefore, we have many data sources. For our project, the layers downloaded from the DIVA-GIS. site will be sufficient. The data is grouped by country. We chose Italy because we love Italian espresso 😍 ☕️

There are two ways to load data into QGIS. The first is through the LAYER tab [as below]. The second is by dragging the data into the program [e.g., into the project window].

  1. Open the QGIS program.
  2. Click the LAYER tab on the top bar [a list will expand].
  3. Click ADD LAYER.
  4. Click ADD VECTOR LAYER [for borders and rivers].
  5. Click ADD RASTER LAYER [for terrain].

5. The DATA SOURCE MANAGER window will appear
6. All you need to do is indicate where the data is saved on your computer and select those with the .SHP or GeoTIFF extension.
7. Don’t forget to click the ADD button 😎

From the vector data, load:
– ne_50m_admin_0_countries.shp [boundaries]

  • – [rivers and lakes]
    From the raster data, load:
    – gebco_2021_n0.0_s-90.0_w-90.0_e0.0.tif
    – gebco_2021_n0.0_s-90.0_w-180.0_e-90.0.tif
    – gebco_2021_n0.0_s-90.0_w0.0_e90.0.tif
    – gebco_2021_n0.0_s-90.0_w90.0_e180.0.tif
    – gebco_2021_n90.0_s0.0_w-90.0_e0.0.tif
    – gebco_2021_n90.0_s0.0_w-180.0_e-90.0.tif
    – gebco_2021_n90.0_s0.0_w0.0_e90.0.tif
    – gebco_2021_n90.0_s0.0_w90.0_e180.0.tif

After loading the raster data, we will process only the file [gebco_2021_n0.0_s90.0_w0.0_
e90.0.tif], because we need the terrain data for Italy. If you are interested in a project for the entire world, we suggest merging the files into one, as shown below. [It’s not necessary, but why edit 8 layers when you can work with just one]

MERGING RASTER LAYERS

Merging raster files is very simple. Just select `RASTER` from the tab, then `MISCELLANEOUS`, and choose `MERGE`. A window will appear to manage the merging process.


CLIPPING LAYERS TO VECTOR MASK

If we want to create a project for a specific country or region, we suggest clipping it. Here’s the quick step-by-step process:

We will clip the raster to the administrative area of Italy, having downloaded administrative data for the world, so we will clip it accordingly:

  1. Right-click on the loaded Natural Earth data in the layer window.
  2. Open the attribute table.
  3. Find and select the desired area(s) as shown above.
  4. The area will be highlighted in yellow.
  5. Right-click again (as in step [1]), select EXPORT, and then SAVE SELECTED FEATURE.
  6. A window will appear where you specify the save location and name for your layer. DONE, we’ve created the layer to which we will clip the other layers.
Screenshot

In our project, we need to clip both the vector and raster layers.  🤯 It’s easier to clip the layer with rivers and terrain features within Italy’s boundaries. Each task has its tool, so here’s where they are located:

FOR RASTER DATA
  1. Open the RASTER menu from the main toolbar.
  2. Select EXTRACTION and then CLIP RASTER BY MASK LAYER.
  3. A window will appear where you indicate the raster to be clipped and the clipping layer (our vector – Italy’s area).
  4.  Specify the output layer’s save location.
  5. Run the process.
FOR VECTOR DATA
  1. Open the VECTOR menu from the main toolbar.
  2. Select GEOPROCESSING TOOLS and then CLIP
  3. A window will appear where you indicate the vector to be clipped (our vector with hydrography) and the clipping layer (our vector – Italy’s area).
  4. Specify the output layer’s save location.
  5. Run the process.

THE MOST TIME-CONSUMING AND TEDIOUS TASKS ARE BEHIND US

Now for the fun part—playing with the effects we want to achieve. In our case, we will use shading and hypsometry methods so that the results of both methods are visible. A bit of whimsy 😊

For this, we will need two identical raster layers, one for each method. Don’t worry, we won’t clip anything else.

  1. In the layer window, right-click the layer and select DUPLICATE, and that’s it.

SHADING

As always, in the LAYERS window, right-click on the clipped raster layer and select PROPERTIES, then:

  1. Choose SYMBOLOGY from the left menu.
  2. Select the display method HILLSHADE
  3. Adjust the Z FACTOR based on the elevation effect you want to achieve [Experiment with these values].
  4. If you don’t want to change anything else, click OK.

HYPSOMETRY

Edit the second raster layer similarly:

  1. In Properties, select SYMBOLOGY.
  2. Set the display method to Palette/Unique values.
  3. Choose a color palette or create your own.
  4. Click CLASSIFY.
  5. Confirm with OK

NOTE: To display both layers, one of them must have its transparency level set [in our case, the layer with hypsometry].

  1. Under the SYMBOLOGY menu, there is TRANSPARENCY – click and use the slider to set the desired transparency level.

Below, we show the effect of our work [the terrain of Italy] and what you can achieve for any area.

Leave a Reply

Your email address will not be published. Required fields are marked *

Top