[GRASSLIST:122] RE: Census TIGER and COB
John Gillette
JGillette at rfmd.com
Wed May 21 17:06:54 EDT 2003
> of the work on this particular project was done "by hand"
> (as opposed to via TIGER) from STF3 files converting Census
> block and block group data into sites on x,y coordinate
> system specific to our project. Messy and a nuisance
> (although a good education for me on projections and data).
Greg Sepesi recently gave a link which I found most useful
[ref [GRASSLIST:6202] ]:
http://www.regis.berkeley.edu/census/censusGrass2.html
Therein is a reference to a script:
tiger2vect http://www.regis.berkeley.edu/census/progs/
This uses awk to create data on either tract or blockgroup
level for input into v.in.tig.basic. It is easy to
modify for the block level which is what I did.
> I just started working with v.in.tig.basic last week for a
> different project and had no (apparent) difficulty applying
> it to 2000 TIGER/Line data. I cut the desired reaches from
> the RT1 file using grep (grep 'A41', grep particular
> streetnames, etc.)
I use:
awk 'substr($0,56,3) == "A41"' tiger1_file> > smaller_tiger1_file
v.in.tig.basic -q t1=smaller_tiger1_file
t2=tiger2_file out=output_map
I assume this is equivalent to what you did. However, you can
do something similar with awk and create a dig_att and
dig_cat files also.
I agree that v.in.tig.basic works correctly.
> As far as I could tell by testing the vector line maps in an
> area that I know well and by overlaying Census boundary
> files (imported with m.in.e00) and the TIGER lines,
> v.in.tig.basic imported the 2000 TIGER data cleanly. I could
> query with the mouse to get TLIDs, and query TLIDs with
> d.vect.lines to highlight lines, etc., etc.
>
> What do you have in mind by "not updated for census 2000
> data"? (I am very new to the TIGER data and would be
> alarmed if v.in.tig.basic is doing something fundamentally
> wrong with the 2000 data.)
There are 2 other programs v.apply.census and m.in.stf1.tape
which are supposed to apply census data (i.e. sf1 data)
to the maps created with v.in.tig.basic. However, looking
at the code not all data fields are not correct for sf1 2000
data. I believe it was written for 1990 data.
> As an aside, it would be a big improvement in v.in.tig.basic
> if it could write .RT1 data to a database, e.g., PostGreSQL,
> at the same time that it imports the RT1 and RT2 data into
> GRASS. That would greatly facilitate geocoding addresses.
I have not done it yet but I think it would be fairly easy.
(Famous last words.)
Using awk I would separate the
fields in the census data (or tigerline data, either one) and
insert separators (like a tab character) then use the
postgres copy command to copy it into a database.
One potential problem, I use Linux where awk is really gawk.
awk may not be able to handle the long line lengths of
census files.
John
More information about the grass-user
mailing list