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

Hamish hamish_b at yahoo.com
Mon Feb 9 21:34:44 EST 2009


> >Jarl wrote:
> >> The data is an Australian soils atlas including hydraulic properties
> >> in the dbf.
....
> here is a link to the one I'm using
> you have to register to download it.
> 
> http://www.toolkit.net.au/Tools/SHPA


ok, not too hard. The trick is to convert the raster coverage to vector
areas to take advantage of the rich vector attribute/database tie-ins:


# import ArcASCII grid to UTM55S location
r.in.gdal input=aas_z55.asc output=aas_z55
r.colors aas_z55.gdal color=random
r.info aas_z55

# convert to vector areas, using raster value for category
g.region rast=aas_z55
r.to.vect -v in=aas_z55.gdal out=aas_z55 feature=area

# get rid of empty DBF table created by r.to.vect
v.db.droptable aas_z55

# copy real DBF file into $MAPSET/dbf/ directory
eval `g.gisenv`
cp /tmp/au/aas_z55.DBF "$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/aas_z55.dbf"

# connect full DBF database to vector map, use "VALUE" as the key column
v.db.connect map=aas_z55 driver=dbf table=aas_z55 key=value


done!


> The way I was going to use the atlas was to query it with either
> coordinates to see what soil properties are at that point

# manually query coords
v.what -a map=aas_z55 east_north=595633,6568838

# if coords are already in a vector points map
v.what.vect


> or overlay other areas of interest to determine how the soils change
> across the area.

v.overlay then v.univar or one of the several report modules (or custom
SQL query reports).

> I can do this externally to grass by referencing the
> CAT number outside grass but it isn't very convenient.

automation is the magic key....

> On a similar situation I was doing this attribute management manually by
> querying the vector and manually adding a new column and defining the
> attribute. This makes me think I should be able to have all the table
> information in the one vector.

Yup, you're on the right track....


Hamish



      



More information about the grass-user mailing list