[Qgis-us-user] Clipping multispectral data

karsten karsten at terragis.net
Thu Mar 25 12:50:59 PDT 2021


Hi Rozalia,
 
what format is your imagery in ? Are those tif files with multiple (5) bands
each ?
One way you could go do about it would be to use the SCP plug-in with QGIS 
https://fromgistors.blogspot.com/p/semi-automatic-classification-plugin.html
to create a band set and clip the images there as individual raster (one
band for each tiff).
 
Another way to work around the trouble could be to use gdal utilities (on
windows installed via the OSGEO4w installer
http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe )
Both gdal_translate and gdalwarp can work
https://gdal.org/programs/gdal_translate.html
https://gdal.org/programs/gdalwarp.html
to cut the tif. 
One example for gdal_translate on the osgeo4w command line below: 
gdal_translate -co COMPRESS=DEFLATE -co PREDICTOR=2 -co ZLEVEL=9 -ot Int32
-of GTiff -a_nodata -1 -a_ullr 32.9530027131047 0.0482477475516659
36.0558767381047 -2.048247747551673 inputscene1.tif
outinputscene1_cut_and_compressed.tif
 
The extent to extract above is set in the tag -a_ullr 
with upper left coordinate as 32.9530027131047 0.0482477475516659 
and lower right coordinate as 36.0558767381047 -2.048247747551673
 
In theory this should maintain the bands
 
Cheers
Karsten
 
www.terragis.net

  _____  

From: Qgis-us-user [mailto:qgis-us-user-bounces at lists.osgeo.org] On Behalf
Of Rosalia Agioutanti
Sent: Thursday, March 25, 2021 12:36
To: qgis-us-user at lists.osgeo.org
Subject: [Qgis-us-user] Clipping multispectral data


  Hi, 

My name is Rozalia Agioutanti and I am a master's student at the University
of Kentucky. For my thesis, I have to process multispectral images of a
stream and classify the different types of vegetation that are existing.

However, when I try to clip the multispectral image I am losing some of the
multispectral bands, and I end up with a raster with only three bands (where
my original file had five bands). I have tried many different ways to
address this problem, like creating a shapefile and clipping the raster to
it or drawing the boundaries of my clip on the image but nothing seems to be
working.

I would really appreciate any input that you have!
Thank you very much for your help in advance,
Rozalia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-us-user/attachments/20210325/bc3752e2/attachment.html>


More information about the Qgis-us-user mailing list