6

I am working in QGIS 2.10.1 and I have the following situation: I have some Landsat8 scenes (different paths and rows) and I want to extract their boundary. My final objective is to superimpose them to the vector of my study area, so that I can show how the scenes cover the study area and in which points they overlap. I have already tried to convert the raster into a vector, but QGIS cannot make it, it crashes or it gives me back only part of the polygon.

Is there anybody who's got an idea to solve this problem?

ahmadhanb
  • 40,826
  • 5
  • 51
  • 105
Laura Paladini
  • 63
  • 1
  • 1
  • 3
  • 1
    What workflows are you using to accomplish this? And, if you receive an error, please post the error text in your question. – MaryBeth Jan 04 '17 at 14:35
  • At first I was using a stack of raster layers, then I got an error saying that the maximum threshold of 2 GB had been exceeded, so now I am using only one Landsat8 band. I load the band in QGIS, then go to Raster -> Conversion -> Polygonise; I use the raster image as input and then run the tool. However, the output is not a vector covering the area of the raster, but only part of it. In addition to this, I think the result is not a polygon but a polyline, so QGIS has also got difficulties in loading it after creating it... – Laura Paladini Jan 04 '17 at 15:00
  • Sounds like image footprint extraction? https://plugins.qgis.org/plugins/imagefootprint_plugin/ – Mapperz Jan 04 '17 at 15:00
  • Perhaps you can find an answer from here http://gis.stackexchange.com/questions/61512/calculating-image-boundary-footprint-of-satellite-images-using-open-source-too – user30184 Jan 04 '17 at 15:01
  • I get again this error message (sometimes it shows up, other times everything just crashes): Warning 1: 2GB file size limit reached for E:/Thesis Imagery/Muzza panchromatic\prova_5.shp. Going on, but might cause compatibility issues with third party software ERROR 1: Failed to write shape object. File size cannot reach 4294967248 + 136.

    So, apparently the problem is the raster size, but I am using the smaller raster I have got available

    – Laura Paladini Jan 04 '17 at 15:06
  • @Mapperz I cannot find this plugin in the plugin list...is it a plugin running with later versions of QGIS? – Laura Paladini Jan 04 '17 at 15:09
  • 3
    Perhaps try using the Raster Calculator with an expression like "raster@1" = 1. This makes all cells with a value of 1 which might make it easier for QGIS to polygonize... – Joseph Jan 04 '17 at 15:18
  • 1
    @Joseph thank you for your suggestion, maybe it's an easy but good one! I will try it as soon as possible :-) – Laura Paladini Jan 05 '17 at 17:04

3 Answers3

2

You can use Plugin: Image Footprint as commented by @Mapperz. You need to download the plugin from plugin Manager, and this is how it works:

enter image description here

  1. Specify the folder (directory) where the images are located
  2. Use Valid pixels and specify the CRS of the image.
  3. The outpout will create a virtual vector file with a CRS of WGS84 as the default CRS
  4. You need to Save as the virtual vector file into a permanent file with the correct CRS that should be same as the image file.

Here is the input image file stored in the folder:

enter image description here

Here is the output footprint:

enter image description here

You can refer to the presentation: Qgis ibama imagefootprint for more information.

ahmadhanb
  • 40,826
  • 5
  • 51
  • 105
2

You can use "Create layer from extent" processing algorithm selecting the desired raster layer as extent source

enter image description here

1

If you have an alpha channel in you image, you can use GDAL. to be more specific gdal_polygonize.py and use the alpha band to convert to polygon

gdal_polygonize.py image.tif "boundary.shp" -b 4 -f "ESRI Shapefile" None DN

It will return a polygon layer which has two features in it. inside and outside of alpha band. delete the outside and you have an image boundary. GDAL Polygonize

Met Kiani
  • 111
  • 4