Geospatial Data

Maps part I

STAT 133 with Gaston Sanchez

Intro

Geographic Data

A collection of “objects” on which we have information about their geographic location (and possibly other variables or attributes)


Examples of “objects” on Campus:

  • Bike racks
  • Trees
  • Green areas
  • Buildings
  • Swimming pools
  • Loop stations
  • Bus stops
  • Fire hydrants
  • Bathrooms
  • ETC

Example: Bike Racks on Campus

A single unit of geographic data includes:

  • Location (where): given by a set of coordinates.
  • Attributes (what): data that describe the location
    • year of installation
    • material(s)
    • capacity (# bikes)
    • maintenance

Objects (e.g., bike racks) visualized in some kind of map.

How do we know that those coordinates reference that specific location?

Coordinate Reference Systems (CRS)

Coordinate Reference System (CRS)


A Coordinate Reference System, or CRS, is a system for associating coordinates with a specific, unambiguous location on the surface of the Earth.

Two Types of CRSs


Geographic CRS

Angular Units = Degrees

Projected CRS

Cartesian Units = Feet or Meters

Coordinate Reference Systems (CRS)

There are many CRS, not just one!

Why? Because our understanding of and ability to measure the shape of the earth has changed over time.

Geographic Coordinate Systems (GCS)

Widely used. Expressed as latitude & longitude. Two common GCS are:

WGS84 (EPSG: 4326)

  • Based on satellites, used by cell phones, GPS
  • Best overall fit for most places on earth

NAD83 (EPSG: 4269)

  • Based on satellites and survey data
  • Best fit for USA
  • Used by many federal data products, like Census data

Projected Coordinate Systems (PCS)

  • Map Projections transform geographic coordinates (lat/lon) to 2D coordinates (X/Y)
  • All map projections introduce distortion in area, shape, distance or direction.
  • Specific map projections minimize distortion in one or more properties
  • You need to know the coordinate reference system of your input data
  • You need to select the CRS that is most suitable for your data and application.

Projected Coordinate Systems (PCS)

In short …

The Earth is not Flat!

  • But computer screens, paper maps and most of the math underlying spatial analysis methods assume it is!
  • We use map projections to transform geographic coordinates from a 3D model of the earth to a 2D plane.
  • This makes location data much more usable BUT …
  • It introduces distortion.
  • You need to understand how this distortion impacts your maps and spatial analysis!

Types of Spatial Data

Which representation is better A or B?

01:30

Mapping the World in 2 styles

There are two fundamental spatial data models:

Vector Data

Vector Data Geometries

Note: The term “Vector Data” as used in geospatial literature is different to the notion of “vectors” in R.

Vector Data Geometries and Attributes

Vector Data with Attributes

Each row represents one geospatial feature.

Attributes describe the features (fields or columns).

Each feature has an associated geometry or geometry collection.

A group of features is called a layer.

Raster Data

Raster Data

Raster Data (regular grids)

A location is represented by a grid cell.

Cells have regular size, e.g. 30x30m.

Grid has dimension - fixed number of rows and columns.

Each cell has a value that represents the attribute of interest, e.g. elevation.

Vector Data -vs- Raster Data

Vector data are better for discretely bounded data, e.g. bike racks, rivers, political boundaries, etc.

Raster data are better for continuous data, e.g. temperature, elevation, rainfall, etc.

Some Common File Formats

Vector Data

  • Shapefile (.shp)
  • GeoJSON, JSON
  • KML (keyhole markup language)
  • GeoPackage

Raster Data

  • GeoTIFF
  • netCDF
  • DEM

Vector example: California Wildfires

Raster example: Soil Moisture

Raster example: Normalized Difference Vegetation Index (NDVI)

Your Turn

Question:

Vector or Raster?

00:18

Question:

Vector or Raster?

00:18

Question:

Vector or Raster?

00:30