[GRASSLIST:6202] Re: labels and TIGER line data?

Greg Sepesi sepesi at eduneer.com
Wed May 7 16:13:04 EDT 2003


Thanks for the tip John.  It works great.  

Even if I'd known that I had to manually create the dig_cats file, I
don't think I would have been able to figure out the necessary format by
looking at a dig_cats file in the spearfish location sample.  As shown
below, the initial number in each line of a spearfish dig_cats file
appears to be something other than a TLID.  

Did you learn that tip by looking at the source code, or is there GRASS
documentation that specifies the dig_cats file format?  (I'm new to
GRASS and am not sure if I have complete documentation.)

Thanks again,
Greg

- - -

[data/GRASSDATA/spearfish/PERMANENT/dig_cats]$ cat roads
# 4 categories
Spearfish Database Roads at 1:24000
 
0.00 0.00 0.00 0.00
0:no data
1:interstate
2:primary highway, hard surface
3:secondary highway, hard surface
4:light-duty road, improved surface
5:unimproved road

- - -

[data/GRASSDATA/spearfish/PERMANENT/dig_cats]$ cat fields
# 63 categories
Farmfields categories
 
0.00 0.00 0.00 0.00
0:"NO DATA"
1:"C. Smith #1"
2:C. Smith#2
3:P. Biggam#1
4:P. Biggam#2
5:P. Biggam#3
6:P. Biggam#5
7:P. Biggam#6
.
.
.
61:B. Cartwright#2
62:B. Cartwright#3
63:Black Hills Natl. Forest

- - -

John Gillette wrote:
> 
> These commands do not label the lines imported from tiger files.
> In other words, they do not create a dig_cats file.  You will have
> to do this manually.
> 
> The v.in.tig.basic should have created lines that have an attribute
> value equal to the TLID of the line. What is needed is a file relating
> the TLID to the label.
> 
> awk 'substr($0,56,1) == "H"{print substr($0,6,10) ":"  substr($0,20,30) }' <path to tiger1 file> > <name of temp file>
> 
> This should create a file of the form:
> 
> 1360147527:Mississippi River
> 
> Add a header at the top:
> # 99 categories
> 
> 0.00 0.00 0.00 0.00
> 
> The number 99 above should be replaced by the actual number
> of categories.  I don't know how critical this is.
> Create this file in the dig_cats directory
> of your map with the same name as the map and run v.support.
> 
> Note, you said you had hydrography.  The above awk program picks out
> CFCC codes with "H" which is hydrography.
> 
> John
> 
> >
> > Greetings,
> >
> > I've been attempting to import TIGER line data with labels.  Following
> > Dr. James Hinthorne's tutorial
> > (http://www.regis.berkeley.edu/census/censusGrass2.html), I've created
> > hydrography maps from TIGER line data using several methods:
> >
> >       1) v.in.tig.basic without the -t (topography) option
> >       2) v.in.tig.basic with the -t option
> >       3) v.in.tig.lndmk
> >
> > But none of the features in these maps have labels.  I've
> > unsuccessfully
> > tried running v.support in an attempt to create the necessary dig_cats
> > file.  Running d.what.vect results in "<not labeled>" after a category
> > report, and running v.out.ascii for each of the maps confirms that the
> > "OTHER INFO:" line does not specify a dig_cats file (the line instead
> > specifies: "Map of TIGER lines").
> >
> > Looking at the input data, the TIGER record type 1 file contains names
> > of rivers and streams in the FENAME (i.e., feature name) field.  How 
> > do I get those feature names to be line labels in GRASS?
> >
> > Thanks,
> > Greg
> >
> >




More information about the grass-user mailing list