Icon of Trevor

Trevor F. Smith: Geo Parsers

Location: Seattle
Keywords: sfbike, memex, speed reader, maps, ubicomp
Email: trevor@trevor.smith.name
Home: trevor.smith.name

I'm building a few applications which use the US Census TIGER/Line maps from the 108th Congressional District 2000 TIGER/Line Files, and in the process I've hand coded a few machine parsable files describing the file formats and type descriptions. I used these to generate a TIGER/Line parser and model, which I then use to generate maps of various types.

Because I don't think anyone should have to duplicate this effort, here are the files so that you might build your own system using the TIGER/Line data.

Easy to parse descriptions

Not so easy to parse code :-)

Here are two jars, one containing the code which I generated for parsing the 108th CS 2000 TIGER/Line file and a parser I whipped up for the USGS National Elevation Data BIL files generated from their fancy new National Map Seamless Data Distribution System. Please don't even look at these if you aren't a Java programmer who is willing to use early beta libraries. There are many great free GIS applications and toolkits out there for people who want to be users of this kind of data, so google for them if you are looking for end user tools.

That said, here are the source jar and the binary jar. They're GPL'ed so go crazy. Unpack the source jar and look at the (sadly incomplete) JUnit test cases for example uses of the APIs.

My suggestion is to use the source as an example of how one might parse TIGER/Line or BILs from the NED, and then use the description files listed above to build something specific to your needs. If I work on these any more I'll post new versions, but for the time being please consider these the last public version as I'm off on other projects now.

Proof is in the Pudding

Elevation BIL renders

This image shows a simple rendering (reversed, even) of a BIL file of San Francisco from the USGS NED. Using the same parser and simple rendering (where higher elevations are lighter) here is the Grand Canyon.

TIGER/Line chain renders

Here is a simple rendering of the line segments (AKA chains) of Athens, Georgia using the autogenerated parser running over the files listed above and run over the TGR13059 TIGER/Line file and another for NY,NY from the TGR36061 file.

I leave as an exercise for the interested reader such niceties as accounting for latitude and longitude rendering ratios and merging elevation and chain data in immersive fly-throughs.

Example uses:

The TIGERLine parser is in use my other project 93 Photo Street and you can see the parsing process in the CVS repository version of MapViewPanel.java (search for TLParser). Keep in mind that the parser doesn't do any interpretation of the data, but simply wraps a county file in a Java data structure for your use.

To see one way to render this data, check out MapRenderer.java.