1

I am doing research at graduate school. Using QGIS GRASS, I made a raster image (DEM) by spline interpolation from point data. Next, I decided to limit the range to within the vector (within the point data). When I masked it in the raster menu, it was not restricted in the vector, and the resulting raster image became a yellow image (with no value). What is the solution for this?

1
  • I don't understand what you mean by "..limit the range to within the vector (within the point data)" Please edit your post to include a screen shot depicting what you would like to accomplish.
    – Stu Smith
    Commented Nov 21, 2020 at 17:37

1 Answer 1

1

Your question is not quite clear.

If you want to mask out values of a DEM that are above or below the minimum and maximum of a vector, using GRASS here's what you can do: Assuming you have a vector of points "point_elevations" with column "elev", and your DEM raster is called "dem". You can find the minimum and maximum with:

v.univar point_elevations column=elev

This will output all the univariate stats for the elev "column" including minimum and maximum. Let's call them "min_value" and "max_value". Now use these value in a mapcalc expression to create a new, masked dem:

r.mapcalc "dem_masked = if(dem >= min_value && dem <= max_value, dem, null())"

You enter the actual min and max values from the v.univar output. This will result in a new GRASS raster, "dem_masked" with null (no value) in place of the high and low elevations.

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.