Lecture Content

Note: Document prepared for Spatial Socioeconometric Modeling and materials build on Lovelace, Nowosad, and Muenchow (2019) and Medina and Solymosi (2019)

1 Vector and Raster data

vector data represents the world using points (e.g., buildings, houses), lines (e.g., rivers, roads) and polygons (e.g., states, counties, ZCTAs, tracts)

raster data divides Earth’s surface up into cells of constant size. Have been a vital source of geographic data since the origins of aerial photography and satellite-based remote sensing devices. It is more computationally expensive.

Social scientists rely more often on vector data becuase it captures social dynamics more accurately (buildings, settlements). Raster data is more useful to model nature (montains, elevation).

This course relies on vector data, unless only raster data are available to address our research questions.

1.1 Foundational concepts

Georeferenced objects enable

  • add a distinct perspective on the world.

  • a unique lens through which to examine events, patterns, and processes.

  • concern what happens where, and makes use of geographic information that links features and phenomena on the Earth’s surface to their locations

1.1.1 Different concepts when it comes to spatial information

  • Place: neighbourhood, the city, the state, or the country.

  • Attributes: any recorded characteristic or property of a place (e.g., name, number of crimes, GDP).

    • These are variables (numeric of alphanumeric) in a database that are linked to a place that is georeferenced.
  • Objects are the operationalization of* places which are part of a Coordinate reference system (CRS) representing geolocated or georeferenced points that can be linked together to form more complex geometries such as lines and polygons.

    • Points: pairs of coordinates, in latitude/longitude or some other standard system

    • Lines: ordered sequences of points connected by straight lines

    • Areas or polygons: ordered rings of points, also connected by straight lines to form polygons.

Objects representation in vector data, see Medina and Solymosi (2019)

Objects representation in vector data, see Medina and Solymosi (2019)

2 Coordinate Reference Systems

2.1 Geographic coordinate systems

Identify any location on the Earth’s surface using two values — longitude and latitude

  • Longitude is location in the East-West direction in angular distance from the Prime Meridian plane
    • Vertical mapping lines AKA meridians
    • show/measure how far a location is east or west of a universal vertical line called the Prime Meridian (runs vertically, north and south British Royal Observatory in Greenwich)
    • The Prime Meridian is numbered 0 degrees longitude
    • There are 180 vertical longitude lines east and 180 vertical longitude lines west
  • Latitude is angular distance North or South of the equatorial plane (run parallel to the equator).
    • How far north or south of the equator a place is located.
    • The equator is the starting point for measuring latitude–that’s why it’s marked as 0 degrees latitude.
    • The number of latitude degrees will be larger the further away — up to \(\pm\) 90\(^{\circ}\)
Latitude (y-axis) and Longitude (x-axis) Source Illinois State University

Latitude (y-axis) and Longitude (x-axis) Source Illinois State University

  • Lat/Long works with a numbered grid system, like what you see when you look at graph paper.
    • A location can be mapped or found on a grid system simply by giving two numbers which are the location’s horizontal and vertical coordinates (their intersection)
Example of intersections, source encyclopedia britannica

Example of intersections, source encyclopedia britannica

2.2 Map projections

  • Map projections try to portray the surface of the earth or a portion of the earth on a flat piece of paper or computer screen.

  • The decision as to which map projection and coordinate reference system to use, depends on the regional extent of the area

  • Maps, are representations of reality.

    • The three main groups of projection types
      • planar,
      • conic, and
      • cylindrical.

Projection families Medina and Solymosi (2019) * For data modeling purposes, as conducted in this class, most projections will already come in planar form.

3 Sources of objects and attributes (next week!)

For this section we will rely on the following packages

## Loading required package: sp
## Loading required package: spData
## To access larger datasets in this package, install the spDataLarge
## package with: `install.packages('spDataLarge',
## repos='https://nowosad.github.io/drat/', type='source')`
## Loading required package: sf
## Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1
## To enable 
## caching of data, set `options(tigris_use_cache = TRUE)` in your R script or .Rprofile.
## Loading required package: stringr
## Loading required package: XML
## 
## Attaching package: 'acs'
## The following object is masked from 'package:base':
## 
##     apply

Recall that we have the following georefenced objects:

