I have a raster file (TIF file) and want to use its extent as a mask. I need this mask to be able to extract other shape files /raster files by this mask.

How can I convert my raster file to a simple mask (shp.file) regarding only the outline of my raster file?

  • Using which software?
    – Spacedman
    Oct 4, 2019 at 18:50
  • QGIS 3.6. or ArcGIS
    – Boing
    Oct 4, 2019 at 20:33

4 Answers 4


Try converting it using the Raster To Polygon tool which:

Converts a raster dataset to polygon features.

then you can use it as a Mask.

  • but if use the Raster to Polygon option, I have also the "information" from the raster in the new polygone file. I just need the exact shape or outline to use it as a mask. how can I do that?
    – Boing
    Oct 5, 2019 at 13:59

In QGIS, you can use the Tile Index tool from:

Raster / Miscellaneous / Tile Index

You can find the solution here. For my opinion the best solution is second. Work on vactor or raster layer.

Under Vector menu go to Research tools and you will find polygon from layer extent. Also under processing you will find that function.

In QGIS 3 use ctrl+k and start typing extent.

  • in my QGIS ( 2.4.) version, on the menue "Vector" within the "research tools" I don t find the "polygon from layer extent", there are these options: select by location, create grid, extract layer extent, random points in extent, random points in layer bounds, random points inside polygons, random selection, random selection within subsets, regular points. It 's not the "random points inside polygons", isn't it? Where can I find this tool?
    – Boing
    Oct 5, 2019 at 13:50
  • @Boing - If it's possible, update QGIS to newest version.
    – GSienko
    Oct 5, 2019 at 20:25

As a caution, in ArcGIS Desktop I'd suggest using a raster as a mask on raster data rather than converting to a vector. Arc will just convert the vector back to a raster on the fly anyway, and you won't have the same level of control of cell dimensions or what cells might be excluded or included due to intersection with the "rasterized" vector data. Here https://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/extract-by-mask.htm is a good intro. From recent experience this isn't a tool to just roll with defaults, and I suggest reasearching snap raster and environment options or the output might not be what you expect, especially if output raster is to be used in analyses.

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.