I have a tiff image file and want to get a polygon with the extent of the tiff.
Is there a direct way of doing this?
Right now I have to convert the image to vector (with
gdal_polygonize) and then dissolve the polygons.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
Your question isn't clear. Do you want the 'rectangular' extents of the raster, or the extent of the features in the raster? For the rectangular extent, just use the "Tile Index" under Raster > Miscellanious > Tile Index. If you don't see the Raster menu, you may have to install or enable the GDALTools plugin.
And of course if you aren't tied to doing it in QGIS, you could just use GDAL directly. See gdaltileindex
In QGIS 3.x it is called
extract layer extent. (Thanks to @chrismarx for pointing it out)
If you want only the extent of one image and not the full directory you can go to
Vector->Research Tool->Polygon from layer extent here select the image you want the extent and save the output.
If you have no NoData pixels at the edges of your image, then just use "Extract Layer Extent" from the tool box.
If you have NoData values surrounding the actual image which is weirdly shaped and that's the area you want to make into a vector, you can use the Raster Calculator to extract the part of the image you want using
"image_name@band"!=NoDataValue and then use Vectorize. That worked for me and was much faster than Vectorize and Dissolve.