[Qgis-us-user] Clipping multispectral data
karsten
karsten at terragis.net
Thu Mar 25 13:07:03 PDT 2021
Hi Rosalia,
ok possibly the trouble comes from some a software bug and your procedure
was not working correctly with the vrt file as input.
Possibly the easiest work around for you would be to clip each tif
individually and then assemble again to a vrt afterwards ...
Note that the SCP plug-in might support pretty well your task in regards to
classifying different types of vegetation ...
Cheers
Karsten
_____
From: Rosalia Agioutanti [mailto:ragioutanti at gmail.com]
Sent: Thursday, March 25, 2021 12:57
To: karsten
Subject: Re: [Qgis-us-user] Clipping multispectral data
Hey Karsten,
Thank you for getting back to me so quickly!! I really appreciate it!!
I merged all of my five multispectral bands (which are GeoTifs) to a single
multispectral image and its format is a virtual raster.
I will try out everything you proposed and get back to you!
Thanks again for all your help, it was much needed!
Rozalia
On Thu, 25 Mar 2021 at 15:51, karsten <karsten at terragis.net> wrote:
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/ca65c1c6/attachment-0001.html>
More information about the Qgis-us-user
mailing list