Getting Started
Getting Started
Installation
WildfireData.jl can be installed from GitHub:
using Pkg
Pkg.add(url="https://github.com/RallypointOne/WildfireData.jl")Basic Usage
Load the package — all submodules are available immediately:
using WildfireData
WFIGS.datasets()
FIRMS.sources()Module Overview
Real-time Fire Data
For current fire incidents and perimeters:
using WildfireData
# Current fire perimeters from WFIGS
perimeters = WFIGS.download(:current_perimeters, limit=10)
# Current incidents from IRWIN
incidents = IRWIN.download(:usa_current_incidents, limit=10)Satellite Fire Detections
For near real-time satellite-based fire detections:
using WildfireData
# Requires a free API key from NASA
# Set via environment variable: ENV["FIRMS_MAP_KEY"] = "your-key"
# Or: FIRMS.set_map_key!("your-key")
# Download VIIRS fire detections for California
df = FIRMS.download(:VIIRS_NOAA20_NRT, region=:california, days=1)Historical Fire Data
For historical fire records:
using WildfireData
# Download the database first (~214 MB)
FPA_FOD.download_database()
# Query fires
fires = FPA_FOD.fires(state="CA", year=2020, limit=100)
largest = FPA_FOD.largest_fires(10)Burn Severity Data
For burn severity and fire boundaries:
using WildfireData
# Fire occurrence points
fires = MTBS.download(:fire_occurrence, limit=100)
# Burn boundaries
boundaries = MTBS.download(:burn_boundaries, limit=10)Landscape Data
For fuel, vegetation, and topographic data:
using WildfireData
# List available products
LANDFIRE.products()
# Get WCS URL for streaming access
url = LANDFIRE.wcs_url(:conus, :LF2024)
# Download full extent (warning: large files)
# LANDFIRE.download_product(:FBFM40, :conus, :LF2024)Return Types
Different modules return different data types depending on the underlying data source:
| Module | Return Type | Notes |
|---|---|---|
| WFIGS | GeoJSON.FeatureCollection |
GeoJSON with geometry |
| IRWIN | GeoJSON.FeatureCollection |
GeoJSON with geometry |
| MTBS | GeoJSON.FeatureCollection |
GeoJSON with geometry |
| FPA_FOD | Vector{NamedTuple} |
Tabular rows from SQLite |
| FIRMS | DataFrame |
CSV data from NASA API |
| LANDFIRE | File path (String) |
Downloads GeoTIFF rasters |
For GeoJSON results, access feature properties like:
data = WFIGS.download(:current_perimeters, limit=5)
for feature in data
println(feature.properties.IncidentName)
endFor FPA_FOD results, access fields directly on the NamedTuples:
fires = FPA_FOD.fires(state="CA", year=2020)
for fire in fires
println(fire.FIRE_NAME, ": ", fire.FIRE_SIZE, " acres")
endData Storage
Downloaded data is stored in a scratch space managed by the Scratch.jl package. You can find the location with:
using WildfireData
WildfireData.dir() # Returns the base data directoryEach module has its own subdirectory: - WildfireData.dir("WFIGS") - WildfireData.dir("FIRMS") - etc.
Common Patterns
Filtering Data
Most modules support filtering via where clauses or keyword arguments:
# WFIGS/IRWIN: SQL-like where clause
data = WFIGS.download(:current_perimeters, where="GISAcres > 1000", limit=10)
# FPA_FOD: Keyword arguments
fires = FPA_FOD.fires(state="CA", year=2020, min_size=1000)
# FIRMS: Region and time filters
df = FIRMS.download(:VIIRS_NOAA20_NRT, region=:western_us, days=3)Spatial Filtering
WFIGS, IRWIN, and MTBS support bounding box filtering via the bbox parameter:
# Bounding box as (west, south, east, north) tuple
data = WFIGS.download(:current_perimeters, bbox=(-125, 32, -114, 42))
# Or as a string
data = IRWIN.download(:usa_current_incidents, bbox="-125,32,-114,42")FIRMS uses named regions or explicit bounding boxes via the area/region parameters:
df = FIRMS.download(:VIIRS_NOAA20_NRT, region=:california, days=1)
df = FIRMS.download(:MODIS_NRT, area="-120,35,-115,40", days=2)Counting Records
Check how many records match your query before downloading:
# Count all current perimeters
n = WFIGS.count(:current_perimeters)
# Count with filter
n = WFIGS.count(:current_perimeters, where="GISAcres > 1000")Getting Field Information
Discover available fields in a dataset:
fields = WFIGS.fields(:current_perimeters)
for f in fields
println("$(f.name): $(f.type)")
endSaving Data Locally
Download data to a local file:
# Save as GeoJSON
path = WFIGS.download_file(:current_perimeters, limit=100)
# Load later
data = WFIGS.load_file(:current_perimeters)Next Steps
Explore the documentation for each module: