Skip to content

joolybugg/wildfire-geospatial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wildfire Geospatial Pipeline

A full geospatial data pipeline ingesting wildfire perimeter data into PostGIS, serving it via GeoServer WMS, and displaying it on an interactive map.

Map preview

Pipeline

GeoJSON data → ogr2ogr → PostGIS → GeoServer WMS → OpenLayers browser map

Stack

  • PostgreSQL + PostGIS — spatial database storing fire perimeter geometries
  • GDAL/ogr2ogr — ingesting GeoJSON into PostGIS with a single command
  • GeoServer — publishing PostGIS data as a WMS (Web Map Service)
  • OpenLayers — browser map consuming the WMS layer
  • OpenStreetMap — basemap tiles

Data

Five largest 2024 California wildfires by acreage:

Fire Acres Location
Park Fire 429,603 Butte/Tehama County
Boling Fire 53,800 Mariposa County
Bridge Fire 53,000 Los Angeles County
Line Fire 38,000 San Bernardino County
Airport Fire 23,000 Orange County

Setup

Prerequisites

  • PostgreSQL 16+
  • PostGIS 3.4+
  • GDAL (sudo apt install gdal-bin)
  • GeoServer 2.25+ (download from geoserver.org)
  • Python 3 (for the map server)

1. Database setup

sudo -u postgres psql -f sql/setup.sql

2. Ingest data

ogr2ogr \
  -f "PostgreSQL" \
  PG:"host=localhost dbname=wildfire user=wildfire_user password=wildfire123" \
  data/ca_fires.geojson \
  -nln fire_perimeters \
  -nlt MULTIPOLYGON \
  -t_srs EPSG:4326

3. GeoServer configuration

  1. Start GeoServer and open http://localhost:8090/geoserver/web
  2. Create workspace: wildfire (namespace: http://wildfire)
  3. Add PostGIS store: host=localhost, port=5432, database=wildfire, user=wildfire_user
  4. Publish fire_perimeters layer — click "Compute from data" for bounding boxes

4. View the map

python3 -m http.server 8091

Open http://localhost:8091/map.html

Spatial SQL example

SELECT fire_name,
       acres AS reported_acres,
       round((ST_Area(wkb_geometry::geography) / 4047)::numeric, 0) AS calculated_acres
FROM fire_perimeters;

Key concepts demonstrated

  • Spatial data ingestion with ogr2ogr
  • PostGIS geometry types and spatial indexing
  • WMS (Web Map Service) protocol
  • Coordinate reference systems (EPSG:4326, EPSG:3857)
  • Consuming OGC web services in a browser map

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages