Author: Elhakim Ibrahim

Instructor: Corey Sparks, PhD1

February 14, 2020


Objective of the exercise

This exercise aims to show processes involved in transforming and projecting map from one coordinate reference system (e.g. geographic coordinate system) to another (e.g. projected map coordinate system). This conversion allows for intelligible projection and measurement of distance between locations.

Projections are mathematical transformations that facilitate conversion of locations on 3-D/curved surface of the earth to 2-D/flat surface representation. Basically, all projections are subject to distortions. Hence, it is important to select accurate system of projection that minimizes such distortions and maximizes accuracy.

The 2017 5-year American Community Survey (ACS)2 census tracts-level data for Bexar County, TX accessed from the US Census Bureau website were used for this exercise. Attempts are made to calculate distance between two census tracts based on below transformation and projection approaches:


Fig 1. Detailed map of Bexar County, TX


Set working directory and load required packages


Read in Bexar County tracts data

Getting data from the 2013-2017 5-year ACS
Downloading feature geometry from the Census website.  To cache shapefiles for use in future sessions, set `options(tigris_use_cache = TRUE)`.
Using the ACS Data Profile

Create new county FIP code and rename variables


Write data out to shapefile

Deleting layer `sa_tract_dp03_R' using driver `ESRI Shapefile'
Writing layer `sa_tract_dp03_R' to data source `C:/A/01/02S20/D093/H/01/D' using driver `ESRI Shapefile'
features:       366
fields:         7
geometry type:  Multi Polygon

Find coordinate reference system of current map

Coordinate Reference System:
  EPSG: 4269 
  proj4string: "+proj=longlat +datum=NAD83 +no_defs"

Measuring distance between locations

NAD83/South Central Texas CRS projection-based distance

Reproject map into NAD83/South Central Texas CRS

Select two tracts between which distance is to be measured

Get centroid coordinates for the two tracts

Warning in st_centroid.sf(reprjtracts2278): st_centroid assumes attributes
are constant over geometries of x

Measure distance between the tracts

Units: [US_survey_foot]
         [,1]     [,2]
[1,]     0.00 64043.26
[2,] 64043.26     0.00
NAD83/Texas Centric Albers Equal Area CRS projection-based distance

Reproject map into NAD83/Texas Centric Albers Equal Area CRS

Select two tracts between which distance is to be measured

Get centroid coordinates for the two tracts

Warning in st_centroid.sf(reprjtracts3083): st_centroid assumes attributes
are constant over geometries of x

Measure distance between the tracts

Units: [m]
         [,1]     [,2]
[1,]     0.00 19536.81
[2,] 19536.81     0.00

Comments on measured distances

Units: [US_survey_foot]
         [,1]     [,2]
[1,]  0.00000 12.12941
[2,] 12.12941  0.00000
Units: [m]
         [,1]     [,2]
[1,] 0.000000 3.700154
[2,] 3.700154 0.000000

As shown above, there is huge difference in distances resulting from the two projection systems. The NAD83/South Central Texas CRS projection-based distance (12.1 miles, comparably accurate distance) is approximately 3.3 times greater than NAD83/Texas Centric Albers Equal Area CRS projection-based distance (3.7 miles). The difference simply indicates that the NAD83/South Central Texas coordinate system is far more appropriate in projecting Bexar County locational data than the NAD83/Texas Centric Albers Equal Area coordinate system.

The values contained in geometry columns of tables below for the two coordinate systems reflect the extent of select locations misrepresentation by the NAD83/Texas Centric Albers Equal Area coordinate system of projection. This outcome highlights the importance of selecting appropriate coordinate reference system that best represents the locations of interest on earth surface in any projection exercise.

geoid name totpop ppov geometry
48029181820 Census Tract 1818.20, Bexar County, Texas 7137 11.8 c(2090862.01333421, 13758296.9389705)
48029110600 Census Tract 1106, Bexar County, Texas 5307 45.8 c(2125266.51457392, 13704279.6369517)
geoid name totpop ppov geometry
48029181820 Census Tract 1818.20, Bexar County, Texas 7137 11.8 c(1633963.04690383, 7274079.169566)
48029110600 Census Tract 1106, Bexar County, Texas 5307 45.8 c(1644586.04626573, 7257682.86807227)

Acknowledgements

  1. This content adapts steps and examples from instructional materials authored by Dr. Corey Sparks and made available at https://rpubs.com/corey_sparks.

  2. The ACS data are open source resources made available by the US Census Bureau at https://data.census.gov/.