Geographic Data Visualization Using Open-Source Data & R. Christopher N. Lawrence Texas A&M International University - Laredo, Texas



Similar documents
mapstats: An R Package for Geographic Visualization of Survey Data

MassArt Studio Foundation: Visual Language Digital Media Cookbook, Fall 2013

Reading & Writing Spatial Data in R John Lewis. Some material used in these slides are taken from presentations by Roger Bivand and David Rossiter

Package tagcloud. R topics documented: July 3, 2015

Quick and Easy Web Maps with Google Fusion Tables. SCO Technical Paper

New York City Neighborhood Tabulation Areas

Watershed Ecosystem & Restoration Services (WERS Mapping Application) User s Guide

Distributed Authoring Addendum Uploading Digital Assets

SimplyMap Canada Tutorial

INTRODUCTION to ESRI ARCGIS For Visualization, CPSC 178

HELCOM Data and Map Service. User Manual

Cookbook 23 September 2013 GIS Analysis Part 1 - A GIS is NOT a Map!

WFP Liberia Country Office

GeoLytics. User Guide for Business Demographics & Historical Business Demographics

Creating Maps in QGIS: A Quick Guide

Intel Centrino Mobile Technology

Getting Census Data into ArcMap or ArcView. Obtaining Shapefiles from ESRI and Data from the Census Bureau

Thematic Map Types. Information Visualization MOOC. Unit 3 Where : Geospatial Data. Overview and Terminology

Texas Wildfire Risk Assessment Portal (TxWRAP) User Manual. Texas A&M Forest Service

Realist 2.0 MLS Support (512) Monday thru Friday 9:00 am 5:00 pm

County of Los Angeles. Chief Information Office Preferred Technologies for Geographic Information Systems (GIS) September 2014

Products & Services Catalog

DEF SOFTWARE PRODUCT CATALOGUE 2009

WIN32TRACE USER S GUIDE

Data Visualization. Prepared by Francisco Olivera, Ph.D., Srikanth Koka Department of Civil Engineering Texas A&M University February 2004

Data Visualization. Brief Overview of ArcMap

Advances in the Application of Geographic Information Systems (GIS) Carmelle J. Terborgh, Ph.D. ESRI Federal/Global Affairs

Choosing the right GIS framework for an informed Enterprise Web GIS Solution

GIS III: GIS Analysis Module 2a: Introduction to Network Analyst

Sales Territory and Target Visualization with SAS. Yu(Daniel) Wang, Experis

2. Look for a link to ODESI data portal. In the Key Links section in the left side and double click ODESI Data Retrieval.

ArcGIS online Introduction Module 1: How to create a basic map on ArcGIS online Creating a public account with ArcGIS online...

Instructions for Creating a Poster for Arts and Humanities Research Day Using PowerPoint

Introduction to GIS.

Map Navigation Controls. An Interactive, Locally Based Knowledge Resource LivingstonLive.org/maps OR gisapps/livingstonviewerinternal

A Cardinal That Does Not Look That Red: Analysis of a Political Polarization Trend in the St. Louis Area

WEB MAPPING TOOL DOCUMENTATION

Racial and Ethnic Diversity in Anaheim

Geographic Information System Product Distribution Policies. Preface

ArcGIS Tutorial: Adding Attribute Data

OCAD smart for cartography A niche product towards a professional cartographic. software

Survey Designer USER MANUAL. Version 1.2

NatureServe s Environmental Review Tool

Beginning Tutorials. BT005 MAPS MADE EASY USING SAS Mike Zdeb, School of Public Health

R Graphics Cookbook. Chang O'REILLY. Winston. Tokyo. Beijing Cambridge. Farnham Koln Sebastopol

There are various ways to find data using the Hennepin County GIS Open Data site:

Mississippi Private Schools 2015

HydroDesktop Overview

How to Download Census Data from American Factfinder and Display it in ArcMap

Building Capacity to Use Infographic Tools

Tutorial 3: Working with Tables Joining Multiple Databases in ArcGIS

Tutorial Creating a regular grid for point sampling

ESRI Experience in the Use of GIS for Census Mapping Applications

Package GWmodel. February 19, 2015

Voter Turnout by Income 2012

designed and prepared for california safe routes to school by circle design circledesign.net Graphic Standards

Visualization of 2D Domains

REGIONAL SEDIMENT MANAGEMENT: A GIS APPROACH TO SPATIAL DATA ANALYSIS. Lynn Copeland Hardegree, Jennifer M. Wozencraft 1, Rose Dopsovic 2 INTRODUCTION

About Reference Data

TABLE OF CONTENTS. SECTION ONE: OVERVIEW... 4 Who are these guidelines for?... 4 What is a visual identity guideline?... 4

McAFEE IDENTITY. October 2011

Contouring and Advanced Visualization

ART 170: Web Design 1

Converting GIS Datasets into CAD Format

GEO 425, Spring 2012 LAB 3: Introduction to Web Map Services

U.S. ELECTION ASSISTANCE COMMISSION MEDIA AND PUBLIC RELATIONS. October 2007 MANAGEMENT GUIDE.

Government 1009: Advanced Geographical Information Systems Workshop. LAB EXERCISE 3b: Network

Reduce File Size. Compatibility. Contents

CSU, Fresno - Institutional Research, Assessment and Planning - Dmitri Rogulkin

Links. Blog. Great Images for Papers and Presentations 5/24/2011. Overview. Find help for entire process Quick link Theses and Dissertations

Personal Geodatabase 101

Navigating to Success: Finding Your Way Through the Challenges of Map Digitization

Storytelling with Maps: Workflows and Best Practices

SAS/GRAPH 9.2 ODS Graphics Editor. User s Guide

