2

I have two raster height maps and a (vector?) layer with points. The goal is to generate a statistic that looks something like this:

Point 1:
Layer 1: 100m
Layer 2: 300m
Point 2:
Layer 1: 70m
Layer 2: 300m
...

Afterwards, it should be possible to import the statistic with tools like libreoffice calc, excel, ..., so I can calculate the difference between them.

Is there already a built-in option for this in QGIS and if not, how can I generate such a file?

0

1 Answer 1

1

You can use Refactor fields to calculate the two columns.

Fetch the value of the raster at the point locations with the expressions: raster_value(layer:='raster1', band:=1, point:=$geometry)

raster_value(layer:='raster2', band:=1, point:=$geometry)

Replace 'raster1' / 'raster2' with the names of your raster layers.

enter image description here

Another option is to Sample Raster Values twice

2
  • Instead of then importing it to Excel after follwoing this step above you can then also just calculate the height by adding a new column to your points-layer and calculate it with the field calculator by "Raster2" - "Raster1" [insert the names of your columns]
    – Vincé
    Jul 31, 2023 at 17:46
  • 1
    @BERA Thanks! As soon, as it works, I mark it as an answer! Aug 4, 2023 at 8:35

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.