Simple feature types and their respective ‘multi’ versions see Lovelace, Nowosad, and Muenchow (2019)

Simple feature types and their respective ‘multi’ versions see Lovelace, Nowosad, and Muenchow (2019)

However, lines are seldomly used in social sciences research. So, we will focus on polygons and points. The following commands build upon Walker (2020)

3.3 Reading polygons at the ZCTA level:

## Warning in proj4string(obj): CRS object has comment, which is lost in output

Trim to the contiguous USA

## [1] 33144

Reading zip code of a particular state or group of states

## Warning in proj4string(obj): CRS object has comment, which is lost in output

3.4 Reading polygons at the tract level

## Warning in proj4string(obj): CRS object has comment, which is lost in output

3.5 Reading polygons at the block level:

## Warning in proj4string(obj): CRS object has comment, which is lost in output

4 Point geocoding in R is a work in progress

Back in the day, it was sort of straigthforward…

Nowadays is cumbersome and mostly dissapointing.

Since R inline geocoding ain’t good, I usually rely on free resources that are quite powerful, such as GPS Visualiser.

However, let’s try out the newest, (not so great) tool.

##  [1] "404 South Upham St., Lakewood, CO, 80226"                                               
##  [2] "1400 Washington Avenue, Albany, NY, 12222"                                              
##  [3] "476 Hubbard Drive, Lancaster, SC, 29720-0889"                                           
##  [4] "1910 University Dr, Boise, ID, 83725"                                                   
##  [5] "2000 Westmoreland Street, Suite A, Richmond, VA, 23230"                                 
##  [6] "100 College Boulevard, Niceville, FL, 32578-1295"                                       
##  [7] "6191 Kraft Avenue S.E., Grand Rapids, MI, 49512-9396"                                   
##  [8] "2383 Cherry Road, Rock Hill, SC, 29730"                                                 
##  [9] "639 38th St, Rock Island, IL, 61201-2296"                                               
## [10] "1156 Barranca, El Paso, TX, 79935-5538"                                                 
## [11] "1624 Woodworth NE, Grand Rapids, MI, 49525-2473"                                        
## [12] "15400 Sherman Way, Suite 101, Van Nuys, CA, 91406"                                      
## [13] "2211 W Germann Road, Chandler, AZ, 85286"                                               
## [14] "1111 Hwy 75, Macy, NE, 68039-0428"                                                      
## [15] "2345 Southwest 3rd Street, Suite101, Grand Prairie, TX, 75051-4892"                     
## [16] "14555 Potomac Mills Rd, Woodbridge, VA, 22192-6808"                                     
## [17] "One University Plaza, Youngstown, OH, 44555-0001"                                       
## [18] "5171 Eisenhower Parkway, Macon, GA, 31206-5309"                                         
## [19] "1000 S. Fremont Ave. Mailbox #45, Bldg A10, 4th Floor, Suite 10402, Alhambra, CA, 91803"
## [20] "501 West College Drive, Brainerd, MN, 56401-3900"
## No results found for "Ross Medical Education Center-Grand Rapids North bar".
## No results found for "Kenneth Shuler School of Cosmetology-Rock Hill bar".
## No results found for "International Baptist College and Seminary bar".
## No results found for "Fortis College-Richmond bar".
## No results found for "University of South Carolina-Lancaster bar".
## No results found for "Colorado Media School bar".
## No results found for "California Institute of Advanced Management bar".
## No results found for "Brightwood College-Los Angeles-Van Nuys bar".
## No results found for "Nebraska Indian Community College bar".
## No results found for "Mid Cities Barber College bar".
## No results found for "Altierus Career College-Woodbridge bar".
## No results found for "International Business College-El Paso bar".
## [1] 0.4

5 Next week we will add data to these shells

References

Lovelace, Robin, Jakub Nowosad, and Jannes Muenchow. 2019. Geocomputation with R. CRC Press. https://geocompr.robinlovelace.net/.

Medina, Juanjo, and Reka Solymosi. 2019. Crime Mapping in R. Open Access rmarkdown/bookdown. https://maczokni.github.io/crimemapping_textbook_bookdown/.

Walker, Kyle. 2020. Tigris: Load Census Tiger/Line Shapefiles. https://CRAN.R-project.org/package=tigris.