[GRASSLIST:233] Re: Importing Tiger Data with v.in.ogr

Tom Russo russo at bogodyn.org
Fri Mar 17 16:29:00 EST 2006


On Fri, Mar 17, 2006 at 09:44:58PM +0100, we recorded a bogon-computron collision of the <neteler at itc.it> flavor, containing:
> On Fri, Mar 17, 2006 at 02:49:31PM -0500, J. Brian Adams wrote:
> > I would like to create vector maps from Tiger Data.  Some of these  
> > are lines (Roads, Streams, ...) and some are areas (Census Block, Zip  
> > Codes, ...)  I have tried to use v.in. ogr but I seem to be missing  
> > something in the process.  What I get is a map of all of the vector  
> > lines, but I am not seeing how to differentiate specific attributes.   
> > Is there a tutorial or explanation on using v.in.ogr with Tiger?
>  
> Brian,
> 
> the manual page of v.in.ogr explains TIGER import (it's a bit
> special) - doesn't work?

The example command in the man page just shows how to pull in boundaries and 
centroids.  There are a number of layers in the TIGER data that link to
the POLYID in the centroid records that are not imported by that command.

How would one go about importing these into additional "layers" in the grass 
vector model and linking them to the main centroid via the key "POLYID"?

For example, there is a table in the TIGER/Line data called "AreaLandmarks".
If a POLYID has a record in AreaLandmarks then there is additional information
available in the Landmarks table, which is linked to AreaLandmarks via a
key "LAND".  So one could find, for example, that POLYID 8921 in TIGER Module 
TGR35001 has an associated AreaLandmark record that has LAND of 19, which
points to the Landmarks table to show that this polygon is part of a military
base called Kirtland Air Force Base.  

Following the instructions in the v.in.ogr man page and clicking
on the same polygon with d.what.vect tells us only that this polygon is 
CENID c4588, is not water, and has the lat/lon POLYLONG :  -106416279 
POLYLAT :  34975894 without any of the feature codes or landmark names.

Can v.in.ogr be used to import the extra tables AreaLandmarks and Landmarks
into additional layers, and if so what does one have to do to set up the 
linkages with v.db.connect so that a click on the polygon with d.what.vect
shows all the information two paragraphs above instead of only that in the
last paragraph?

To get that sort of information out of TIGER/Line files when I needed it, I
just had to hack on the python script "tigerpoly.py" that comes with 
gdal in the pymod/samples directory --- that program does little more than what
the example in v.in.ogr's man page does, but it wasn't that hard to extend
it: I wound up generating a monolithic dbf file with the combined information 
in PIP, AreaLandmarks and Landmarks for every record, and dumped a shapefile, 
which I then read into GRASS.

I'd love to see how to do it without resorting to python scripting, now that
it is possible to have multiple layers in grass vectors.

-- 
Tom Russo    KM5VY     SAR502  DM64ux         http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 
"And, isn't sanity really just a one-trick pony anyway? I mean all you get is
 one trick, rational thinking, but when you're good and crazy, oooh, oooh,
 oooh, the sky is the limit!"  --- The Tick




More information about the grass-user mailing list