I am trying to import a GeoTiff (.tif) into GRASS GIS. I then want it to show up in the map display.

This is the data I want to use: http://ghsl.jrc.ec.europa.eu/ghs_pop.php

As far as I can tell, this is raster data. I know the location and the dataset must share the same projection. When I set up the location, I selected "Read projection and datum terms from georeferenced file". GRASS GIS correctly read projection and datum.

Now, I selected the location I just created, and the predefined mapset "PERMANENT". Then I hit "Start GRASS Session".

But now I'm just seeing a purple rectangle. See this screenshot:

enter image description here

I'm not quite sure what's going wrong.

Background: I am to visualize the population growth in south america. Our college course didn't do anything to prepare me for this so I have to ask such basic questions.

1 Answer 1


After importing the dataset into GRASS, you will need to complete two more steps. First, you should set the value of 0 to null. This can be done from the command-line as follows:

r.null map=GHS_POP_GPW41975_GLOBE_R2015A_54009_1k_v1_0 setnull=0

When you visualise your dataset, you should see something that broadly resembles the map of the world:

enter image description here

You then need to set the color table using either r.colors or from the menu as follows (right click --> Set Color Table):

r.colors -e map=GHS_POP_GPW41975_GLOBE_R2015A_54009_1k_v1_0@PERMANENT color=viridis

enter image description here

Which will render the map as follows:

enter image description here

Note: you will need to configure your color scheme using a pre-existing colour style or by defining your own rule set. More information regarding r.colors is available here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.