WFIGS

Wildland Fire Interagency Geospatial Services

Overview

The WFIGS module provides access to wildland fire data from the NIFC Open Data portal. This includes current and historical fire perimeters and incident locations.

Data Source: WFIGS Fire History

Available Datasets

Dataset Description Category
:current_perimeters Current fire perimeters (updated every 5 min) perimeters
:current_locations Current fire locations (updated every 5 min) locations
:historic_geomac Historic GeoMAC perimeters (2000-2018) history
:perimeters_all_years All historical perimeters history
:historic_geomac_YYYY Year-specific GeoMAC (2000-2018) history

Basic Usage

using WildfireData.WFIGS

# List all datasets
WFIGS.datasets()

# Filter by category
WFIGS.datasets(category=:perimeters)

# Get dataset info
WFIGS.info(:current_perimeters)

Downloading Data

# Download current perimeters (GeoJSON)
data = WFIGS.download(:current_perimeters, limit=10)

# Download with filter
data = WFIGS.download(:current_perimeters, where="GISAcres > 1000", limit=10)

# Download specific fields only
data = WFIGS.download(:current_perimeters, fields="IncidentName,GISAcres", limit=10)

Querying

# Count records
n = WFIGS.count(:current_perimeters)
n = WFIGS.count(:current_perimeters, where="GISAcres > 1000")

# Get field information
fields = WFIGS.fields(:current_perimeters)

Saving and Loading Files

# Download and save to local file
path = WFIGS.download_file(:current_perimeters, limit=100)

# Load previously downloaded file
data = WFIGS.load_file(:current_perimeters)

# Custom filename
path = WFIGS.download_file(:current_perimeters, filename="my_perimeters.geojson")

Working with Results

The download functions return a GeoJSON.FeatureCollection:

data = WFIGS.download(:current_locations, limit=5)

# Access features (iterate directly over the collection)
for feature in data
    println("$(feature.IncidentName): $(feature.DailyAcres) acres")
end

# Access geometry
feature = data[1]
geom = GeoJSON.geometry(feature)
println("Type: $(typeof(geom))")

Plot Example

using WildfireData.WFIGS
using GeoJSON, CairoMakie, GeoMakie, Tyler
using Extents, TileProviders
import JSON3
CairoMakie.activate!()

data = WFIGS.download(:historic_geomac_2018, limit=100, verbose=false)
fc = GeoJSON.read(JSON3.write(data))

ext = Extent(; X=(-130.0, -65.0), Y=(24.0, 50.0))
m = Tyler.Map(ext;
    size = (900, 600),
    axis = (; type = GeoMakie.GeoAxis, dest = "+proj=merc"),
    provider = TileProviders.OpenStreetMap(:Mapnik),
)

for feature in fc
    geom = GeoJSON.geometry(feature)
    isnothing(geom) && continue
    poly!(m.axis, geom, color=(:orange, 0.4), strokecolor=:red, strokewidth=0.5)
end

m.figure
Precompiling packages...
   2172.8 msQuartoNotebookWorkerJSON3Ext (serial)
  1 dependency successfully precompiled in 2 seconds
Precompiling packages...
    979.4 msQuartoNotebookWorkerTablesExt (serial)
  1 dependency successfully precompiled in 1 seconds
Precompiling packages...
    960.5 msQuartoNotebookWorkerLaTeXStringsExt (serial)
  1 dependency successfully precompiled in 1 seconds
Precompiling packages...
   1200.6 msQuartoNotebookWorkerJSONExt (serial)
  1 dependency successfully precompiled in 1 seconds
Precompiling packages...
   6769.1 msQuartoNotebookWorkerMakieExt (serial)
  1 dependency successfully precompiled in 7 seconds
Precompiling packages...
   5822.6 msQuartoNotebookWorkerCairoMakieExt (serial)
  1 dependency successfully precompiled in 6 seconds

API Reference

Functions

  • datasets(; category=nothing) - List available datasets
  • info(dataset) - Print dataset information
  • download(dataset; where, fields, limit, verbose) - Download data
  • download_file(dataset; filename, force, verbose, ...) - Download and save to file
  • load_file(dataset; filename) - Load previously downloaded file
  • count(dataset; where) - Get record count
  • fields(dataset) - Get field names and types
  • query_url(dataset; where, outfields, limit, format) - Build query URL
  • dir() - Get local data directory path