CHAPTER 13 STATE FRANCHISE FOR CABLE TELEVISION SERVICE SECTION.0100 GENERAL REQUIREMENTS

Petrel TIPS&TRICKS from SCM

My City Map Viewer Glossary, 2.1

Based on Chapter 11, Excel 2007 Dashboards & Reports (Alexander) and Create Dynamic Charts in Microsoft Office Excel 2007 and Beyond (Scheck)

LAR-IAC4 Status and User Group Meeting. October 8, 2015

Chapter 6: Data Acquisition Methods, Procedures, and Issues

Creating a File Geodatabase

Visualization of LODES/OnTheMap Work Destination Data Using GIS and Statistical applications

Introduction to Geographic Information Systems. A brief overview of what you need to know before learning How to use any GIS software packages

J9.6 GIS TOOLS FOR VISUALIZATION AND ANALYSIS OF NEXRAD RADAR (WSR-88D) ARCHIVED DATA AT THE NATIONAL CLIMATIC DATA CENTER

ArcGIS ArcMap: Printing, Exporting, and ArcPress

Transcription:

Geographic Data Visualization Using Open-Source Data & R Christopher N. Lawrence Texas A&M International University - Laredo, Texas

Why Use R? Do all of your analysis in the same environment. Easy reuse of data from statistical models. No need to learn or procure specialized GIS software. It's Free! (No cost to install, no licensing restrictions.)

Package Options There are several different add-on packages for R in CRAN that meet somewhat different needs. maps (+ mapdata, mapproj, gmaps) maptools The classint and RColorBrewer packages are also helpful for selecting color themes for maps.

Simple Maps with maps The maps package includes a map of the world, maps of several countries, and county-level maps of U.S. states. The mapdata package includes a map of China and a high-resolution world map with national boundaries. These maps are not projected by default; common projections are included in the mapproj package.

maps demonstration # Map showing the % of registered voters in each southern state # who were black 40 years pre-vra and 18 years post-vra # import the correct map data library(maps) library(mapproj) # this CSV file has lines like: # "State",1960,1984 # "South Carolina",11,28 # "Mississippi",4,26 black.voter.pct <- read.csv('black-pct-registered.csv') # create a list that matches up the data state.to.map <- match.map(map("state", black.voter.pct$state, plot=f), black.voter.pct$state) # create a single PDF file that includes both maps. # for inclusion in another document, create separate PDFs for each map with onefile=f. pdf("black-pct-registered-maps.pdf", height=6, width=8) palette(gray(40:0/40)) # create a grayscale palette x <- black.voter.pct$x1960[state.to.map] # note we use an Albers equal-area projection to make the map look sensible. # the parameters are the two true latitudes that will be the correct length map("state", black.voter.pct$state, fill=t, col=x, proj='albers', param=c(30,36)) title("percentage of blacks among registered voters, 1960") x <- black.voter.pct$x1984[state.to.map] map("state", black.voter.pct$state, fill=t, col=x, proj='albers', param=c(30,36)) title("percentage of blacks among registered voters, 1984") dev.off()

Mapping with shapefiles using maptools If R doesn't already include the boundaries you need, maptools is the answer. The maptools package supports most common formats, including ArcGIS shapefiles (.shp) which are the most common these days.

Where to get shapefiles The U.S. Census Bureau now publishes shapefiles of the United States and its territories for: Voting tabulation districts (voting precincts). Cities and counties. State legislative districts. U.S. House districts. Other sources include GeoBase for Canada and U.S. state GIS repositories.

maptools example # load the right packages library(maptools) library(rcolorbrewer) # Orleans Parish VTDs sppoly <- readshapepoly("tgr22071vot00", IDvar="VOTE00") # My data is in a separate file with the imaginative name dat load("governor.rdata") # Remap the Secretary of State's precinct numbering to the Census Bureau's format dat$p2 <- gsub('0?([0-9]+) 0?([0-9]+[A-Z]?)', '\\1-\\2', dat$precinct) # Match up rows o <- match(sppoly$vote00, dat$p2) mdat <- dat[o,] row.names(mdat) <- sppoly$vote00 newpoly <- spcbind(sppoly, mdat) # Set the projection here we can be simple (note this is really in the sp package) # see http://www.remotesensing.org/geotiff/proj_list/ proj4string(newpoly) <- CRS("+proj=longlat +datum=nad83") # Now draw away. pdf(file="votegraphs.pdf", onefile=t, width=7.5, height=9) greys <- brewer.pal(8, "Blues") # Here we actually plot four variables together; you could only plot one and make a simpler map! spplot(newpoly, c("jindalpct", "blackpct", "w.turnout", "b.turnout"), names.attr=c("jindal vote", "% of voters black", "White turnout %", "Black turnout %"), main="orleans Parish Vote, 2007 Gubernatorial Election", col.regions=greys, cuts=length(greys)-1, xlim=c(-90.15,-89.90), ylim=c(29.9,30.1), as.table=t) dev.off()

Challenges Matching your data to the names used in the GIS data is critical. For large areas (states, countries, or the world), you need to choose an appropriate projection. Unprojected maps look funny even to the untrained viewer. Selecting a good set of colors or gray scales for printed or projected work can also be challenging; the RColorBrewer package is designed to help.

Other Advice In both of the examples above, I produced PDF files rather than writing to the screen. You will usually get better output for use in other documents by producing PDF (useful for xelatex/pdflatex) or SVG files rather than saving from an R graphics window. As maps are vector format, writing to a GIF or PNG file is not recommended unless you are creating a map for the web.

Percentage of blacks among registered voters, 1960

Percentage of blacks among registered voters, 1984

Jindal vote % of voters black 1.0 0.8 0.6 White turnout % Black turnout % 0.4 0.2 0.0