8

I am trying to combine two raster layers (one is nighttime satellite data, the other is the GPW population density data). I am using raster calculator to combine the two (the following is for a division operation, but the same problem occurs even for addition or subtraction) but get stripes of values, which tend to be either 0 or nodata. I attach a screenshot to show what this looks like:

Raster problems

Why is this happening? I have made sure the raster layers are georeferenced with the same system (WGS84) and have even tried aligning the rasters, but to no avail. Sorry if this is a rookie question - I'm fairly new to the software.

EDIT: http://beta.sedac.ciesin.columbia.edu/data/set/gpw-v4-population-density gpw is 2015 version of this data

satellite data is here: http://ngdc.noaa.gov/eog/dmsp/downloadV4composites.html particularly the stable lights layer of 2013

2
  • Please share a link to example data.
    – Simbamangu
    Jun 8, 2016 at 7:23
  • 1
    it might be useful to run gdal_info filename.tiff separately on your two rasters. This is a command line tool which gives detailed metadata and might show up something (like mismatched resolutions or CRSes) which are more difficult to compare in QGIS alone. (Run it from a terminal window, or osgeo4w shell if you're using Windows)
    – Steven Kay
    Jun 8, 2016 at 20:30

1 Answer 1

2

This was somehow tough because of the original datasets that you are using. If you check the information for the pop_density layer it seems that everything is alright.

enter image description here

For lights layer something happens. You get a warning and you can see as well that the origin of the axis and the compression for this layer is different. In fact, this tiff is close to 3gb while the previous one is just 250 mb.

enter image description here

The most important thing here to be able to perform a raster calculator is that all the rasters should be in the same projection and "cells" must overlap exactly. If you check on detail, these doens't match the second premise.

enter image description here

So, as you said you had tried, I tried align aswell but It didn't work. May be because of the warning of the data. You have to use traduct firts and do some compression on the data. That worked for me. Raster --> Conversion --> Translate (convert format).

enter image description here

Now the tif file should be around 1gb. Now try to align your raster using one of those as a "template". Raster --> Align raster...

enter image description here

Now you should have 2 raster ready to be used in raster calculater. However, depending on your ram, raster calculator wouldn't want to do the job. If this is the case, you can use an easy tool from grass r.mapcalculator. As you see in the image is very easy to use and to create you calculation.

enter image description here

The result of dividing lights/pop_density it should seems something like this.

enter image description here

Don't know if this is what you were looking for, but now, it's your turn.

One last note: be careful with the data over the edges of coastal line. You can cover these areas with interpolate but this is another question.

Your Answer

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

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