[GRASS-user] Raster attributes

Ned Horning horning at amnh.org
Tue Mar 2 09:39:34 EST 2010


Hamish,

Thanks for the tips. Doing the raster to vector and then vector to 
raster conversion probably won't work so well for this application. The 
image is quite large and I don't want to risk modifying the data in the 
conversion process.

I'll see what I can do with regard to writing a script. I have a decent 
understanding of r.reclass and r.category but the problem is that I'm 
not sure how to join the database to the raster. I'll see if the 
r.rast4d module can provide some hints.

Ned

On 3/2/2010 2:38 AM, Hamish wrote:
> 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:
>   http://grass.osgeo.org/wiki/GRASS_SoC_Ideas_2008#Time_series_management_in_GRASS
>   http://grass.osgeo.org/wiki/Time_series_in_GRASS
>   http://trac.osgeo.org/grass/browser/grass-addons/raster/r.rast4d
>
>
>    
>> 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,
> Hamish
>
>
>
>
>
>    



More information about the grass-user mailing list