[GRASS-user] Importing ArcASCII raster and associated dbf table?

Hamish hamish_b at yahoo.com
Thu Feb 5 18:37:25 EST 2009


Jarl Devereux wrote:
> I'm new to grass and I'm trying to import an ArcASCII raster file with
> an associated dbf table into a cygwin grass 6.2.
> I have been using r.in.gdal to import the raster without issue

(r.in.arc might work too)

> however handling the attribute data is still a mystery to me.
> 
> Can I connect a raster to a dbf table or add the attributes
> as layers?

what is the form of the fields in the database?

If simply category:label you can use the rules= option of the r.category
module in GRASS 6.3+ to attach them. For GRASS 6.2 you would have to
create the cats/ file by hand. (it's just a text file)

see http://grass.osgeo.org/grass64/manuals/html64_user/r.category.html


There is the possibility that you could pipe the dbf into r.category
with the "dbview" utility.

 
> The db.* commands seemed to be only vector based

right,

> so I converted the raster to an area vector using the raster values
> as the cat. I am not sure of the steps to copy or attach the arc dbf
> table.

v.db.connect?

> my cat values are not consecutive

that's ok

> and the .dbf table that accompanied the data doesn't have a "cat" column
> it has a consecutive "value" column instead.

so is the Arc map categorical or floating point real numbers? what does
it represent?

is the DBF file like 0.0-500m: Lowlands   500.0-1000.0m Midlands    
1000.0-3000.0m Highlands or......?


> How do I go about adding this table to the vector so it correctly
> matches up "value" and "cat"?

need more info.


Hamish



      



More information about the grass-user mailing list