23

I have some Python code that makes Raster Attribute Tables for GeoTiffs using GDAL.

In ArcGIS I can see these attribute tables fine and they behave how I like (as classifications) but in QGIS the whole concept of an attribute table seems to be missing.

Is there any way to access a RAT in QGIS?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Rich
  • 1,589
  • 2
  • 13
  • 36
  • There is a crowdfunding effort to implement RATs at Kartoza: https://kartoza.com/en/crowdfunding/raster-vat-table-support-in-qgis/ Make a pledge! – Stu Smith Mar 20 '21 at 15:25

3 Answers3

13

This feature request might fill your needs: https://github.com/qgis/QGIS/issues/22427

user2856
  • 65,736
  • 6
  • 115
  • 196
Giovanni Manghi
  • 3,907
  • 16
  • 24
7

Good news! A Raster Attribute Table plugin (experimental) is now available. There's also a Youtube video introduction at https://www.youtube.com/watch?v=nARp6yxRt68

enter image description here

Stu Smith
  • 8,252
  • 8
  • 35
  • 84
3

There is still no such function in QGIS as raster attributive table (as it was in ArcMap). However, you can get similar output by running Raster layer unique values report. This function counts unique values (which is perfect for integer rasters) and even calculates the area.

enter image description here

The output will look smth like:

Extent: 103.2208100000000002,52.1505000000000010 : 141.5203300000000013,73.7999700000000018

Projection: WGS 84 (EPSG:4326)

Width in pixels: 33991 (units per pixel 0.00112675)

Height in pixels: 19214 (units per pixel 0.00112675)

Total pixel count: 653103074

NODATA pixel count: 339328216

Value   Pixel count Area (deg²)
0   1549588 1.96732049625739
1   248748550   315.8053113661866
2   17323972    21.99410759001047
3   24404810    30.98377305468765
4   3532094 4.48426350804714
5   7962170 10.10858385305366
6   10253674    13.01782346155333
Anatolii
  • 201
  • 1
  • 8