[GRASSLIST:3417] Re: importing NRCS ssurgo data.

rgrmill at rt66.com rgrmill at rt66.com
Tue Apr 2 13:57:57 EST 2002


Michel Wurtz replied:

> Roger Miller wrote:
> > 
> > Folks,
> > 
> > I've been trying to import soil data (NRCS ssurgo data) into GRASS 
5.0pre2.
> > I've found that v.in.arc will not read the *.e00 files at all.  iIt 
reports
> a
> > fatal error reading the line file.  I does import the DLG files, but 
once I
> 
> use m.in.e00 for importing *.e00 files

Thanks Michel.  m.in.e00 did work.  I guess that means that the files 
are not the problem and that v.in.e00 is broken.

The documentation for the ssurgo (SSURGO) data indicates that the DLG 
data are the original data format and that the *.e00 data set may 
contain errors.  As a result, I thought it would be a good idea to work 
out a way to interpret the dlg data.  I used the data from the files I 
imported with m.in.e00 to figure out how that should be done.  I'll 
describe it here for the record.  There may be other ways to do it.

For each quadrangle (or 1/4 quadrangle in some cases) the ssurgo data 
provide a line file and an attribute file.  In most cases there are also 
special point feature files and attribute files for the point features.  


I imported the vector objects from the line file using v.in.dlg.  I 
Didn't use the "matt=" option.  The category number that v.in.dlg 
associates with each area object is the minor code from the area record 
of the dlg file.

The ssurgo attribute file consists of one record for each area object.  
Each record contains four entries.  The first entry is the area object 
ID (or a sequence number, I'm not positive which). The second two 
entries are the last two values from each area record and I think these 
are the major and minor codes.  The minor code is the same number used 
in v.in.dlg as the category number.  The last entry on each line is the 
map unit symbol.  It's possible to identify the mapped unit by querying 
the imported file to get the minor code of an area then looking up the 
code and map unit symbol in the ssurgo attribute file.  The map unit 
symbol can be used to get entry to the many soil property tables in the 
ssurgo data set.

It is also possible to build a GRASS dig_cats file from the ssurgo 
attribute file.  I imported the ssurgo attribute file into a spreadsheet 
program, deleted the first two columns, sorted the remaining columns 
based on the minor code (first remaining column), deleted duplicate 
records and exported the result as a tab-deliminated text file.  Using 
an editor I converted each record in the tab-delimited file to the form 
"minor code:map unit symbol" and copied the first 4 lines from an 
existing dig_cats file to the top of the edited file.  I changed the 
number of attributes listed in the first line of the header to match the 
highest minor code in the file.  I then copied the edited file to 
$LOCATION/dig_cats, gave it the same name as the file that contains the 
vector data, and ran v.support on the vector file.

With a bit more spreadsheet or database work you can use the data in the 
ssurgo data tables to build as many dig_cats files as you want, using 
the map unit symbol to extract data from the ssurgo tables.


Roger Miller
Lee Wilson and Associates



More information about the grass-user mailing list