[Qgis-us-user] raster calculator batch processing

Paulo Raposo pauloj.raposo at gmail.com
Tue Mar 24 15:42:31 PDT 2020


Hi Dani,

Michele's answer is great, and she's right that scripting is ideally suited
to this.

Do you need to extract pixels by their value, or by their location? I'm
thinking that if it's by value, you can do this by making reclassified
copies of each raster where any pixel that isn't of the values you want is
reclassified to NoData. If by location, you have an "extract by mask"
situation.

Are you okay with or experienced with programming? If so, the GDAL
utilities (come with QGIS) can do either case (see
https://gis.stackexchange.com/questions/245170/reclassifying-raster-using-gdal
or
https://gis.stackexchange.com/questions/45053/gdalwarp-cutline-along-with-shapefile
for examples close to these two generic situations) - it would be simply a
matter of looping over your 180 inputs. You could write a Python script,
for example, that calls the command line once (use the subprocess package
in Python) for each input file, perhaps after reading them all from the
directory where you're storing them.

If all that makes no sense to you, no worries :) Batch processing in the
way Michele points to should get it done too.

Cheers,
P

On Tue, Mar 24, 2020 at 4:10 PM Michele M Tobias <mmtobias at ucdavis.edu>
wrote:

> Hi Dani,
>
> Here’s one way to do it with QGIS:
> https://gis.stackexchange.com/questions/318175/batch-raster-calculator
> This might be a good case for using a programming language like R or Python
> to do the processing.
>
>
>
> Best,
>
> Michele
>
>
>
> *Michele Tobias, PhD*
>
> Geospatial Data Specialist
>
> DataLab: Data Science & Informatics
>
> Data & Digital Scholarship
>
> UC Davis Library
>
>
>
> 370 Shields Library
>
> (530)752-7532
>
> mmtobias at ucdavis.edu
>
> ORCID: 0000-0002-2954-8710 <https://orcid.org/0000-0002-2954-8710>
>
>
>
> Pronouns: she, her, hers
>
>
>
> *From:* Qgis-us-user <qgis-us-user-bounces at lists.osgeo.org> *On Behalf Of
> *Dani Varghese
> *Sent:* Tuesday, March 24, 2020 3:08 AM
> *To:* qgis-us-user at lists.osgeo.org
> *Subject:* [Qgis-us-user] raster calculator batch processing
>
>
>
> Greetings
>
> I have nearly 180 raster images (15 minutes interval- climate data) per
> day, and need to apply raster calculator to extract a range of pixel
> values. can anyone help me, how to do it with raster calculator batch
> processing (documents or steps or tutorials) or any other methods.
>
>
>
> Thanks in advance
>
>
>
> Best
>
> Dani
> _______________________________________________
> Qgis-us-user mailing list
> Qgis-us-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/qgis-us-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-us-user/attachments/20200324/8015a0cd/attachment.html>


More information about the Qgis-us-user mailing list