TIGER 2005

From OpenStreetMap Wiki
Jump to navigation Jump to search

TIGER 2005 is a release of data from the TIGER database of roads (among other geographic featues) in the United States An initial import of this data was attempted in 2005 and 2006, however it was aborted. Details on this failed import can be read at Old TIGER Import 2005/2006. A subsequent import in 2007 and 2008 was successful made, and this page will include details on the process that was used.

Getting TIGER map data

Note: This was originally meant for 2006 data, but equally applies to 2005. There's a possibility that the TIGER import from 2007/2008 actually used 2006 data, however this has not been confirmed or denied by the original importer, Dave Hansen.

TIGER/Line data prior to 2007 was not available in Shapefile format, rather it used it used a proprietary ASCII format, so standard Shapefile tools and libraries can't be used.

The TIGER/Line data are contained in ZIP files that can be found here: http://www2.census.gov/geo/tiger/tiger2006se/

To find your county, look here: http://www.census.gov/geo/www/fips/fips65/data/national.txt

Champaign County, IL has an entry like this in that file:

IL,17,019,Champaign,H1

You can find its zip file here: http://www2.census.gov/geo/tiger/tiger2006se/IL/TGR17019.ZIP

You could also do something like this if you wanted to get a bunch of counties with the name "Middle" in them"

wget -O - http://www.census.gov/geo/www/fips/fips65/data/national.txt\
      | grep Middle | perl -pe 's#,#/TGR#' | perl -pe 's#,##' \
      | perl -pe 's#,.*#.ZIP#' \
      | awk '{print "http://www2.census.gov/geo/tiger/tiger2006se/" $1}'      \
      | xargs wget


Census 2000 Geographic Terms and Concepts:

United States
   Region
      Division
        State
          County
            County subdivision
               Place (or part)

http://proximityone.com/tgrcfcc.htm - TIGER/Line File Census Feature Class Codes (CFCC)

Ruby scripts

The follow details were provided back in 2007, and remain here for historical interest, or to help anyone who might want to re-produce TIGER processing work for other map projects. The scripts are no longer needed for any OpenStreetMap work. The import was completed a long time ago.

21 June 2007 - User:DaveHansen provided a summary of the status to the mailing list:

First of all, all of the actual TIGER parsing code here came from Brandon Martin-Anderson. All I did was spit out some OSM objects from the data he produced. He did all of the hard work.

This code takes a set of TIGER/Line ASCII files, and turns them into an OSM .xml file. That file can then be opened in JOSM and reviewed before uploading. If anyone just wants to look at their county, I'll be happy to run this for them and I'll just send you the .osm file. (dave [AT] sr71 [DOT] net)

You can get the code here: http://sr71.net/~dave/osm/tiger/

As of version 0.7, the tiger-to-osm software generates OSM data in the 0.4 format; this data can be converted to API v0.5 using 04to05.pl.

You can get the tiger shapefiles see #Getting TIGER shapefiles

But, don't go uploading anything produced with this [particularly now that the TIGER import has been complete for three years!]

sh tiger-zip-to-osm.sh zips/IL/TGR17019.ZIP

If you use that shell script, it does proper locking, and you can run multiple instances of the converter on a machine without duplicating work (it's SMP safe, effectively).

I feel like it is pretty darn slow. I guess that's mostly ruby's fault, but I'd appreciate any tuning tips that people have for performance tuning ruby. You'll need quite a bit of RAM to run this for any large-size counties. At least a gig, probably two. I put a machine out of memory pretty badly that had 8GB in it because I ran several instances of this at once, and it didn't have and swap.


Fixme: We have a page TIGER to OSM Attribute Map. The script currently follows this? or is that page confusing things?


Debian/Ubuntu Prerequisites

The following packages were required under Debian or Ubuntu:

  • procmail (provides 'lockfile', the locking program)
  • ruby
    • is it compatible with ruby1.9? if so it will run MUCH faster and be much beter on memory usage, ruby1.9 is WAY faster than ruby1.8 (current default)
  • unzip

Issues with this code:

  • memory consumption can be very large. It is worse on 64-bit machines, and can reach ~3GB for the largest counties in the country
  • it is slower than it could be
  • The shapefiles are very large and can overwhelm JOSM
  • The renderer does not support "unseparated" ways

Who worked on it?

  • Brandon Martin-Anderson - (badhill [AT] gmail [DOT] com) - Initial TIGER parsing code
  • User:DaveHansen - Took a wee bit of ruby code from SVN to start what I have now, but I've replaced almost all of it.

Various people discussing. See the mailing list discussions e.g recent mailing list discussion

See also