NR 218

NR 218

Use arrows or menu in bottom left corner to navigate amongst slides.

Assorted Links

Syllabus Spring 2026 Section 03
Short Reading on Computers

Lab Assignments
Lab 1
Lab 2
Lab 7
Lab 8
Lab 10
Lab 11
Lab 12
Lab 14
Lab 15
Project

NR 218 - Introduction

Class Details

Building 180 (Baker)
Room 230

Monday: 9:10 - 1:00
Wednesday: (9:10 - 12:00)

Instructor Details

Michael Huggins
Office Hours: Mondays 2:00 - 4:00
Building 72-107 (Plant Conservatory)

Learning Goals

  • How to formulate and answer problems using spatial data
  • How to create quality maps and graphics
  • Apply skills in remote sensing, GIS, and data science to solve a problem
  • Understand basic principles of GIS

Active Learning and Growth Mindset

  • This class will be challenging - learning new skills is hard
  • Recognize that you won’t be good immediately
    • Mastery takes time and repetition
  • Ask for help!
    • Internet, classmates, professor
    • Try not to rely on AI

  • Don’t be afraid to mess up
  • Crash the computer, it’s ok!
  • Think critically and logically, don’t get frustrated
  • There will be lots of hands-on work time in this class
  • Suggest bringing laptop if you have one

Try not to rely on AI

  • AI generated text may not be used for any writing .
  • It is ok to seek AI assistance for project work, but it is important to consider that AI has the potential to make you stupid and waste your time!
    • Depending on AI prevents development of critical thinking, writing, and problem-solving skills
    • AI will sometimes lead you down a terrible, deep rabbit hole of confusion
    • Getting quick answers without working through problems will leave gaps in foundational knowledge needed for advanced coursework
    • The struggle of working through difficult concepts is often where the most valuable learning occurs

That is not to say LLMs are never useful or appropriate to use, but you need to know its limitations.

Class Icebreaker

Three things in common

  • Get is small groups
  • Take 5 minutes to identify three things you have in common with each other
    • Choose intresting things. The stranger, the better
    • Boring examples:
      • “We are a forest and fire sciences majors”
      • “We are all from Southern California”

Computers

What is a computer

A machine that manipulates data following a list of programmed instructions

Image of an old but cool looking computer

Image Source: Wikimedia commons

Data

  • “Related items of (chiefly numerical) information considered collectively, typically obtained by scientific work and used for reference, analysis, or calculation.”
  • “Quantities, characters, or symbols on which operations are performed by a computer, considered collectively. Also (in non-technical contexts): information in digital form.” -OED
  • Data is stored on a computer as zeros and ones .
  • Data is stored at some physical location on the disk, and a pointer is saved which is later used to find the file.
  • The details of this are managed for you by applications or programming languages by representing this relationship as a path.

Schematic showing pointer to a file or memory address

A pointer (a) pointing to the memory address associated with a variable (b), i.e., a contains the memory address 1008 of the variable b. In this diagram, the computing architecture uses the same address space and data primitive for both pointers and non-pointers; this need not be the case.

Image Source: Wikimedia /Sven

Schematic showing pointer to a file or memory address

Family tree of modern general purpose operating systems. With the exception of Windows (which derives from MS-DOS) all widely used modern general purpose OSs are based on UNIX.

File Paths and Directories

Annoying Windows File Explorer Defaults

By Default Windows Fiel Explorer hides file extensions. To fix this,

  1. Open File Explorer
  2. Click View > Show > File name extenions

Terminals and Shells

  • Linux: terminals use; /bin/bash, /bin/zsh, or others under POSIX conventions.
  • macOS: ships with Terminal.app and zsh by default; still Unix-like, so scripts often mirror Linux.
  • Windows: historically lacked a POSIX shell; now offers multiple terminal hosts (Command Prompt, PowerShell, Windows Terminal) with different shells.

POSIX - Portable Operating System Interface is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems

The Windows Terminal Dumpsterfire

  • Command Prompt (cmd.exe): legacy DOS-style environment with limited scripting features.
  • PowerShell: Kind of acts like bash or zsh.
  • Git Bash / MSYS2: provides GNU functionality inside Windows; paths need translation.
  • Environment-specific shells: Anaconda Prompt, Anaconda Powershell, OSGeo4W Shell, etc., inject toolchains and custom env vars; each behaves slightly differently.

Command Prompt (cmd.exe) is haggard

  • Command language rooted in DOS; minimal quoting, no pipelines beyond simple |.
  • Lacks native concepts like environment exports.
  • Encoding quirks (Code Page 437 vs UTF-8) cause unexpected character issues.
  • File globbing and path separators differ (\ vs /), breaking cross-platform scripts.

PowerShell vs Bash

In Many cases PowerShell behaves similarly to Bash

  • paths can be written using / as separator
  • home directory can be reached using ~

but not always

  • PowerShell is object-oriented: pipelines pass .NET objects, not plain strings.
  • Bash pipelines stream text; tools like cat, grep, awk compose seamlessly.  
    • Example (Bash):
    cat access.log | grep "GET /api" | wc -l
    • PowerShell equivalent:
    Get-Content access.log | Select-String "GET /api" | Measure-Object | Select-Object -ExpandProperty Count

Differences in tree command across platforms

On Unix like systems, like Mac OSX and Linux, by default tree shows files.

.
├── PoorlyNamedFiles
│   ├── basin.geojson
│   ├── do not put spaces in filenames.geojson
│   ├── Junk
│   │   └── toadstools
│   └── xp23_99.csv
├── README.md
└── WellNamedFiles
    ├── cal_median_household.csv
    ├── Eaton_Perimeter_20250121.geojson
    └── san_simeon_creek_basin_4326.geojson

In PowerShell, files are omitted by default

.
├── PoorlyNamedFiles
│   └── Junk
└── WellNamedFiles

In order to show files in PowerShell use the F flag, tree /F

├── PoorlyNamedFiles
│   ├── basin.geojson
│   ├── do not put spaces in filenames.geojson
│   ├── Junk
│   │   └── toadstools
│   └── xp23_99.csv
├── README.md
└── WellNamedFiles
    ├── cal_median_household.csv
    ├── Eaton_Perimeter_20250121.geojson
    └── san_simeon_creek_basin_4326.geojson

Zipped Files

What is a zip file? A zip file is a compressed archive. Zipping a folder full of sub-directories and files compresses the data (makes it take up less memory) while preserving the directory structure. When you unzip, or extract the data you get back an uncompressed copy. Zipped files are smaller, so they are good for transferring data, or long term storage when the data is not in use.

Do not work directly with files compressed in a zip! .While QGIS and other applications can read files from inside of a zip, it is a bad idea to do so. There are many processing tools that cannot work with the compressed file. Often you will get part of the way through a workflow and try some step of your analysis, only to get an error about unsupported file types.

To unzip:

  • Windows (GUI): In File Explorer, find the .zip, right-click → “Extract All…,” choose your desired destination folder, click Extract.
  • macOS (GUI): In Finder, double-click the .zip to expand it, then drag/move the extracted folder into your destination folder.
  • Linux (terminal): cd ~/Downloads (or wherever it landed), then run unzip SPR_data.zip -d <destination directory> (replace <destination directory> with your actual destination directory. Install unzip if missing: sudo apt install unzip).

Data storage - A superficial Overview

Data Storage

  • We store data in computer-readable format in files
    • Sometimes files store data as text (often called human readable files)
    • Other times there are just 1s and 0s (binary file)
    • Even the human readable files are ultimately stored as 1s and 0s (more on that)

Data Storage

File extensions denote files readable by certain programs, for example:

Extension description
filename.txt text file
filename.doc Microsoft Word file
filename.pdf portable document file
filename.html hypertext markup language
filename.xml extensible markup language
filename.tif tagged image format
filename.json javascript object notation
filename.geojson geographic json
filename.laz LASer zip
filename.parquet compressed table

File types

  • Computer programs only read certain file formats.
  • Familiarity with different file types is helpful.
  • QGIS has several of its own file types
    • Project files: .qgz, .qgs
    • Styling/symbology: .qml
    • Layout templates: .qpt
    • Layer definitions: .qlr
    • Project companion database: .qgd
  • Common GIS data file types: .shp (along with its sidecar files .prj, .shx, .dbf, etc), .kml, .tiff, .gpkg, .json, .geojson, .txt, .hdf, .nc, .parquet and a few others

File Paths and Directories

File Organization and Computer Hygiene

Be kind to your future self - keep your files organized:

  • Use directories (a.k.a folders)
  • Use descriptive names:
    • e.g. slo_county_26910.geojson not county.geojson
  • Don’t put spaces in file or directory names (see this)

How to Organize your files

  • Pick a convention and be consistent
  • For example:
/Work/NR_classes/
├── Class1/
│   └── ...
├── NR218/
│   ├── Project_1/
│   │   └── ...
│   └── Project_2/
│       ├── Vector/
│       │   ├── trees.parquet
│       │   └── streams.geogjson
|       ├── Raster/
│       │   ├── dem.tif
│       │   └── rainfall.h5
│       ├── qgis/
│       │   └── project_2.qmd
│       └── Results/
│           ├── Figures/
│           │   ├── figure1.png
│           │   ├── figure2.png
│           │   └── map.png
│           └── proj_2_report.doc

Cloud Storage

Many options, but mounting Cal Poly One Drive as a disk is is probably the simplest.

See the Cal Poly tutorial here or try this, for Linux users or the computer savvy.

Tips for Mac Users

Making your home directory visible in Finder

  • To show your home directory in macOS Finder, open Finder and press Shift+Command+H

  • To add it to the sidebar drag the folder icon (at the top of the window) into the sidebar.

Installing QGIS on Mac

There are some bugs in recent versions of QGIS on Mac.

  • QGIS 4.0 hangs up and crashes while opening on some Macs (I think Macs with intel processors work ok, but the newer Apple Silicon based Macs do not). Here is the link to the issue on GitHub. If 4.0 works on your computer, then great, problem solved. If not read on.
  • QGIS 3.4xx Is missing proj.db, and thus cannot do anything related to Raster reprojection, which renders it more or less useless. Here is the link to the issue on GitHub.

