I have a raster layer, as seen on the attached image, that works as a background of my working area. The red line, that marks the limit between the two countries, is a .shp file that, naturally, goes beyond the area of interest, the aforementioned raster.
What I am trying to achieve is a way of displaying the red line only when it overlays the raster, not outside it.
Using Clip or Intersect inside the Vector - Geoprocessing Tools menu don't work here, as they only work Vector on Vector; I tried creating a Scratch layer with a polygon of the same shape as the raster. In this way, I can clip the border line, but it creates, naturally, a new line around the raster.
Is there a way to mask the red line as desired? Alternatively, is there a way to "cut" the polygon in two parts, by making two cuts (something similar as what the Scissors tool does in Illustrator) and just deleting the unneeded line?
Edit: This is the outcome using the method in this reply, which is the same outcome as using Clip or Intersect: https://i.sstatic.net/R11zD.jpg
The reason behind that, methinks, is that the border line marked in red is a closed polygon. See here:
With this update, any further solution comes to mind?