[Qgis-user] Bathymetry data area coverage calculator

Charles Dixon-Paver charles at kartoza.com
Sat Jul 31 12:42:12 PDT 2021


The raster calculator is a tool for raster analysis which doesn't quite
suit your needs as I understand them. If you want to learn how to use the
raster calculator there is a tutorial available on the QGIS changelog
lessons [1].

That blog post I linked to before is likely the most effective or
performant option for you, and it contains links to scripts that will
perform the analysis for you.

As an alternative, I have created a simple model which steps through the
vectorization process of reclassifying a raster and calculating the area
[2]. The data I used to test the model was the SRTM tile used in the
previously mentioned lesson [1], so you can introspect it and copy the
logic or tweak it as needed. I did a session on using the modeler for the
last Open Day [3] so you can get familiar with them if you aren't already.

[1] https://changelog.qgis.org/en/qgis/lesson/raster-16/detail/51/?q=7.2
[2]
https://github.com/zacharlie/effective-dollop/blob/main/qgis-models/raster_area_calculation_example.model3
[3] https://github.com/qgis/QGIS/wiki/QOD-July-2021

On Sat, 31 Jul 2021 at 20:29, Peters <petersinmorocco at gmail.com> wrote:

> Very helpful. Yes, our data is raster. I saw a calculator tool in the
> raster toolbar but haven't been able to figure it out or if it's pertinent.
>
> On Sat, Jul 31, 2021, 19:01 Charles Dixon-Paver <charles at kartoza.com>
> wrote:
>
>> I think you will need to provide more information on describing the input
>> data, as well as how exactly you wish to process it.
>>
>> If your coverage data is vector areas you should be able to simply use
>> the aggregate processing tool using $area as the source expression and
>> stipulate a sum aggregate function. You may also use the grouping
>> function to filter the results as needed using an expression.
>>
>> This would provide the area based on map units, so you would need to
>> reproject your data into a relevant metric projection before performing the
>> aggregation. A single hectare is simply 10000 m² so simple arithmetic will
>> allow you to convert metric areas to hectares.
>>
>> If your data is another vector data type such as point clouds, you may
>> need to buffer or calculate a minimum bounding geometry or convex hull
>> before processing it as the area calculation will of course only work on
>> area features.
>>
>> For raster data, the total area would be a simple calculation of the
>> extents, or the dimensions and cell size. Again, you may need to reproject
>> the data for it to be available in meters.
>>
>> If, however, you wish to segregate raster data based on cell value, you
>> may want to recode and vectorize the data, or alternatively perform some
>> form of custom analysis as described in the following article:
>> https://www.kartoza.com/en/blog/calculating-area-of-rasters-in-qgis/
>>
>> Regards
>>
>> On Sat, 31 Jul 2021 at 19:15, Peters <petersinmorocco at gmail.com> wrote:
>>
>>> Does anyone know of such a calculator as a plugin or option?  At the
>>> moment I am using QGIS app. Our client has asked for area coverage in sq.
>>> mtrs or hectares. Appreciate any info you may have.
>>>
>>> --
>>> *regards,*
>>> *K. Peters*
>>>
>>> *cell: (Morocco) +212.671.218606*
>>> _______________________________________________
>>> Qgis-user mailing list
>>> Qgis-user at lists.osgeo.org
>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user.
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210731/5c3e6619/attachment.html>


More information about the Qgis-user mailing list