It is possible that one or both of these issues will be resolved soon, but we cannot depend on that. The best solution currently is to use the older version 3.34. Unfortunately there is no archived QGIS 3.34 macOS .dmg in the QGIS old releases archive. So, options are

  • [Easy] Use the lab computer
  • [I have not tested] Using homebrew try brew install --cask qgis (see Installing Homebrew)

Installing Homebrew

  1. go to the Homebrew website
  2. Copy the command for installing Homebrew and paste into your terminal (and press enter), it should look something like
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

(This just downloads the install.sh file and executes it, installing Homebrew)

  1. Follow the prompts, enter your password (you will not be able to see it as you enter it).

  2. There may be a message about “Next steps”. You can ignore that.

Installing tree command

In terminal brew install tree. (If Homebrew is not yet installed see Installing Homebrew.)

Terminal Cheat-Sheet

Table of some basic commands

Command zsh bash PowerShell
Change Directory cd cd cd
List Files ls ls ls
Make Directory mkdir mkdir mkdir
Copy cp cp cp
Move / Rename mv mv mv
Show First Lines of File head head Get-Content -Head 10

Some examples

Task zsh / bash PowerShell
Go to your home directory cd ~ cd ~
Go to the course directory cd ~/nr218 cd ~\nr218
List files in the current directory ls ls
List files in nr218 ls ~/nr218 ls ~\nr218
Make a new directory mkdir ~/nr218/lab_1 mkdir ~\nr218\lab_1
Make several directories mkdir ~/nr218/lab_2 ~/nr218/lab_3 mkdir ~\nr218\lab_2, ~\nr218\lab_3
Make nested directories mkdir -p ~/nr218/project_1/data mkdir ~\nr218\project_1\data
Copy a file into a directory cp ~/nr218/notes.txt ~/nr218/lab_1/ cp ~\nr218\notes.txt ~\nr218\lab_1\
Move or rename a directory mv ~/nr218/lab_1 ~/nr218/lab_01 mv ~\nr218\lab_1 ~\nr218\lab_01
Show the first 10 lines of a file head ~/nr218/README.md Get-Content ~\nr218\README.md -Head 10

What is GIS Why is it important

What is GIS?

Computer-based tools used to store, visualize, analyze, and interpret geographic data

OR
Collection of computer hardware, software, data, personnel, and work procedures to store, update, manipulate, analyze, and display all forms of geographic information.

Application Domains

GIS is useful is many domains, for example:

  • weather forecasts
  • navigation
  • delivery logisitics
  • apps (e.g. Strava!)
  • disaster response
  • infrastructure monitoring
  • climate monitoring / modeling
  • urban/regional planning
  • architecture
  • archaeology
  • geography
  • social sciences
  • (geo)physics
  • hydrology
  • biology
  • ecology
  • etc…

:::

Why use GIS

Monitor and understand our planet

Planning

Disaster Response

Software

  • This class will be taught using QGIS.
  • Software changes - We will focus on building an understanding of the concepts that will allow you to successfully use any GIS software.
  • I might show examples of analysis using other tools, particularly Python.

There are many other common (GUI based) GIS software platforms:
- ESRI (ArcGIS suite)
- GRASS
- Google Earth Engine
- Google Earth Pro
- ENVI
- SAGA
- etc…

There are also command line tools
- GDAL
- PDAL
- WhiteBox Tools

Additionally, GIS can be performed using scripting languages
- Python
- R
- Javascript
- Julia

Software - benefits of open source

  • Available to you, for free, forever (even after Cal Poly)
  • It’s free, as in liberty. If you need extra functionality in QGIS, you can do more than just hope it will be included in the next release. You can sponsor the development of a feature, or add it yourself if you are familiar with programming.
  • Compatible with any operating system (Windows, Mac, Linux)
  • Collectively advances human knowledge / progress
  • Commonly used in many organizations
  • Easier to learn ArcGIS after QGIS than the other way around

Interesting Maps

Some basic GIS Concepts

Location

  • Position
  • A position on the surface of the earth
  • How do we define a location?
    • Nominal location - By name
      • Helsinki, Finland
      • Appalachia
    • Relative
      • Oakland is east of San Francisco
    • Absolute Location - can be defined using Coordinates
      • Postal Code
      • X,Y,(Z) is the Cartesian coordinate system
      • Latitude and Longitude are the (non-projected )Geographic Coordinate System

Direction

The angle from feature or phenomenon on the surface of the earth relative to some reference point

  • Egocentric location, to my left
  • Landmark direction, towards the mountain

In geography and GIS, there are three standard benchmarks that are used to define the directions:

  • True north is towards the point at which the axis of the earth’s rotation intersects the earth’s surface in the norther hemisphere

  • Magnetic north is towards where the Earth’s magnetic fields merge in the the norther hemisphere

  • Grid north is the northward direction of the grid lines of latitude and longitude on a map

  • btw, currently North is South!
  • Magnetic and Geomagnetic poles?

Distance

  • The separation between locations

    • Nominal (e.g. close/far) or Absolute (1 kilometer)
  • Cartesian distance on a flat surface is easy:
    \[ D = \sqrt{(x_{2} - x_{1})^{2} + (x_{2} - x_{1})^{2}} \]

  • Distance on a 3-Dimensional surface is complicated. We will discuss it later

Space

Space is kind of an ambiguous term.

For GIS we are often interested in topological space

  • Positional relationships between places / nodes /objects
  • e.g. subway map

GIS

All GIS systems have a database that can relate spatial-data and attribute data.

  • Spatial data is made up of points, lines, polygons, etc… which represent locations or features in the real world, e.g. a linestring representing a river.

  • Attributes are data associated with the features, e.g. the population of a city.

Layers

Models representing different aspects of the physical world

Attributes

