One of the great things about the Beyond 2020 web software for the CTPP 2012/16 is the
ability to export GIS-ready “shapefiles” for use in your GIS applications. This works very
well for limited numbers of geographic areas, say anywhere from one to a couple of
thousand pieces of geography. I’m not sure what the upper limit on geographic areas it can
export? Perhaps 5,000?
But the downside of the shapefiles exported from Beyond 2020 is that the output variables
are given names like F0 to F35. Maybe there’s a magic button in Beyond 2020 that provides
“mnemonic” variable names in the exported shapefiles? I can’t seem to find it.
Mnemonic variable names are basically memory clues as to what the variable is about:
“transit” is probably transit commuters. “Total” is probably the total number of
commuters, persons, households, etc., depending on the data universe. “VHH1_WHH0_est” is
(obvious to me) “estimate of households with one vehicle and zero workers."
I wrote a R script that imports the shapefile’s DBF file (exported from Beyond2020);
renames the variables to something more useful; adds a few extra variables; and exports a
new DBF file. I’m also writing out csv and Excel workbooks, since I might use them for
other analytical tasks.
Attached is my R script. It’s basic purpose is to read a DBF file, rename the varibles,
add a few new variables, and write out DBF, csv, and XLSX file.
It’s using California county (n=58) for the workplace table A202105: Means of
Transportation to Work (18 categories.) The process works, and I’m able to import these
GIS files into QGIS with the renamed variables.
Well, only a few more hundred tables to go!!
Any advice or hints on how to improve on this process would be welcome!
cheers,
Chuck Purvis
Hayward, Califora
Show replies by date