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.
usingWildfireData.WFIGS# List all datasetsWFIGS.datasets()# Filter by categoryWFIGS.datasets(category=:perimeters)# Get dataset infoWFIGS.info(:current_perimeters)
Downloading Data
# Download current perimeters (GeoJSON)data = WFIGS.download(:current_perimeters, limit=10)# Download with filterdata = WFIGS.download(:current_perimeters, where="GISAcres > 1000", limit=10)# Download specific fields onlydata = WFIGS.download(:current_perimeters, fields="IncidentName,GISAcres", limit=10)
Querying
# Count recordsn = WFIGS.count(:current_perimeters)n = WFIGS.count(:current_perimeters, where="GISAcres > 1000")# Get field informationfields = WFIGS.fields(:current_perimeters)
Saving and Loading Files
# Download and save to local filepath = WFIGS.download_file(:current_perimeters, limit=100)# Load previously downloaded filedata = WFIGS.load_file(:current_perimeters)# Custom filenamepath = 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 dataprintln("$(feature.IncidentName): $(feature.DailyAcres) acres")end# Access geometryfeature = data[1]geom = GeoJSON.geometry(feature)println("Type: $(typeof(geom))")