OBJECTID GlobalID type source poly_DateCurrent mission incident_name incident_number area_acres description FireDiscoveryDate CreationDate EditDate displayStatus geometry
0 3025 04ba1d01-c043-478f-ad62-e7eeb903cf09 Heat Perimeter FIRIS 2025-01-01 05:39:02.359000+00:00 CA-SBC-OAK-N40Y Oak None 41.998143 FIRIS Perimeter NaT 2025-01-01 05:37:18+00:00 NaT Inactive POLYGON ((-120.24304 34.88387, -120.24302 34.8...
1 3026 4551a5e4-e94d-46e2-9aac-73cc4314c946 Heat Perimeter FIRIS 2025-01-02 05:16:55.340000+00:00 CA-SDU-BORDER1-N40Y None None 16.911501 FIRIS Perimeter NaT 2025-01-02 05:13:35+00:00 NaT Inactive MULTIPOLYGON (((-116.82928 32.59686, -116.8293...
2 3027 2b1329f3-5b39-4c0e-ad34-1250e436e0e1 Heat Perimeter FIRIS 2025-01-07 22:11:19.142000+00:00 CA-LFD-PALISADES-N57B None None 771.572356 FIRIS Perimeter NaT 2025-01-07 22:09:29+00:00 NaT Inactive MULTIPOLYGON (((-118.55013 34.06195, -118.5501...
3 3028 a766c1b5-1d8e-43b3-9aac-02358de18d35 Heat Perimeter FIRIS 2025-01-07 23:17:35.698000+00:00 CA-LFD-PALISADES-N57B None None 1261.520779 FIRIS Perimeter NaT 2025-01-07 23:13:25+00:00 NaT Inactive MULTIPOLYGON (((-118.55013 34.06195, -118.5501...
4 3029 72049d43-03fe-4cc1-899a-fe2eb43934e7 Heat Perimeter FIRIS 2025-01-07 23:17:39.454000+00:00 CA-LFD-PALISADES-N57B None None 1261.520779 FIRIS Perimeter NaT 2025-01-07 23:13:25+00:00 NaT Inactive MULTIPOLYGON (((-118.55013 34.06195, -118.5501...

Attributes of assets/CA_Perimeters_CAL_FIRE_NIFC_FIRIS_public_view.geojson

Right-click layer –> Open Attribute Table

Map Types

There are a few types of maps:

Mental Maps

  • Psychological tools that we all use every day.
  • Stored in our brain
  • To get from one place to another, or to understand and situate events that we hear about
  • Reflect the amount and extent of geographic knowledge and spatial awareness that we possess

Using a blank sheet of paper, take five minutes to draw a map from memory of San Luis Obispo

Reference - shows location information, often represent geographic reality accurately, topographic maps for example

Reference - shows location information, often represent geographic reality accurately…

But not always. A subway map is also a reference map. It represents topological relationships accurately in a schematic way for ease of navigation

Thematic - shows how one or more factors are distributed across space, such as a map of malaria infection rates

USGS Topographic Map of Boulder, CO

Subway map - topological diagram for navigating a system

European GDP

Dynamic / Interactive
- maps that change depending on user input

Show code
from pathlib import Path

import folium
import geopandas as gpd

aoi_path = Path('assets/Eaton_Perimeter_20250121.geojson')
aoi = gpd.read_file(aoi_path)

# grab centroids
c = aoi.to_crs(epsg=26910).dissolve().centroid.to_crs(epsg=4326).item()

# map
map = folium.Map(
  location=[c.y, c.x],
  tiles='OpenStreetMap',
  zoom_start=12
)

# perimeter
geo_j = folium.GeoJson(data=aoi.__geo_interface__,
  style_function=lambda feature: {
    'color': 'red',
    'weight': 2,
    'fill': False,
    },
    name='Fire Perimeter'
  ).add_to(map)
# layer control

map
Make this Notebook Trusted to load map: File -> Trust Notebook

:::

What is data? (What are data?)

  • “Related items of (chiefly numerical) information considered collectively, typically obtained by scientific work and used for reference, analysis, or calculation.”
  • “Quantities, characters, or symbols on which operations are performed by a computer, considered collectively. Also (in non-technical contexts): information in digital form.” -OED

What is information?

  • “The imparting of knowledge in general.”
  • “Knowledge communicated concerning some particular fact, subject, or event; that of which one is apprised or told; intelligence, news.”
    -OED

What is Spatial Data?

Data with a geographic and/or spatial component.

What is Metadata

Data about the data, e.g. units, date collected, instruments used…

Scale, Coordinate systems, and Map Projections

Map Conventions

Mapping conventions facilitate effective conveyance of information. In most cases using them is a good idea (but not necessarily always)

The Blue Marble photograph in its original orientation.

South’s up!

Map Scale

The factor of reduction of the world so it fits on a map

  • You need to shrink things to make a map
  • On reference maps it is generally important to include a scale bar
  • Representative fraction (RF) describes scale as a simple ratio
    • The numerator, which is always unity (i.e., 1), denotes map distance.
      The denominator denotes ground or “real-world” distance.
    • unit neutral
    • Large vs small, 1:1,000 > 1:1,000,000
    • Large shows more detail

Map Scale

Coordinate systems

  • Frameworks that are used to define unique positions
  • Geographic coordinate system (GCS) is most commonly used framework for defining locations on three dimensional models of Earth
  • GCS is based on a sphere or spheroid (a.k.a. ellipsoid)
  • GCS units are degrees
    • Latitude \(\in 0^\circ, 90^\circ\) (or \(-90^\circ, 90^\circ\))
    • Longitude \(\in 0^\circ, 180^\circ\) (or \(-180^\circ, 180^\circ\))
  • Degrees can be written in degrees-minutes-seconds (DMS) or in decimal degrees (DD).

DMS to DD conversion

128° 40’ 52.0428” W

128° 40’ 52.0428” W

128° 40’ 52.0428” W

128° 40’ 52.0428” W

128° 40’ 52.0428” W

128

128 + (40 / 60)

128 + (40 / 60) + ( 52.0428 / 60\(^{2}\) )

-128.68112299

The negative is important! SLO vs. off the coast of Shandong

Spheroids and Geoids

A geoid is an approximation of the true shape of the earth

    \(\circ\) As defined by its gravitational field rather than its topography 1

    \(\circ\) Gravitational field found by finding equipotential surfaces

    \(\circ\) The geoid is the specific equipotential surface that best approximates mean sea level (MSL) on a global basis

    \(\circ\) MSL diverges from the geoid by up to 2 m in places.

Spheroids and Geoids

The geoid is pretty complex…

so the surface is approximated using a spheroid (also called an ellipsoid of revolution)

A GCS is based on a reference model of the Earth, usually a sphere or spheroid (ellipsoid)

Datums

  • A datum is a spheroid with an origen point and orientation aligning it for a particular use.

Image Source: Manny Gimond

  • A local datum matches a geoid to an ellipsoid to fit a local context, e.g.
    • NAD27 (North American Datum of 1927) is widely used in the U.S., especially in older maps.
    • ED50 (European Datum of 1950) is common in Western Europe.

Image Source: Manny Gimond

  • A geocentric datum aligns the centroid of the geoid to the center of the ellipsoid

Image Source: Manny Gimond

  • Common datums used in North America
Datum Type Typical use in North America
NAD27 Local Legacy U.S., Mexico, and Central America maps
NAD83 Regional geocentric* Standard for most modern U.S. and Canadian mapping
NAD83 (2011) Regional geocentric High-accuracy modern U.S. realization of NAD83
WGS84 Global geocentric GPS and global web mapping

* NAD83 is Earth-centered in concept, but regionally realized and not identical to a fully global geocentric frame.

Projections

  • Mathematical transform for transforming 3D Earth to 2D map
  • i.e. project the latitude and longitude to x any coordinates on a plane
  • There are infinite ways to do this, they all cause distortion

Projections

Imagine a lightbulb inside of the earth, shining out and projecting the shadows of the continents onto a developable surface (flattenable surface).

There are three commonly used developable surfaces

  • plane
  • cone
  • cylinder
  • The developable surface can be oriented in many ways.
  • Each developable surface can be in one of two cases tangent and secant
  • The aspect of the projection is the orientation of the developable surface relative to the axis of the earth

Tissot’s indicatrix

Shows linear, angular, and areal distortions of maps

Equidistant projections

  • Maintains distance between points in one direction (usually north-south)
  • Angles and shapes are not preserved
  • Good for small-scale maps that cover large areas
  • Often used for global thematic maps

Conformal map projections

  • Preserve angles (also known as bearings) between locations
  • Used for navigational purposes
  • Areas tend to be quite distorted
  • Shapes are more or less preserved over small areas, at small scales areas become wildly distorted
  • e.g. Mercator projection (with normal aspect) is famous for distorting Greenland

Equal area or equivalent projections

  • Preserve area
  • Distort angles

Weird projections

  • Often made as compromises between types of distortion
  • Like the Waterman Butterfly

Left: circles of equal area on globe. Right: same circles on Mercator projection.

Top: True-color satellite image of Earth in equirectangular projection.
Bottom: Equirectangular projection with Tissot’s indicatrix.


Top: Nautical Chart of Lake Superior in Mercator projection. Bottom: Mercator projection.

Real-time Waterman Wind Map

UTM

Universal Transverse Mercator (UTM)

  • a projection and accompanying projected coordinate system
  • Divided into 60 narrow zones
  • Does not cover polar regions*
  • Large north-south extent with low distortion

*Polar Stereographic is for used for conformal polar

Image Source: wikimedia

  1. Open QGIS
  2. Use QuickMapServices to add a global Satellite coverage layer.
  3. In the drop down menus, go to Project –> Preferences then select the CRS tab on the left
  4. In the filter box type “26910”
  5. Under Predefined Coordinate Reference Systems select NAD83 / UTM zone 10N
  6. Click Apply and OK

State Plan System

Each State Plane Coordinate System zone uses a map projection based on its geographic orientation.
e.g.

  • Transverse Mercator Projection
  • Lambert Conformal Conic Projection
  • Hotine Oblique Mercator Projection

  • Reproject the global satellite image from the last slide to EPSG:2227 (California zone 3)
  • Scroll to zoom in on South Africa. What do you notice?

Tutorial - (not so) Quick Intro to QGIS

  1. Download SPR_data.zip here (right-click and “save link as”)
  2. Extract the file (Linux, Windows, Mac), and place in appropriate file location (Remember, organize your files!)
  3. Open QGIS

Open the files from the directory you just extracted

Method 1

  1. Use the file location in the ‘Browser’ panel
  2. Drag and and drop files into the Layers Panel

Method 2

  1. Press ctrl-shift-v (cmd-shift-v on Mac)
  2. Click to browse for file then click .
    • You can select multiple files at once when browsing
    • Close window when finished.

Now the layers should be visible in the panel, and on the map

  • Toggle on/off layers by clicking checkboxes
  • Change layer order by dragging within panel
  • What do the little icons between the check and the layer name mean?
  • Right click a layer, select Open Attribute Table
  • Select rows of attribute table by clicking on the left edge (where they are numbered)
    • Note that the corresponding features are highlighted on the map

Panning and zooming (The mouse wheel also zooms while in pan mode)

Select tools

Info

Basemaps

  1. Click Plugins –> Manage and install Plugins
  2. Search for QuickMapServices
  3. Click Install Plugin
  4. Now on the right there should be a Search QMS bar
  5. Search for satellite
  6. Pick one (ESRI is a good choice, or Bing)

Symbology - categorized

  • Right click the “sprLanduse” layer
    • Go to properties
      • Select the symbology tab
  • Experiment with basic symbology
    • Right click the “sprLanduse” layer
      • Go to properties
        • Select the symbology tab
          • From the dropdown menu, select “categorized”
            • Select “LUtype” from the “Value” dropdown menu, and click “Classify”

Symbology - Numerical

  • Experiment with numerical symbology
    • Right click the “sprSoil” layer
      • go to properties
        • Select the symbology tab
          • From the dropdown menu, select “Graduated”
            • Select “KFACTOR” from the “Value” dropdown menu
              • click “Classify”, then “Apply”

Other elements

Use the Add Item dropdown, or the left side toolbar to add a scale bar, and north arrow

Coordinate Grids

  • Be sure you have the Map item selected in the items box.
    • Select the Item Properties tab
      • Scroll down and expand Grids
        • Click green + Button to add grid
          • Click Modify Grid
            • Enter “0.03” for the X and Y intervals
              • Check the Draw Coordinates box to label grids with coordinates.

Export map

  • Once you have something satisfactory, create an export of your map to share.
    • Layout > Export as image
      • Choose file type
        • Set save location

Open the image file we just saved to verify results

What Are some problems here

A quick intro to geospatial data

Human readable vs. binary files

Human Readable

  • file.txt
  • file.csv
  • file.xml
  • file.docx1
  • file.json
  • filename.py

Binary

  • filename.pdf
  • filename.tif
  • filename.laz
  • filename.parquet
  • filename.pyc

Delimiters

Data entries in many text files are separated by a delimiter, such as a comma, tab, space, etc. They also generally have a header describing the contents of each row. For example a csv is a comma delimited file:

  • file.csv
OBJECTID,GlobalID,type,source,poly_DateCurrent,lon,lat
3025,04ba1d01-c043-478f-ad62-e7eeb903cf09,Heat Perimeter,FIRIS,2025-01-01 05:39:02.359000+00:00,-120.244,34.8824
3026,4551a5e4-e94d-46e2-9aac-73cc4314c946,Heat Perimeter,FIRIS,2025-01-02 05:16:55.340000+00:00,-116.83,32.5974
3027,2b1329f3-5b39-4c0e-ad34-1250e436e0e1,Heat Perimeter,FIRIS,2025-01-07 22:11:19.142000+00:00,-118.548,34.058
3028,a766c1b5-1d8e-43b3-9aac-02358de18d35,Heat Perimeter,FIRIS,2025-01-07 23:17:35.698000+00:00,-118.547,34.0589
3029,72049d43-03fe-4cc1-899a-fe2eb43934e7,Heat Perimeter,FIRIS,2025-01-07 23:17:39.454000+00:00,-118.547,34.0589

Reading a CSV

OBJECTID,GlobalID,type,source,poly_DateCurrent,lon,lat
3025,04ba1d01-c043-478f-ad62-e7eeb903cf09,Heat Perimeter,FIRIS,2025-01-01 05:39:02.359000+00:00,-120.244,34.8824
3026,4551a5e4-e94d-46e2-9aac-73cc4314c946,Heat Perimeter,FIRIS,2025-01-02 05:16:55.340000+00:00,-116.83,32.5974
3027,2b1329f3-5b39-4c0e-ad34-1250e436e0e1,Heat Perimeter,FIRIS,2025-01-07 22:11:19.142000+00:00,-118.548,34.058
3028,a766c1b5-1d8e-43b3-9aac-02358de18d35,Heat Perimeter,FIRIS,2025-01-07 23:17:35.698000+00:00,-118.547,34.0589
3029,72049d43-03fe-4cc1-899a-fe2eb43934e7,Heat Perimeter,FIRIS,2025-01-07 23:17:39.454000+00:00,-118.547,34.0589

link to file (right-click and “save link as”)
Tip: Remeber, file organization!

This csv is adapted from CA Perimeters CAL FIRE NIFC FIRIS public view.

Reading a CSV with QGIS

link to file (right-click and “save link as”)

Either Layer --> Add Layer -->> Add Delimited Text Layeror press control V (command V on Mac)

Reading a CSV with QGIS

Delimited text dialogue box

Browse for csv

Notice that it says CRS must be selected.

What is a CRS?

  • We will discuss what a CRS is in great detail later.
  • For now just know it provides a reference frame for placing the coordinates on the map.
  • Coordinate Reference System (CRS) is synonymous with Spatial Reference System (SRS)
  • SRS = CRS

Click the Geometry Definition dropdown to assign an SRS.

Use EPSG:4326 - WGS 84

Click Add

Spatial Data Models and Formats

Data Overview

What are Data?

  • “Facts, measurements, and characteristics of something of interest.”
  • “Facts and statistics collected together for reference or analysis.”

What is Information?

  • “Facts provided or learned about something or someone.”
  • “Knowledge and insights that are acquired through the analysis of data.”

What are Spatial Data?

  • “Data that describe the geographic and spatial aspects of phenomena.”
  • “Facts and statistics collected together for reference or analysis.”

What are Metadata?

  • Data about the data
  • Ex: units, what instruments were used, who/what/when/where/how the data was collected

Data Types

  • Data can have different types

    • Ex: How might “population” data differ from “county” data?
  • The most common types of data available for use in a GIS are:

    • Bools - True / False statements (think off/on switch)

    • Strings - Alphanumeric text denoted by quotes (e.g. “Lake Tahoe”)

    • Numbers - numerical values (e.g. latitude/longitude coordinates)

      • Integers (ints) - numerical values (8 bit or 16 bit precision)
      • Floating Point (float) - negatives, decimal values (32 bit precision)

Continuous vs Discrete Data

  • Continuous data consists of numerical values
  • Discrete data consists of a limited number of possible values, groups, or categories
    • In some cases could be represented with integers
    • Could be some continuous quantity chopped into bins, e.g. income as “high”. “middle”, “low”

Levels of Measurement

  • Nominal - Names or identifiers of objects
  • Ordinal - Ranked categories based on a measure
  • Ratio - have a 0 value that indicates absence of the quantity of interest
  • Interval - have a regular scale, but not a meaningful 0 value

Nominal - Names or identifiers of objects

e.g. Land Cover: “Oak Woodland”, “Grassland”, “Forest”, etc…

Ordinal - Ranked categories based on a measure

e.g. Fire Hazard: “Low”, “Medium”, “High”

Ratio - Multiplication makes sense, e.g. 200 K is twice as hot as 100 K \[ 2 \times 100 \mathrm{K} = 200 \mathrm{K} \]

Interval - Multiplication does not make sense, e.g. 200°C is not twice as hot as 100°C \[ 2 \times 100°\mathrm{C} \neq 200°\mathrm{C} \]

Image Source: wikimedia

Geospatial Data Types: Vector vs. Raster

Vector Data

  • Can be described by points, lines, polygons
    • Ex: roads, rivers, train tracks, hiking trails, sidewalks, building footprints, county boundaries
  • NOT images, do NOT contain any pixels
  • The kind of data we’ve been working with so far

  • Often stored as tabular data files with geographic metadata
  • Points, lines, and polygons represent the spatial features
  • Topology describes the connectivity, area definition, and contiguity of interrelated points, lines, and polygon

Points

  • Zero-dimensional objects containing a single coordinate pair.
    • Ex: Lat, Lon (sometimes elevation) coordinates denoting a city, building, address, etc
  • X,Y (,Z) coordinates on a Cartesian plane (or Euclidean space)

Lines

  • One-dimensional objects composed of multiple, explicitly connected points.
  • Lines have the property of length.
  • Also called an “arc.”

Polygons

  • Two-dimensional features created by multiple lines to create a “closed” feature.
  • First point on the first line segment is the same as the last point on the last line.
  • Can represent city boundaries, buildings, lakes, soils, etc.
  • Have the properties of area and perimeter.

Structuring Vector Data

  • There are several ways to define relationships between vector data:
    • Feature based: The “Spaghetti Model”

      • Each feature is a long string of coordinates
      • No relationships between features
    • Structured: The “Topological Model”

      • Enforced relationships between features

Some Common Vector File Formats

Format File Extension Stores Topology Binary / Human Readable Notes
Shapefile .shp (+ .shx, .dbf, .prj) No Binary Common, but aging
GeoJSON .geojson, .json No Human Readable Web-friendly, text-based
GeoPackage .gpkg No Binary Modern SQLite-based format
KML/KMZ .kml, .kmz No Human Readable (.kml) / Binary (.kmz) Google Earth format
TopoJSON .topojson Yes Human Readable json, Encodes topology
PostGIS (database) Yes (optional) Binary PostgreSQL spatial extension
File Geodatabase .gdb Yes (optional) Binary ESRI proprietary format, annoying to use in other software
GeoParquet .parquet No Binary Column-oriented, efficient

How to open gdb in QGIS

  1. Download 3D Hydrography Program data for the CONUS

    gdb
    metadata(Optional)

  2. Unzip the zip. (Unless you plan to use it later, you can just unzip it into the Downloads folder where the zip sits)

  3. Press ctrl-shift-v (cmd-shift-v on Mac)

    1. At the top, under “source type”, check the directory box.
    2. Browse for and select 3dhp_all_CONUS_20250313_GDB.gdb where you unzipped it.
    3. Click Add

Discussion

  • What vector type (point, line, or polygon) best represents the following features:

    • state boundaries,
    • telephone poles,
    • buildings,
    • cities,
    • stream networks,
    • mountain peaks,
    • soil types,
    • flight tracks?
  • Which of these features can be represented by multiple vector types?

  • What conditions might lead you choose one vector type over another?

Raster Data

Raster Data

  • Derived from a grid-based system of contiguous cells containing specific attribute information.
  • The spatial resolution of a raster dataset represents a measure of the precision or detail of the displayed information.
  • Widely used by technologies such as digital images and LCD monitors.

  • Images, stacks of images (satellite / drone image)
    • Rastrum, Latin meaning “scraper” –> Raster, German meaning “screen”
  • Grids of numbers
  • Things with pixels!
  • If it’s pixelated:
    • It’s a raster
  • If it’s a photo:
    • It’s a raster
  • If it’s a digital image
    • It’s a raster!

  • The spatial resolution of a raster dataset represents a measure of the precision or detail of the displayed information.
    • a.k.a. pixel size
    • Ex: 1mm, 1cm, or 1m
  • So when you hear that a camera has N megapixels - this just means it has many millions of pixels

Spatial Resolution

The spatial resolution of a raster dataset represents a measure of the precision or detail of the displayed information.

The spatial resolution of a raster dataset represents a measure of the precision or detail of the displayed information.

Stop here, below is incomplete

Spectral Resolution

Image Source: Neon

Image Source: Neon

Image Source: Neon

Image Source: NASA

Image Source: University of Texas at Austin, Center for Space Research via ESA

Working with Sentinel 2 Data

as well as

More Spectral Indices

What is Sentinel 2

Sentinel 2 is a mission run by the Copernicus Programme (the EU Space Program’s Earth observation component)

  • Multispectral imagery
  • Multiple Satellites 180 \(\deg\) out of phase with one another
  • 5 day revisit (at equator)
  • Wide swath width (290 km)

Image Source: Copernicus

Sentinel 2 Bands

Band Name Central wavelength (nm) Resolution
B1 Coastal aerosol 443 60 m
B2 Blue 490 10 m
B3 Green 560 10 m
B4 Red 665 10 m
B5 Red Edge 1 705 20 m
B6 Red Edge 2 740 20 m
B7 Red Edge 3 783 20 m
B8 NIR 842 10 m
B8A Narrow NIR 865 20 m
B9 Water vapor 945 60 m
B10 SWIR-Cirrus 1375 60 m
B11 SWIR 1 1610 20 m
B12 SWIR 2 2190 20 m

Oil Spill detection

\(OSI = \frac{1}{3} \times \frac{Green + Red}{Blue}\)

Another common combination

\(B3 + B8 + B11\) or \(Green + NIR + SWIR1\)

Image Source: Sentinel Hub

Similarity to Landsat

Satellite Spatial resolution Number of bands Revisit time
Sentinel-2 (A/B) 10 m, 20 m, 60 m (band-dependent) 13 5 days (with both satellites)
Landsat (8/9 OLI/TIRS) 30 m multispectral, 15 m panchromatic, 100 m thermal (resampled to 30 m) 11 8 days (with Landsat 8 + 9; 16 days each alone)

Image Source: Copernicus

What are those Landsat thermal Bands Used For?

Use case What thermal bands provide Example outputs
Land surface temperature (LST) mapping Surface radiant temperature LST maps (deg C), heat patterns
Urban heat island analysis Spatial temperature contrasts across built vs vegetated areas Hotspot maps, neighborhood heat exposure
Wildfire and burn analysis High-temperature anomalies and post-fire thermal response Active fire/hotspot detection support, burn severity context
Evapotranspiration (ET) estimation Temperature input for surface energy balance (e.g., SEBAL/METRIC/SSEBop) ET (mm/day), crop water use
Agricultural water stress Canopy/soil temperature elevation under water stress Stress maps, irrigation prioritization
Drought monitoring Persistent surface warming and reduced evaporative cooling Drought severity indicators
Water temperature studies Thermal state of lakes/reservoirs/coastal zones Surface water temperature maps
Geothermal/volcanic monitoring Persistent anomalous heating Thermal anomaly detection
Energy balance / climate studies Sensible vs latent heat partitioning signals Flux estimates, land-atmosphere diagnostics

Finding GIS Data

Tutorial - Copernicus Browser

  • Open Copernicus Browser (right click to open in new tab)

  • First, make an account!

    • registration is free and helps track use of the tool (and manage processing quotas)

You should see something like this when it first opens:

To register, click the “Login” button at the top of the left panel

Follow the steps to register, confirm your email, and then go back to the main page.

Now let’s get a feel for what the tool can do!

Look at the Garnet Fire on CalFire inciweb.

  • In Copernicus Browser (in visualize mode), paste the lat, lon into the search, hit enter
  • Change the date to 2025-09-07
  • Adjust image so the fire is in view

  • Lets try a different visualization
  • Copernicus offers a SWIR based composite visualization that is quite good for burn detection.

  • That is a nice way to visualize but for actual detection purposed using a spectral index is better
  • Normalized Burn Ratio (NBR) is the most obvious choice here. \[ \begin{align} NBR &= \frac{NIR - SWIR2}{NIR + SWIR2} \\ &= \frac{B8 - B12}{B8 + B12} \; \mathrm{(For Sentinel 2)} \end{align} \]

Exercise - Create and download a NBR geotiff for before and after the fire.

Spectral Indices

Index Formula Sentinel-2 Purpose
NDVI (NIR - Red) / (NIR + Red) (B8 - B4) / (B8 + B4) Vegetation health
NDWI (Green - NIR) / (Green + NIR) (B3 - B8) / (B3 + B8) Water detection
NDMI (NIR - SWIR1) / (NIR + SWIR1) (B8 - B11) / (B8 + B11) Vegetation moisture
NBR (NIR - SWIR2) / (NIR + SWIR2) (B8 - B12) / (B8 + B12) Burn severity
NDSI (Green - SWIR1) / (Green + SWIR1) (B3 - B11) / (B3 + B11) Snow cover
SAVI 1.5 × (NIR - Red) / (NIR + Red + 0.5) 1.5 × (B8 - B4) / (B8 + B4 + 0.5) Soil-adjusted veg.

For more indices / detail see Montero et al. (2023) Sci Data 10:197

Tutorial - Google Earth Engine

Another incredibly powerful tool at our disposal is Google Earth Engine

  • Cloud-based, so it can handle high intensity data processing

  • Free1 access to a large collection of datasets

Step One - Registering for GEE

  • We want to register a new project

  • Name your project something useful, then hit create
  • Next, we want to register the project for non-commercial use

This will take you to a form where you can confirm your eligibility. Here’s an example of how to fill it out:

Now let’s go back to the Code Editor.

These are the main panels to be aware of:

Step Two - Editing and Running a Script

  • In the scripts panel, select New > File and name it something useful
  • You should see it show up under the Owner dropdown:
  • Click on the file to open it, and then move to the Code Editor. It should be blank to start.

  • Let’s try running some code! In the editor window, type the following command:
  • Then hit run. Look at the console - what do you see?

Now let’s try something a little more complicated:

// Note - lines that start like this (//) are comments, meaning they won't be run like regular code

// These are the 5 largest cities in the world: 
// Tokyo, Delhi, Shanghai, Mexico City, Sao Paulo

// Create a list named 'largeCities' with the names of all the above cities

var largeCities = ['Tokyo', 'Delhi', 'Shanghai', 'Mexico City', 'Sao Paulo']; 

// Print the list 

print(largeCities)

Copy the code above and paste it into your code editor, hit run, and explore the output in the console.

Next, we’re going to explore some spatial data.

  • In the search bar at the top of page, type in “California Polytechnic State University”
  • Click on the search result, and the map view should update accordingly

Add a marker to the map by clicking this icon:

Place the point somewhere in the middle of campus:

  • At the top of the code editor, you should now see a new var called “geometry”, which gives us the coordinates of our point

  • We can now reference the point in new lines of code, like we did with “largeCities”

  • To add in other data layers, let’s look in the Earth Engine Data Catalog
  • Using the search bar, find the Sentinel-2 Dataset and click on the Level-1C option
  • Scroll down to the “Explore with Earth Engine” section, and copy the JavaScript code
  • Go back to the code editor, and paste the code onto a new line

Before we run it, let’s make a few changes to the code.

  • First, let’s change these dates to be more recent:

  • Pick a month in 2025, and set the dates to be the first and end of the month
  • Next, let’s change the center point of the map to the point we dropped earlier:

  • Replace the entire line with the following code:
Map.centerObject(geometry, 12);
  • Alternatively, you can just replace the first two numbers with the coordinate values saved to “geometry”

Hit run, and watch what happens in the map viewer! It may take a second for the layer to load.

What is this code doing?

  • The quality of satellite imagery can be significantly affected by the cloud cover on any given day
  • To compensate for this, it can be helpful to generate a composite image of only the days with clear visibility over a month

  • From here, we could clip (or mask, in the case of raster images) the Sentinel image to a set boundary by uploading a shapefile or geojson
  • We can also export map layers, which will be saved to our Google Drive

Google Earth Engine QGIS Plugin

There is also a GEE plugin for QGIS!

We can do the same operation we just did through the plugin:

Vector Operations

Vector Data (Review)

  • Can be described by points, lines, polygons
    • Ex: roads, rivers, train tracks, hiking trails, sidewalks, building footprints, county boundaries
  • NOT images, do NOT contain any pixels

  • Often stored as tabular data files with geographic metadata
  • Points, lines, and polygons represent the spatial features
  • Topology describes the connectivity, area definition, and contiguity of interrelated points, lines, and polygon

Buffer

  1. Open QGIS and open the ‘sprStreams.geojson’ from the SPR data we used the other day. (If you do not have it any longer it can be downloaded here)
  2. In the drop down menu go to, Vector –> Geoprocessing tools –> Buffer

IMage showing the buffer tool situated within the vector dropdown menu.

The buffer tool situated within the vector dropdown menu.

Notice the Units! Buffering in degrees makes no sense. Reproject it first! What is a good projection to use?

QGIS warning about buffering in degrees{fig-alt=“QGIS warning about buffering in degrees”, width=“30vw;”}

Dissolve

  1. In QGIS open sprSoil.geojson
  2. Change symbology to categorical by “SOILNAME”
  3. Vector –> Geoprocessing tools –> Dissolve
  4. Use “HYDROGRPOUP” as dissolve field

Clip

  1. Vector –> Geoprocessing tools –> Clip
  2. Clip the sprSoil by the streams buffer.

Spatial overlays

  1. Intersect soils with bufffer, look at attributes
  2. Intersect buffer with soils, look at attributes

Union

Symmetric Difference

  • Try it with buffer and soils

Check topology Vector --> Geometry --> Check Validity

Link to tutorial about editing vectors.

Joins

Tabular joins join layers by matching a common column name (e.g., parcel_id or GEOID)

Spatial joins transfer attributes based on how features relate in space (intersects, within, nearest)

Tabular Joins

  1. Download California Counties and median household income

  2. add the counties layer

  3. add the income csv (you must select “no geometry (attribute only table)”)

  4. Open the attribute tables for each look at the names for the columns containing county name

  5. In the Processing Toolbox search “join” and select “join attributes by field”

    • Input layer 1 is counties, input layer 2 is
    • use appropriate column names
  6. Look at the attribute table of the resulting layer

  7. Change the symbology to make a thematic map showing median income by county.

Spatial Joins

One-to-One Spatial Join

  • Output: Each feature from the target layer (the primary layer) gets a single matching record from the join layer (secondary layer).

  • Handling Multiple Matches: If multiple matches are found, only one matching feature is selected (usually the first or based on criteria like nearest neighbor).

  • Example:Joining cities (target) with climate zones (join layer), ensuring each city gets only one associated climate zone. One-to-Many Spatial Join

  • Output: If multiple matching features exist, the target feature is duplicated for each matching feature from the join layer.

  • Handling Multiple Matches: Every matching record from the join layer is included, leading to multiple rows for one target feature.

  • Example: Joining states (target) with cities (join layer). Each state will appear multiple times for every city within its boundaries.

Merge vs Spatial Join

Spatial Join:
You might use a spatial join to combine data from a “census tracts” layer with a “crime incidents” layer to see the crime statistics within each census tract.

Merge:
You might use a merge to combine two adjacent land parcels into a single, larger parcel with a new boundary.

Spatial Joins

Download Cities

  • Use the “join attributes by location” tool from the geoprocessing toolbox to join cities to counties
  • There will be problems. Hint: “validate geometries and”fix geometries” tools will be useful.

Challenge - Join counties to cities, and calculate total urban area for each county.

DEMs

What is a DEM?

  • A Digital Elevation Model
  • Representation of the topographic surface of the Earth
  • DTM (Digital Terrain Model) is usually synonymous with DEM (though sometimes DEM is used to encompass DTM and DSM)
  • A DSM (Digital Surface Model) includes vegetation and structures

Image showing the difference between a DTM, DSM and CHM

Image Source: NEON

How are DEMs made?

  • Survey or historic data (not so much anymore)

How are DEMs made?

Aerial LiDAR imagery

How are DEMs made?

Satellite imagery

ASTER
(Advanced Spaceborne Thermal Emission and Reflection Radiometer)

  • Photogrammetry from images
  • 30 m resolution

IceSAT
(Ice, Cloud and land Elevation Satellite)

  • Lidar
  • \(\ge\) 500 m resolution

SRTM
(Shuttle Radar Topography Mission)

  • SAR
  • DSM
  • only from year 2000
  • 1 arcsecond resolution

Pseudoquiz!

What does 1 arcsecond resolution mean?

What is LiDAR anyway?

  • Light Detection and Ranging
  • Laser pulses are fired rapidly from airborne source and then reflected off of the earth’s surface
    • The time it takes for the light to return to the source is used to measure the distance to the surface
  • In addition to DEMs, LiDAR data can be used to generate canopy cover and canopy height indices (among other things!)

What can DEMs be used for?

  • Terrain analysis
    • Slope, aspect, hillshade, contours
  • Hydrologic modeling
    • Flow direction, flow accumulation, watershed delineation, stream network extraction
  • Environmental risk assessments and hazard modeling
    • Modeling land movement (landslides, erosion)
  • Infrastructure and land use planning

Visualizing Elevation

DEM

Slope

Hillshade

Red Relief

Red Relief

  1. Create Hillshade
    • Raster → Analysis → Hillshade
    • Azimuth: 315°, Altitude: 45°
  2. Apply Red Relief Style to DEM
    • Right-click DEM → Properties → Symbology
    • Render type: Singleband pseudocolor
    • Color ramp: Create custom red gradient
    • Min value: Black → Max value: Red
  3. Blend Layers
    • Place hillshade above DEM
    • Set hillshade Blending mode: Multiply
    • Adjust hillshade opacity somewhere ~50-70%
    • Opacity is found under the Transparency tab just below Symbology

Red Relief

Landforms

Landforms found using Geomorphons

Raster Resampling

Resampling is adjusting the pixel size or resolution of raster data in order to:

  • Match resolutions - So multiple rasters will align1 for analyisis (e.g., NDVI and elevation)
  • Downsample - Reduce resolution for faster processing

  • Upsample - Increase resolution for finer analyses (though it won’t create new information)

Raster Resampling - Methods

Nearest Neighbor Resampling

  • The new raster pixels get the value from nearest pixel of the original raster to the center of the new pixel.
  • Note that some of the values are lost this way (particularly in downsampling), since they were not passed on to the new raster

bilinear resampling

  • Each new raster cell gets a weighted average of four nearest cells from the input, rather than just one
  • Less loss of information

Average resampling

  • Each new cell gets the (non-weighted) average of all overlapping input cells

Raster Resampling

There are two\(^*\) tools for resampling in QGIS

* Actually there are others, notably if Grass is installed its tools are also available.

Feature QGIS Align Rasters GDAL Warp
Align to grid ✅ Yes (to reference) ✅ Yes (to round coords)
Resample ✅ Yes ✅ Yes
Match resolution ✅ Yes ⚠️ Only if specified
Match extent ✅ Yes ⚠️ Only if specified
Grid type Reference raster Integer/round coordinates
  • QGIS Align Rasters
  • GDAL Warp is more flexible
    • It can reproject
    • It can clip to an extent
  • It is a useful command line tool

Raster Reprojection (Warping)

Just like vector data, we need to reproject rasters if we’re to do accurate analysis.

The goal is to realign the pixels, without changing their values.

The goal is to realign the pixels, without changing their values.

What happens in the reprojection can be thought of as a two-step process

  1. The pixel outlines are reprojected as if they were polygons
  2. This results in an irregular grid
  3. The grid is then resampled to form a regular grid

Raster Reprojection using GDAL Warp

  1. Download dw_2025.tif, dw_20218.tif, and dw_style.qml from this link

  2. In QGIS open dw_2025.

    1. Look at the CRS
    2. Look at the resolution.
  3. In the symbology tab, at the bottom left there is a style dropdown.

    1. select “Load Style…” use the browser to open the dw_style.qml file from the dynamic_world folder
    2. Apply

Reproject dw_2025 using GDAL Warp (Processing Toolbox: GDAL → Raster projection → Warp)

  • Leave Source CRS blank (In “Input layer” you can see that the CRS is recognized)
  • Set Target CRS to EPSG:6339
  • Use average resampling
  • Set ” Output file resolution in target georeferenced units” to 10
    • What are the target georeferenced units?
  • Leave the rest as defaults, including “[save to temporary Layer]”

Compare the results to the original. Do you see any problems?

Why is this margin of different land cover appearing?

Try again, what resampling method should you use?

  • Save the reprojected layer dw_2025_6339.tif.
  • Reproject dw_2018 in the same way (save as dw_2018_6339.tif)
  • Use Raster Tools → Align Rasters to align dw_2018_6339.tif and dem_1m_6339.tif to dw_2025_6339 (use appropriate resample methods).
  • Now use the the Raster Calculator to find areas that were covered in trees in 2018, but not in 2025.

  • Can you figure out how to find areas that were covered in trees in 2018, but not in 2025 on a slope > 10% ?

Remote Sensing!

Remote sensing

Remote sensing - Obtaining information about an object from a distance.

What is the most basic form of remote sensing you can think of?

Looking at something!

There are many different methods of remote sensing.

  • Some ground based
  • Some airborne
  • Some satellite based
  • Most remote sensing relies on electromagnetic radiation

Red band (0.63 - 0.69 µm)

Useful for:

  • Detecting bare soil, buildings, pavement
  • Chlorophyll absorption

Green band (0.52 - 0.6 µm)

Useful for:

  • phenology / vegetation dynamics
  • plant Health
  • algal Blooms

Blue band (0.45 - 0.52 µm)

Useful for:

  • water
  • clouds
  • snow
  • aerosols

NIR band (0.77 - 0.9 µm)

Useful for:

  • biomass
  • vegetation detection
  • boundary detection

A “True Color” image used Red, Green and Blue

  • Pixels in display contain 3 sub-pixels
  • Each sub-pixels intensity is controlled by the intensity value in the image
  • Intensity values are stored as 8-bit unsigned integers (uint8)
    • 8 bits = \(2^{8}\) = 256 possible values
    • Range: 0 to 255 (256 values total)
    • Images are sometimes stored with higher precision, but displayed with 8 bits
(255, 0, 0)   = pure red
(0, 255, 0)   = pure green
(0, 0, 255)   = pure blue
(255, 255, 0) = yellow (red + green)
(0, 255, 255) = cyan (green + blue)
(255, 0, 255) = magenta (red + blue)
(255, 255, 255) = white (all combined)
(0, 0, 0)     = black (none)

Combining bands on different ways is often useful.

For example, False Color Image

  • Near-Infrared to Red, Red to Green, and Green to Blue (NIR, G, R)
  • Humans see only a small portion of the EM spectrum.
  • Instruments on satellites capture more, but still only a small portion of the entire electromagnetic spectrum

Right: Reflectance of water, soil and vegetation in different wavelengths and Landsat TM channels.

Image Source: Wikimedia

Image Source: Wikimedia

Image Source: NASA

Passive vs. Active

Image Source: NASA Earthdata

  • The type of remote sensing we have been discussing so far is optical remote sensing.
    • Optical remote sensing is a is passive
    • Light from the sun bounces off of the earth and into the sensor (Eyeball, Camera, Radiometer)
  • Radiometric sensing covers a wider spectral range, and may include active as well as passive techniques.

NAIP Imagery

National Agriculture Imagery Program (NAIP)

  • High-resolution aerial imagery of the continental United States
  • Collected during agricultural growing seasons
  • Typically 4-band: Red, Green, Blue, Near-Infrared (NIR)
  • 60 cm (or better) spatial resolution
  • Updated on a 2-3 year cycle for each state

Learn more: USDA NAIP Program

A NAIP image

Filter, Map, Reduce

  • Filter - Find the subset of data needed.
  • Map - Transform the raw data into useful data
  • Reduce - Extract needed information

Spectral indices

Spectral index

  • A mathematical equation that is applied on the various spectral bands of an image on a per pixel basis
  • Maps multiple bands to a single band
  • Simple band ratios that highlight a specific process or property on the land surface
  • Reduce effects of atmosphere, instrument noise, sun angle: allows for consistent spatial and temporal comparisons 1

Spectral Response Curves

Image Source: SEOS

\[ \text{NBR} = \frac{\text{NIR} - \text{SWIR-2}}{\text{NIR} + \text{SWIR-2}} = \frac{B_8 - B_{12}}{B_8 + B_{12}} \]

Common Spectral Indices

Index Formula Typical Use
NDVI \((\text{NIR} - \text{Red}) / (\text{NIR} + \text{Red})\) Vegetation greenness/vigor
EVI \(2.5 \cdot (\text{NIR} - \text{Red}) / (\text{NIR} + 6\cdot\text{Red} - 7.5\cdot\text{Blue} + 1)\) Dense vegetation, reduces soil/atmosphere effects
SAVI \((1 + L)\cdot(\text{NIR} - \text{Red}) / (\text{NIR} + \text{Red} + L)\) Vegetation with soil brightness correction (\(L\) often 0.5)
NDWI \((\text{Green} - \text{NIR}) / (\text{Green} + \text{NIR})\) Surface water detection
MNDWI \((\text{Green} - \text{SWIR-1}) / (\text{Green} + \text{SWIR-1})\) Open water enhancement, reduced built-up/soil noise
NBR \((\text{NIR} - \text{SWIR-2}) / (\text{NIR} + \text{SWIR-2})\) Burn severity, fire impacts
NDMI \((\text{NIR} - \text{SWIR-1}) / (\text{NIR} + \text{SWIR-1})\) Vegetation moisture

NDVI

\((\text{NIR} - \text{Red}) / (\text{NIR} + \text{Red})\)

Image Source: NASA ARSET

Image Source: NASA ARSET

Raster Resampling

Resampling is adjusting the pixel size or resolution of raster data in order to:

  • Match resolutions - So multiple rasters will align1 for analyisis (e.g., NDVI and elevation)
  • Downsample - Reduce resolution for faster processing

  • Upsample - Increase resolution for finer analyses (though it won’t create new information)

Raster Resampling - Methods

Nearest Neighbor Resampling

  • The new raster pixels get the value from nearest pixel of the original raster to the center of the new pixel.
  • Note that some of the values are lost this way (particularly in downsampling), since they were not passed on to the new raster

bilinear resampling

  • Each new raster cell gets a weighted average of four nearest cells from the input, rather than just one
  • Less loss of information

Average resampling

  • Each new cell gets the (non-weighted) average of all overlapping input cells

Raster Resampling

There are two\(^*\) tools for resampling in QGIS

* Actually there are others, notably if Grass is installed its tools are also available.

Feature QGIS Align Rasters GDAL Warp
Align to grid ✅ Yes (to reference) ✅ Yes (to round coords)
Resample ✅ Yes ✅ Yes
Match resolution ✅ Yes ⚠️ Only if specified
Match extent ✅ Yes ⚠️ Only if specified
Grid type Reference raster Integer/round coordinates
  • QGIS Align Rasters
  • GDAL Warp is more flexible
    • It can reproject
    • It can clip to an extent
  • It is a useful command line tool

Raster Resampling

Raster Reprojection (Warping)

Just like vector data, we need to reproject rasters if we’re to do accurate analysis.

The goal is to realign the pixels, without changing their values.

The goal is to realign the pixels, without changing their values.

What happens in the reprojection can be thought of as a two-step process

  1. The pixel outlines are reprojected as if they were polygons
  2. This results in an irregular grid
  3. The grid is then resampled to form a regular grid

Raster Reprojection using GDAL Warp

  1. Download dw_2025.tif and dw_20218.tif as well as dw_style.qmlhttps://cpslo-my.sharepoint.com/:u:/g/personal/mthuggin_calpoly_edu/EXMEE6bR85VMkOPotG9dk6sBbr2JQx2QNFtsR9-0OAIQfg?e=aa09WA

  2. In QGIS open dw_2025.

    1. Look at the CRS
    2. Look at the resolution.
  3. In the symbology tab, at the bottom left there is a style dropdown.

    1. select “Load Style…” use the browser to open the dw_style.qml file from the dynamic_world folder
    2. Apply

Reproject dw_2025 using GDAL Warp (Processing Toolbox: GDAL → Raster projection → Warp)

  • Leave Source CRS blank (In “Input layer” you can see that the CRS is recognized)
  • Set Target CRS to EPSG:6339
  • Use average resampling
  • Set ” Output file resolution in target georeferenced units” to 10
    • What are the target georeferenced units?
  • Leave the rest as defaults, including “[save to temporary Layer]”

Compare the results to the original. Do you see any problems?

Why is this margin of different land cover appearing?

Try again, what resampling method should you use?

  • Save the reprojected layer dw_2025_6339.tif.
  • Reproject dw_2018 in the same way (save as dw_2018_6339.tif)
  • Use Raster Tools → Align Rasters to align dw_2018_6339.tif and dem_1m_6339.tif to dw_2025_6339 (use appropriate resample methods).
  • Now use the the Raster Calculator to Find areas that were covered in trees in 2018, but not in 2025.

Segmentation

Data

In Lab 11 you have been working with the two Sentinel 2 datasets. You should already have them, but if not they can be downloaded with the links below.

What kind of information is needed to segment this image?

In Lab 11 you you are asked to segment the image to find lithium brine evaporation ponds near Susques Argentina.

If you have looked at the images over a basemap, or searched for Susques on the internet, you may have learned that it is in the Atacama desert.

The Atacama, being a desert, is quite dry (actually, it is one of the driest places on Earth!).

If you happened to google lithium evaporation pond, you probably know that they are used to evaporate lithium brine in order to extract lithium salts.

Given this information, one would expect these lithium ponds to be wetter than their surroundings.

Site situated within the Atacama Desert

The Atacama desert near the site

Lithium being collected after evaporation. Image credit: Dan Lundberg

Lithium Ponds are wetter than there surroundings. Image credit: Guerretto

There’s An Index For That!

Normalized Difference Water Index

\(NDWI = \frac{G -NIR}{G + NIR}\)

  • Water \(\gtrapprox\) 0

Modified Normalized Difference Water Index

\(MNDWI = \frac{G -SWIR}{G + SWIR}\)

  • Open water \(\gtrapprox\) 0.1
  • Weat soil generally \(\gtrapprox\) -0.1

Which SWIR?

SWIR1 and SWIR2 are both absorbed heavily by water.

  • Both Bands are short wave infrared (\(\lambda \approx 20 \text{m}\))
  • SWIR1 (S2 band 10, 1610 nm), useful in for finding open water, determining vegetation moisture, distinguishing snow from clouds
  • SWIR2 (S2 band 11, 2190 nm) - Useful for determining soil moisture.

Segmentation using Raster Calculator

In simple cases one can use the raster calculator.

  • Calculate you index.
  • Calculate you index.
  • Use Raster calculator to segment values above a threshold

MNDWI

Binary segmented raster shown over S2 imagery, with sloppily chosen threshold.

Segmentation using object based segmentation tools

  • Last class you did a simple pixel-based segmentation
    • First you created a spectral index.
    • Then you applied a threshold to the spectral index raster and converted it into a binary mask (target vs. non-target).
    • Then you polygonized the results and filtered the polygons.
    • It is a useful technique, but for more complex segmentation tasks it becomes impractical.
  • This week we will perform object based segmentation using Orfeo Toolbox
    • In object-based segmentation neighboring pixels are grouped into regions using spectral similarity and spatial context, instead of relying on one cutoff value.
    • This generally results in better results in complex imagery.
    • It also requires a more involved workflow, though much of the complexity is handled by Orfeo.

Installing Orfeo Toolbox

In this class we will use Orfeo Toolbox, an open source remote sensing project, but there are many other options.

Go to the Orfeo Toolbox download page and click the Download OTB 9.x.x.x button.

Or if that link is broken use this copy.

Extract the file and move the resulting folder to your home directory.

Install the Orfeo Toolbox Provider pluggin.

Install the Orfeo Toolbox Provider pluggin.

Open processing toolbox and click the settings icon

Open processing toolbox and click the settings icon

  • Click the Processing tab on the left
  • Click the OTB dropdown
  • Check the activate box, if it exists
  • Select the OTB application folder by browsing to ~/OTB.x.x.x/lib/otb/applications and click select folder (x.x.x is just a place holder for whatever version you have)
  • Set OTB folder to ~/OTB.x.x.x

You can watch this painfully slow video if you are having trouble.

Installing attribute based clustering pluggin

Go to pluggins, search for Attribute based clustering, install the pluggin

Segmentation

Band Common name Central wavelength (nm) Resolution (m)
B1 Coastal aerosol 443 60
B2 Blue 490 10
B3 Green 560 10
B4 Red 665 10
B5 Red Edge 1 705 20
B6 Red Edge 2 740 20
B7 Red Edge 3 783 20
B8 NIR 842 10
B8A Narrow NIR 865 20
B9 Water vapor 945 60
B10 Cirrus 1375 60
B11 SWIR 1 1610 20
B12 SWIR 2 2190 20

  • Using Raster Calculator, extract Band 4 from the image, (can be scratch layer, rename it NIR)
  • Run Zonal Statistics using the segments and the NIR raster, calculate mean
  • In the geoprocessing toolbox, find K-means clustering (ABC) under Attribute based clustering
  • Run with 2 clusters, and class as the value “Fields to use for clustering”
  • Dissolve the output (Clusterd Layer) based on on class

IMage of Atlantic forest tile

This image contains Sentinel2 bands 4, 3, 2 and 8.

  • Go to Processing Toolbox > OTB > Segmentation > Segmentation
  • You can run the algorithm with default settings, except you need to specify an output file (use a .shp file as output, Orfeo complains about geojson for some reason.)
  • You should end up with something like this (after you adjust the symbology)

Statistics and Raster Extractions

Download some stuff

Download sprElevation.tif and put it with your sprData (That you used for your first map, if you lost it, get it here )

Measures of Central Tendency

Central tendency gives a single value to describe where the middle of a dataset lives.

  • Mean - arithmetic average, best when values are roughly symmetric.
  • Median - middle ordered value, robust when a few outliers pull the mean.
  • Mode - most common value or category, useful for discrete or categorical data.
  • Trimmed mean - average after dropping the highest and lowest values to dampen outliers.


Sample data (annual NDVI for five plots):
0.41, 0.55, 0.58, 0.60, 0.94


Sample data (annual NDVI for five plots):
0.41, 0.55, 0.58, 0.60, 0.94

Sample Mean \(\bar{x} = \frac{0.41 + 0.55 + 0.58 + 0.60 + 0.94}{5} = 0.616\)


Sample data (annual NDVI for five plots):
0.41, 0.55, 0.58, 0.60, 0.94

Order the values → 0.41, 0.55, 0.58, 0.60, 0.94
Middle value = 0.58


Sample data (annual NDVI for five plots):
0.41, 0.55, 0.58, 0.60, 0.94

No repeats → no single mode (we call this “none” or “multi-modal”).


Sample data (annual NDVI for five plots):
0.41, 0.55, 0.58, 0.60, 0.94

Truncated Sample Mean \(\bar{x}_{10\%} = \frac{0.55 + 0.58 + 0.60}{3} = 0.577\)

Variance & Spread

Central tendency + spread → fuller story about a dataset.

  • Range - quick check on the total spread, but driven by extremes.
  • Variance (\(s^{2}\)) - average squared deviation from the mean using \(n-1\) for a sample.
  • Standard deviation (\(s\)) - square root of variance; back in the units you collected.
  • Smaller \(s\) → values cluster around the mean; larger \(s\) → more variable plots.


Sample data (annual NDVI for five plots):
0.41, 0.55, 0.58, 0.60, 0.94


Sample data (annual NDVI for five plots):
0.41, 0.55, 0.58, 0.60, 0.94

Range: \(0.94 - 0.41 = 0.53\)


Sample data (annual NDVI for five plots):
0.41, 0.55, 0.58, 0.60, 0.94

Sample Variance, unbiased estimator \(s^{2} = \frac{\sum (x - \bar{x})^{2}}{n - 1} = 0.038\)


Sample data (annual NDVI for five plots):
0.41, 0.55, 0.58, 0.60, 0.94

\(s = \sqrt{s^{2}} = 0.195\)


Sample data (annual NDVI for five plots):
0.41, 0.55, 0.58, 0.60, 0.94

\(s = \sqrt{s^{2}} = 0.195\)

Population v. Sample

Image Source: Wikimedia

Population Variance (Parameter)

\(\sigma^{2} = \frac{\sum (x - \mu)^{2}}{N} = ?\)

Sample Variance, unbiased estimator (statistic)

\(s^{2} = \frac{\sum (x - \bar{x})^{2}}{n - 1} = 0.038\)

Precision v. Accuracy

  • Higher spatial resolution does not inherently make the data more accurate - though higher resolution data can be described as more precise
  • Spatial resolution can affect the accuracy of analysis performed with the raster data,

Extracting Raster Values

Sometimes we would like to know the raster values at points, along a line, or within a polygon.

Extracting Raster Values by Point

  • Consider the elevation data and rain gauge locations at Swanton Ranch.
  • What if we want to know the elevation of all rain gauges represented points?

Processing ToolboxSample raster values

  • Input layer = points
  • Raster layer = elevation
  • Output column prefix = “Elevation_”

Now use the Field Calculator to calculate the mean and standard deviation!

Extracting Raster Values along lines

Say we want to know the elevation along each reach of the rivers

  • How might we do this?
  • Hint - recall what lines are made up of?

Steps:

  1. Densify line layer:
    1. Processing ToolboxVector GeometryDensify by Interval
    2. Set a suitable interval (e.g., every 10 meters) to create additional vertices along the line
  2. Convert the densified lines into points:
    1. Use Processing ToolboxVector GeometryPoints along Geometry
    2. This will generate points at the line vertices or specified intervals along the line
  3. Sample Raster Values:
    1. Run Sample Raster Values (Processing ToolboxRaster Analysis)
    2. Input the points you just created and the raster layer
    3. This will extract the raster values at each point along the original line segments

Steps:

  1. Densify line layer:
    1. Processing ToolboxVector GeometryDensify by Interval
    2. Set a suitable interval (e.g., every 10 meters) to create additional vertices along the line
  2. Convert the densified lines into points:
    1. Use Processing ToolboxVector GeometryPoints along Geometry
    2. This will generate points at the line vertices or specified intervals along the line
  3. Sample Raster Values:
    1. Run Sample Raster Values (Processing ToolboxRaster Analysis)
    2. Input the points you just created and the raster layer
    3. This will extract the raster values at each point along the original line segments

Do this for sprRoads and Elevation

Extracting Zonal Statistics

Let’s say you want to determine the mean / median / minimum / max elevation or slope, or NDVI or anything else described by raster data, but for every feature in a polygon layer (e.g. for every county in CA)

How would you do that, knowing what we already know?

Easier Way:

Processing ToolboxRaster AnalysisZonal Statistics

Calculate the mean elevation for each feature in sprParcels

Converting Vector Data to Raster

Input Later: sprStreams Fixed Value to burn: 1 Output Raster Size units: Pixels Width/Horizontal Resolution: 1250 Height/Vertical Resolution: 1250 Output Extent: Calculate from layer (sprStreams)

Proximity Raster

What if we wanted to determine the distance from any pixel to the nearest stream? RasterAnalysisProximity (Raster Distance) Input Layer = Rasterized streams

The way we just did this is somewhat absurd. Why? How could you fix it?

Raster → Contours

RasterExtractionContours

Heatmaps

Point Count to Raster

Input layer: Your point layer
Burn in value: Set this to 1
Output raster size: resolution In map units
Additional creation parameters: -add (to sum the values for points in the same cell)

Rasterizing by Attributes

Rasterizing by Attributes

  • What if we want to create a raster dataset from some vector polygons on the basis of one of the (numerical) attributes?
  • Example: Swanton Ranch data
    • We have some polygons describing soils (sprSoils.geojson)
    • One of the attributes is KFactor - hydraulic conductivity
    • We want to create a new raster on the basis of this attribute

Rasterize by Attribute - Symbolize by Value

  • Raster > Conversion > Rasterize (Vector to Raster)
  • Layer = sprSoil
  • Field = KFACTOR
  • Output raster size units = Pixels
  • Horizontal / Vertical Resolution = 1250

Focal Filters

What are Focal Filters?

  • Focal, or neighborhood, filters evaluate each cell using values from its neighbors
  • They smooth noise, enhance edges, and extract landform signatures from rasters
  • Window size and shape determine how much contextual information influences the output
  • in QGIS use r.neighbors from processing toolbox

Neighborhood Windows

  • Neighborhoods are typically defined as square windows (3×3, 5×5, etc.).
  • Cell spacing and window dimensions dictate the spatial scale of the analysis.
  • Larger windows generalize features; smaller windows preserve local detail.

Kernels & Weights

  • Kernels are matrices of weights used to combine neighbor values into a new pixel.
  • Weight patterns emphasize directions, distances, or specific neighbors.

Mean (a.k.a. Low-Pass) Filter

  • Averages the values within the neighborhood, producing a smoothed surface.
  • Dampens high-frequency variation
  • Useful for removing noise from continuous surfaces (elevation, temperature, etc.).

Median Filter

  • Replaces the center cell with the median of neighborhood values.
  • Preserves edges better than mean smoothing while removing salt-and-pepper noise.

Minimum & Maximum Filters

  • Minimum filter assigns the lowest neighborhood value; maximum uses the highest.
  • Mimic morphological erosion (minimum) and dilation (maximum) on raster data.
  • Highlight depressions or peaks, and support feature extraction workflows.

Roughness Filters

  • Quantify variability inside the neighborhood (e.g., range, standard deviation).
  • Capture terrain ruggedness, habitat heterogeneity, or surface texture.
  • Sensitive to window size: smaller windows detect micro-relief; larger windows show broader roughness zones.
  • Raster > Analysis > Roughness computes elevation range within a kernel in QGIS

TPI & Geomorphons

  • Topographic Position Index (TPI) compares a cell to the mean elevation of its neighbors.
  • Positive TPI marks ridges; negative TPI highlights valleys—kernel size sets the landform scale.
  • Geomorphons classify landforms using multi-directional TPI, revealing patterns such as spurs, hollows, and plains.

Georeferencing

What is Georeferencing?

  • Georeferencing is the process by which real-world locations ascribed to data.
  • Ground Control Points or GCPs are how we tell the computer which points on the non-georeferenced image correspond to real-world coordinates.
  • A Tranform then applies translation , rotation, etc… to warp the image to fit.

Example: Swanton Ranch Treasure Map

Download the Swanton Ranch treasure_map.tif. Put it someplace sensible.

What Is A TIF

  • A tif is a container format
  • It stores image pixels plus tags (metadata)
  • Compression of the image inside the container can be: none, lossless (LZW, Deflate, etc…), or JPEG
  • A GeoTIFF is a TIFF with georeferencing tags
  • A regular TIFF lacks georeferencing tags

Normal TIFs, No Georeferencing

This is just a regular tif, but we want to use it in a GIS program

Georeferencing In A TIF

  • Pixel grid: rows/columns only (x,y)
  • No real-world location yet
  • GeoTIFF adds tags that map pixel space to map space
  • Key tags: CRS + affine transform

(col,row) + GeoTIFF tags -> (lon,lat) or (easting,northing)

So georeferencing is stored in metadata, not drawn into pixels.

Tutorial: Geoferencing the Treasure Map

  1. Open QGIS
  2. Open Georeferncer (Layer > Georeferencer)
  3. Open the raster (this button )
  4. Select treasure_map.tif

  • Open Transformation Settings
  • Select Polynomial 1 for Transformation Type
  • Set output file
  • Click ok

Can anyone find where (in Swanton) our treasure map might correspond to?

What geographic features are helpful for identifying?

  • Once you find the place:
    • Add GCPs
    • Click a point on the image
    • The Enter Map Coordinates box should pop up
    • Select the From Map Canvas button
    • Click point
    • Click ok
    • Repeat 4x

Georeferencer dialogue should look like this:

Click Run

Inspect the result - turn on transparency

Lab 15

Georeferencing Assignment

  • Try again
  • Experiment with different transformations / resampling techniques
  • Add more GCPs

Answer the following questions:

  1. As you add more GCPs initially the accuracy increases rapidly, at some point, adding new points starts to make less of a difference. Based on this how many GCPs do you think is enough.
  2. Were you able to notice any difference using different transformations and resampling techniques? Which do you think worked best?
  3. In the Georeferencing tool, when you run the transform, there is a column called Residual. What is this, how might it be useful. How does your choice of CRS affect the utility of this information?
  4. Include an image of the georeferenced map overlaying the basemap, (with enough transparency to see the alignment, also include your GCPs)

An Introduction to the ESRI Ecosystem

ArcGIS vs QGIS

QGIS is…

  • Free, open source software
  • Compatible with different operating systems (well, mostly)
  • Customizable workflow design

ArcGIS is…

  • Expensive, exclusive to Windows OS
  • More user-friendly, designed for all skill levels
  • Oriented towards organization-wide integration

The ESRI Suite

ArcGIS Pro

  • Desktop GIS platform
  • Best for advanced spatial analysis

ArcGIS Online

  • Cloud-based GIS platform
  • Useful for sharing maps, layers, and datasets

ArcGIS Enterprise

  • Designed for organizations
  • Private servers for data/map sharing
  • Locally hosted version of ArcGIS Online

Additional Apps and Tools

  • StoryMaps: make map presentations and narratives
  • Experience Builder: make GIS dashboards/web apps
  • Survey123: integrate surveys with spatial analysis
  • Field Maps: collect georeferenced data points

Mini Lab: Exploring ArcGIS Pro

Opening ArcGIS Pro

  • Use Cal Poly SSO
  • Click on Map
    • Make sure you know where the project is saved!

Adding data

  • Download SwantonGIS.gdb.zip (new file type!)
  • Unzip the file, save the whole .gdb to a new lab folder
  • Add the data to your ArcGIS project
    • Map > Add Data > Navigate to the GDB

Adjusting symbology

  • Right click on sprVegetation
  • Go to Symbology
  • Primary Symbology > Unique Values
    • Field: VEGTYPE1

  • Try out a few symbologies for numerical data (use a different layer)
    • Symbology > Graduated Colors > KFACTOR
    • Symbology > Graduated Symbols > Depth
    • Symbology > Proportional Symbols > Slopemax

Making a Map in ArcGIS Pro

  • Insert > New Layout > 8.5x11 Letter
  • Insert > Map Frame
  • Right click on Map Frame > Activate
  • Right click on the sprVegetation layer in the layout tab > Zoom to Layer

  • When you’re satisfied, Layout > Close Activation

Other things we can add:

  • Legend, scale bar, north arrow
  • Latitude / longitude coordinates with Grid
  • Also worth looking through the options under Dynamic text

ArcGIS Online