Week 5 · Orbital Analyst~6 min · 543 words

Spatial operations: joins, buffers, intersects, dissolve

The core verbs of spatial analysis. Spatial joins, buffers, intersections, and dissolve — taught with launch-site and airspace-exclusion-zone data.

When a rocket launches from Vandenberg in California heading west into the Pacific, where do the spent stages land? How does that affect Hawaiian waters?

Every coastal launch produces a maritime exclusion zone — a polygon vessels must avoid. The math for that polygon is spatial-analysis 101: buffers, intersections, dissolve. Learn it, and you'll understand why fishermen on certain days get told 'not today.'

Learning objectives

A 50 km geodesic buffer around Honolulu, drawn the same way a maritime exclusion polygon is. Try zooming in — notice how the circle stays a circle on the round Earth, not on the flat map.

Primer

Spatial analysis is the verbs of GIS: combining geometries to answer questions. This week introduces the five operations that show up in every space-domain workflow — spatial joins, buffers, intersections, dissolve, and overlay.

Spatial joins

A spatial join attaches attributes from one layer to another based on a spatial relationship, not a key-value match. The classic example: given launch detection points and country polygons, attach each detection's country (so you can ask "which country had the most launches this year?"). In geopandas:

import geopandas as gpd
detections = gpd.read_file('detections.geojson').to_crs(epsg=4326)
countries  = gpd.read_file('countries.geojson').to_crs(epsg=4326)
joined = detections.sjoin(countries, how='left', predicate='within')

The predicate can be within, intersects, contains, touches, or crosses. Choose carefully — within is exclusive of the boundary, intersects includes it. For a launch detection on a coastal border, this matters.

Buffers: planar vs geodesic

A buffer expands a geometry by a distance. The catch in space GIS: distance on the Earth's curved surface is not the same as Euclidean distance in a projected plane. A 50 km planar buffer in Web Mercator at 60° latitude is actually a ~25 km buffer on the ground. Every range-safety exclusion zone is a geodesic buffer, computed on the WGS84 ellipsoid.

from shapely.geometry import Point
from shapely.ops import transform
from pyproj import Geod

geod = Geod(ellps='WGS84')
# Buffer Cape Canaveral by 50 km on the ellipsoid
lat, lon = 28.6, -80.6
exclusion = [geod.fwd(lon, lat, az, 50_000)[:2] for az in range(0, 360, 5)]

Intersection, union, difference

Once you have two polygons, you can ask three questions:

  • Intersection — what's in both. The overlap of a launch exclusion zone with a shipping lane is the area that must be cleared.
  • Union — what's in either. Combining two adjacent NOTAM zones into a single advisory.
  • Difference — what's in A but not B. A launch corridor minus the recovery zone equals the "transit" portion.

Dissolve: aggregating features

Dissolve merges multiple features into one based on a shared attribute. A dataset of every Falcon 9 launch detection can be dissolved by year, producing one polygon (or multi-point) per year for time-series visualization. In geopandas:

by_year = detections.dissolve(by='launch_year', aggfunc='sum')

Overlay

Overlay combines two layers with all four operations at once (intersection / union / identity / symmetric difference) producing a new layer where each output polygon has attributes from both inputs. Use it sparingly — overlays explode geometry counts and can be slow on big inputs.

This week's lab: range-safety maritime exclusion

Every Falcon 9 launch from Cape Canaveral produces a NOTMAR (Notice to Mariners) defining a maritime exclusion zone for the launch corridor. The lab reconstructs one of these: take the predicted trajectory polyline, geodesically buffer by 50 km, intersect with global AIS shipping lanes (from MarineCadastre.gov), and output the exclusion polygon as GeoJSON. The output is directly comparable to the published NOTMAR.

This is the same logic LaunchDetect's AIS layer uses in production — minus the real-time AIS feed, which is Week 19.

Connecting to Hawaiʻi: Maritime exclusion and Pacific fisheries

A SpaceX Falcon 9 launching south from Vandenberg into a polar orbit drops its first stage roughly 600 km downrange — toward the open Pacific. NOTMAR (Notice to Mariners) advisories define the no-fishing-allowed polygons days in advance. Hawaiian fishermen who fish the Pacific Northwest's offshore grounds occasionally get those notices. The polygons are exactly the kind of geodesic-buffered shape you'll build this week — but instead of demo data, real fishermen plan around them.

The same math used to build a launch exclusion polygon builds the polygons defining Marine Protected Areas around Hawaiian reefs. Learn this technique once; use it twice.

Hands-on lab: Compute the maritime exclusion zone for a launch

Take a Falcon 9 launch from Cape Canaveral. Buffer the predicted downrange trajectory by 50 km. Intersect with shipping lanes from AIS data. Output the maritime exclusion polygon as GeoJSON.

Quiz — click an answer to check it

No grade, no shame. Tap any option; you'll see if it's right plus the answer if not. The point is to notice what you already know and what's still settling.

Q1. A spatial join joins features by:
  1. Their attribute table only
  2. Their spatial relationship (within, intersects, etc.)
  3. Random sampling
  4. Date overlap
Q2. A geodesic buffer is computed:
  1. On a flat plane
  2. On the WGS84 ellipsoid (accurate at any latitude)
  3. In Web Mercator pixels
  4. By bounding box
Q3. Dissolve aggregates features by:
  1. A shared attribute value
  2. Distance
  3. Time
  4. ID
Q4. ST_Intersects returns:
  1. True if geometries share any point
  2. Only the intersection geometry
  3. True only for full overlap
  4. A distance
Q5. When is planar buffer wrong?
  1. Always
  2. Near the equator
  3. When buffer is large relative to Earth's curvature
  4. Never

Reflection

Take five minutes with this. Write your answer somewhere. Carry it into next week.

Whose interests does the maritime exclusion zone protect? Whose are left out? When the polygon goes up for two days, who pays the cost — and who benefits from the launch?
Mark this week complete Visiting alone doesn't count it as 'done'. Click when you've actually worked through the primer + lab + quiz.
Share + discuss on Twitter/X Discuss on GitHub