4

Does anyone know how to extract a roads shapefile for the US Census circa 2000?

The only file I can find from US Census (e.g. https://www2.census.gov/geo/tiger/tgrcd108/CA/tgr06037.zip for Los Angeles) is in RT format.

My questions are:

  1. Does the RT files contain the county-based "roads" layer (all roads, described here pp3.)?
  2. If so, which RT file is it and how to extract the roads?

Related:

https://gis.stackexchange.com/questions/21573

Also, GDAL seems to have a driver:

https://www.gdal.org/drv_tiger.html

But I can't find example code in Python or anything for using the driver to extract roads.

6
  • 1
    RT1, and the best option I found was in R. ArcGIS data interoperability addin treats the roads as wrong CRS. Note these are edges not roads so have railroad, hydro flags too.
    – SMiller
    Commented May 18, 2019 at 3:09
  • 1
    Python examples for 20-year old formats are a bit of a challenge.
    – Vince
    Commented May 20, 2019 at 14:44
  • tinlyx are you OK with an R-based solution? Also, recommend you review the output before proceeding to ensure it is as you expect; note there are a large amount of dangles in these datasets (at least the ones I viewed) that do not appear in later years.
    – SMiller
    Commented May 20, 2019 at 14:58
  • @smiller Yes, a R solution would be welcome, as long as it gets the complete shapefiles for roads
    – tinlyx
    Commented May 20, 2019 at 16:37
  • @Vince Python examples for 20-year old formats are a bit of a challenge.- shapefiles are more than 20 years old too.. Plus, the solution I am looking for is not limited to python. R, PostGIS and others are perfectly fine as long as they can get the job done. After all, this is TIGER/line we are talking about. I think there should be a well-known method to convert it to the current GIS format if not by US Census.
    – tinlyx
    Commented May 20, 2019 at 16:42

2 Answers 2

5

QGIS has a built-in driver for the TIGER data, as you've noted, through GDAL. This is exposed through the GUI in the Data Source Manager/Add Vector layer dialogs. Similarly to how one would load ArcGIS File GeoDatabases, you toggle the radio button to Folder and choose the appropriate driver under the Type drop-down menu.
QGIS Data Source Manager - Browser - Vector - Directory - U.S. Census Tiger/Line

Target the extracted contents of the TIGER2k zip file (hopefully extracted into their own directory), and you'll see the list of contents enumerated by the driver. Choose what subset (or choose the entire list) to load.
Select layers to add menu showing enumerated contents of tgr06037

Once you confirm your data to be loaded, QGIS will draw it on the map.
QGIS Screenshot showing drawn data

From here you can continue to interact with the data, save it out to another format (I highly recommend Geopackage), or otherwise be done with it. Please note that according to the GDAL driver notes, the TIGER RT data are not capable of updates/editing themselves.

I've attached a link to a 7z of a GeoPackage with the TIGER2k CA TGR06037 dataset.
TGR06037.7z - OneDrive

1
  • Roads are in the CompleteChain layer.
    – SMiller
    Commented May 20, 2019 at 15:07
3
+50

The following code uses R to open the appropriate layer from TGR files for roads and saves it as a shapefile format.

I added additional steps within R to filter for just the roads in the code I used to convert all of the county-based road files, but it may be faster to perform that step within your preferred GIS application after it's in shapefile format; I left this stage out. Note that per the OpenStreetMap wiki, the roads have a CFCC code starting with A.

It is possible to open the TGR files in ArcGIS 10.x(?) using the Data Interoperability Extension, however it treated the dataset as WGS84 instead of NAD83 when I tried in 10.5. (It's still a good way to review the dataset.)

if (!require(rgdal)) install.packages("rgdal")
library('rgdal')
tiger <- readOGR("tigerpathandfilename.RT1", "CompleteChain")
# Write out shapefile of the line dataset
outputpath <- "youroutputpathhere"
outputname <- "yourfilename.shp"
writeOGR(tiger, dsn = outputpath, outputname, driver = "ESRI Shapefile",
         overwrite_layer=TRUE)
print("Output Shapefile Created")
1
  • Thanks a lot! I'll try your solution out. I tried ArcGIS first, but maybe I didn't install the necessary extension. And it's time-consuming to get extensions installed in my organization.
    – tinlyx
    Commented May 20, 2019 at 18:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.