spatial data

types of spatial data

  • “space” is generally 2D (\(\mathbb{R}^2\); could be surface of a sphere)
  • also: networks, trees, lattices, …
  • features: points, polygons, lines (and collections thereof); rasters
  • also: continuous or categorical values associated with features
    • counts (disease incidence) or continuous values (GDP) associated with polygons (countries/provinces/counties)
    • values associated with grid cells (digital elevation models)
    • points (locations of murders)

transformations/summarization

e.g. 

  • points to density fields (2D kernel density estimation)
  • points to polygon values (square or hex binning)
  • fields to polygons (contouring)
  • point values to fields (interpolation; akima does bicubic/bilinear)

typical plots

spatial data challenges

spatial data and colour

  • colour issues are much more salient for spatial data
  • big blocks of colour
  • often use colour gradients for continuous data
  • continuous vs segmented, appropriate endpoints (background)
  • ColorBrewer project, RColorBrewer package

primary packages for spatial data manipulation

  • sf (“simple features”): tidy spatial data (web page)
  • maptools

spatial plotting challenges

  • top of Cleveland hierarchy (x,y coordinates) are used up
  • insets (Alaska/Hawaii etc.)
  • map decoration
  • representing uncertainties: Correll, Moritz, and Heer (2018), MacEachren et al. (2005), Koo, Chun, and Griffith (2018), Bolin and Lindgren (2017)
  • not misrepresenting areas (e.g. cartograms: Perrier (2019), Höhle (2016))
  • linking?

primary R packages

  • maps (base-R maps, some basic spatial data sets)
  • ggmap (maps in ggplot, including downloading data from google maps etc.)
  • leaflet (map widget)
  • tmap (an alternative ggplot-like approach: see here)
  • mapcan (political maps for Canada)

References

Bivand, Roger S., Edzer Pebesma, and Virgilio Gómez-Rubio. 2013. Applied Spatial Data Analysis with R. 2nd ed. New York: Springer.

Bolin, David, and Finn Lindgren. 2017. “Quantifying the Uncertainty of Contour Maps.” Journal of Computational and Graphical Statistics 26 (3): 513–24. https://doi.org/10.1080/10618600.2016.1228537.

Correll, Michael, Dominik Moritz, and Jeffrey Heer. 2018. “Value-Suppressing Uncertainty Palettes.” In Proceedings of the 2018 CHI Conference on Human Factors in Computing Systems, 1–11. Montreal QC Canada: ACM. https://doi.org/10.1145/3173574.3174216.

Höhle, Michael. 2016. “Cartograms with R.” Theory Meets Practice. http://staff.math.su.se/hoehle/blog/2016/10/10/cartograms.html.

Koo, Hyeongmo, Yongwan Chun, and Daniel A. Griffith. 2018. “Geovisualizing Attribute Uncertainty of Interval and Ratio Variables: A Framework and an Implementation for Vector Data.” Journal of Visual Languages & Computing 44: 89–96.

MacEachren, Alan M., Anthony Robinson, Susan Hopper, Steven Gardner, Robert Murray, Mark Gahegan, and Elisabeth Hetzler. 2005. “Visualizing Geospatial Information Uncertainty: What We Know and What We Need to Know.” Cartography and Geographic Information Science 32 (3): 139–60.

Perrier, Victor. 2019. “dreamRs/Topogram.” dreamRs. https://github.com/dreamRs/topogram.