[GRASS-user] Raster attributes

Hamish hamish_b at yahoo.com
Tue Mar 2 02:38:14 EST 2010

Ned Horning wrote:
> Is it possible to link a raster image
> to a set of attributes stored in a database using GRASS?

categorical (CELL) raster maps have very basic support via the r.category
module; the category value of the cell can hold the key column ID.

for something more advanced see:

> I am working with the Harmonized World Soil Database which
> consist of an image and a database that holds a set of soil
> attributes. These attributes can be linked/joined to the
> image since the pixel values are IDs that appear in the
> database. I would like to output a series of images, each
> representing a different attribute such as soil unit,
> texture, soil depth. Is this possible in GRASS?

I think it would be quite possible to write a nice script that does this with r.reclass + r.category. It would be a nice addition to wiki addons :)

I think it could be done without the complication of an extra SQL layer,
but whatever works.

probably the easiest idea though is to simply run 'r.to.vect -v
feature=area' and then v.db.connect. You will be limited by the number
of cells though, probably if the raster is bigger than 1600x1600 you
might run into memory problems. (depends on how many repeated cell values/
clumps are in the map)

good luck,


More information about the grass-user mailing list