Last active
August 29, 2015 14:24
-
-
Save albert-decatur/d3d5b4b1b8621a552c4b to your computer and use it in GitHub Desktop.
processing TIGER/Line roads
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# download them all | |
wget -ci <( baseuri="ftp://ftp2.census.gov/geo/tiger/TIGER2014/ROADS/"; escaped_baseuri=$(echo "$baseuri" | sed "s:\/:\\\/:g" | sed "s/:/\\\:/g"); lftp -e 'find;exit' "$baseuri" | sed "s:^:${escaped_baseuri}:g" ) | |
# make single text file of unique FULLNAME roads names | |
find_ext zip | parallel -j2 'tmp=$(mktemp -d); unzip -d $tmp {} $(basename {} .zip).dbf; dbfdump --fields FULLNAME $tmp/*.dbf | grep -vE "^\s*$"; rm -r $tmp' | grep -vE "(Archive|inflating)[:]" | sed '1 i\FULLNAME'| sortfreq > ~/fullname_uniq.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment