2

I have polygon data that is data retrieved across whole world, how do I focus this data on a raster map. Basically I want to select the features only in this area but I want it to match exactly this map raster rather then do a square. In other words I want to delete all the data outside this area, I dont want to merge the two, just remove all the global fire atlas data that is outside mato.enter image description here

Do I absolutely have to change the Mato to vector before I do that?

4
  • So, you want to create a mask layer from the raster and then perform a extract by location to your vector?
    – Mayo
    Commented Aug 5, 2022 at 13:57
  • @Mayo Thank you for the reply. I am not sure tbh, I just want to remove all those brown dots from everywhere but that particular location, not sure how to do that.
    – AhmedTech
    Commented Aug 5, 2022 at 13:59
  • Ok, in other words you want to extract only the spatial objects of the vector that are fully covered by the raster layer?
    – Mayo
    Commented Aug 5, 2022 at 14:01
  • @Mayo yes exactly, Would a way to do this is polygonize the raster and then extract by location where they intersect, and then just use that instead?
    – AhmedTech
    Commented Aug 5, 2022 at 14:02

1 Answer 1

5
  1. Open the Raster calculator tool and use this expression to create a mask, "layer@band" != no-data. Replace layer with the name of your raster, band with the number of your band and no-data with the no-data value of your layer.
  2. Now that you have a raster with only the value one in the data pixels, you can polygonize with Poligonize (raster to vector) GDAL tool, select the calculated raster as the input.
  3. Now you have a vector layer that can be used to run the Extract by location tool with the global fire atlas vector.
2
  • Thank you so much for this, I really appreciate this!
    – AhmedTech
    Commented Aug 5, 2022 at 14:19
  • 2
    Did my answer solved your problem? If it worked please mark my answer as accepted, this help people with the same problem to find this answer and helps me to gain reputation. Thanks 😉
    – Mayo
    Commented Aug 5, 2022 at 15:14

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.