In QGIS, how can I use the color on one image to crop another image (a raster layer)?

83 Views Asked by At

I have data (black pixels) that show where there are trails in a specific region:

Trail Data enter image description here

I also have a detailed heightmap in a raster layer (it's 9 tiles total):

Heightmap Raster enter image description here

I use Houdini to create heightfields with the above raster layer files, which I then send to Unreal Engine. When I do this, I try to keep the resolution at recommended Unreal Engine sizes (4033 grids). But when I do this, I lose the detail of the trails in the resulting heightmap.

What I want to do is create a new raster layer based on where trails exist, in other words, run an algorithm that removes everything in the raster layer except where there are trails. I'll then create a detailed heightmap just based on this much smaller raster file.

I've looked for an algorithm that can do this but I'm coming up short. Does anyone have an idea on how to do this?

The closest solution I've found so far is this one, but the algorithm only affects the input image (from what I can see), how do you affect a separate image based on data/info from the input image?

https://gis.stackexchange.com/questions/421139/crop-map-by-color

0

There are 0 best solutions below