[GRASS-user] r.in.gdal for importing categorical ArcGIS binary rasters

Moritz Lennert mlennert at club.worldonline.be
Fri Feb 14 00:28:44 PST 2014


On 13/02/14 18:48, manuel.martin wrote:
> So I looked closer at the data and it is ESRI's binary ArcInfo Grid
> format with vat.adf files in the layer directory. These tables may be
> accessed outside of ArcGIS using for instance gdalinfo, and the R raster
> library seem to do it as well. However these tables seem to contain some
> binary codes so they cannot easily be read from automatic processing.

If you can export the information with gdalinfo, you should be able to 
treat it automatically to create the necessary input files for r.reclass 
or r.category. I don't have any sample files here, so I can't test for 
myself. If you want to send me a sample file, I can try to see what is 
possible.

BTW: I just added to the GRASS wiki page on Corine Land Cover [2] the 
input necessary for r.reclass to transform a raster with generic 0-255 
categories to a raster with the CLC codes as categories and the 
description of each class as a label.

>
> Unfortunately, CLC is not the only categorical layer I need to process,
> and manually linking the imported rasters values (within GRASS) to
> manually extracted codes (which again may be also strings) is not really
> an option. (or maybe is there a way to automate the process?)

If you have access to ArcGIS, you can apparently export the raster data 
table [3]. You should then be able to input that table into r.reclass or 
r.category depending on your needs and on the data.

>
> So I am now thinking to convert these ArcGIS layers to another format
> using the gdal library (function gdal_translate for instance) for latter
> importing these converted layers to grass. I am thus facing two new
> questions.
> 1) which format is the best suited for carrying such categorical data on
> larger rasters among supported gdal formats and
> 2) will this format be supported by grass?
>

GRASS raster format does not store attributes for rasters (or maximum 
one in the form of labels). So if you want to store the information 
contained in several fields in an attribute table, you have to create as 
many raster maps as there are attributes (assuming that these attributes 
are numerical). So I think you best bet is to try to get the attribute 
data in text form and then extract from that the inputs to 
r.reclass/r.category.

Moritz




[1] 
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Raster_dataset_attribute_tables/009t00000009000000/
[2] http://grasswiki.osgeo.org/wiki/CORINE_Land_Cover#Legend




More information about the grass-user mailing list