Archive for September, 2011

Fixed the TIGER Georeference Loader Script

PostGIS in Action has a chapter on extensions to Postgres and PostGIS that might be helpful.  The first one they cover is a georeference tool for TIGER data.  The tool generates scripts that download an entire state’s worth of data, unzips it, and loads the appropriate tables into Postgres.  The book warned that the Linux version of the script was untested.  It was more than untested, it was a disaster.

At the top of the script it sets two PATH variables, one for where the data is to be downloaded to, the other to a temporary directory where the data will be unzipped to.  The destination path is quoted, quotes aren’t necessary but they don’t break anything if they’re there.  The temporary path only had the opening quote, no closing.  That will break things.

The TIGER is organized by state on the Census’s website.  In each state directory there are zip files with state level data, and subdirectories, one for each county in the state and they all contain multiple zip files.  The script had a for loop to unzip the county level zip files, but it skipped the state level.  And the for loop’s syntax was very, very wrong.

for z in *.zip; do $UNZIPTOOL -o -d $TMPDIR $z; done

for z in */*.zip; do $UNZIPTOOL -o -d $TMPDIR $z; done

The script only had the second statement, and it was missing the semicolons, the $z so unzip had no idea what it was supposed to unzip, and the done statement was missing.

After the data was unzipped and dumped into the temp directory shp2pgql and psql are used to dump the data into Postgres.  The first statement was missing a quote.  The psql statements were missing flags to tell it which database to use and which user was to be used to do the dumping.  The tables with county level data needed loops to run through each county’s set of data.  The loops had the wrong syntax again, they almost looked like the syntax for a Windows bat file, but even that syntax wasn’t quite right.

The book’s authors aren’t to be blamed for these errors.  The code was someone else’s and they clearly state that the linux portion of the code has not been tested or looked at.  I just wanted to document this so next time I use it I know what I did to get it working.


64 bit Flash plugin on Arch

The easiest way for now to get the latest and greatest 64 bit flash plugin for Arch is to use the flashplugin-beta package from AUR.  As I mentioned before I use the yaourt tool to install AUR packages, but check around and you might find another tool that works better for you.

Updated PostGIS 2.0 timeframe

The PostGIS team has updated the release timeline for 2.0.  Looks like the alpha will be out Decemberish, beta in January, and the final in mid Februaryish.  Shoot.

PostGIS 2.0 almost here!

September is here and PostGIS is right around the corner!  A few weeks?  A month?  Hopefully just a few weeks, there is some TIN stuff I want to try!  It will be OSGeo nerd Christmas!  Exclamation point!