fire module¶
leafmap.fire
¶
A module for accessing NASA Fire Datasets from OpenVEDA OGC API Features.
This module provides functions to search and retrieve fire perimeter data from the Fire Event Data Suite (FEDs) algorithm, which processes VIIRS sensor data from Suomi NPP and NOAA-20 satellites.
Data Source: https://openveda.cloud/api/features
fire_gdf_from_bbox(bbox, collection='snapshot_perimeter_nrt', datetime=None, farea_min=None, farea_max=None, duration_min=None, duration_max=None, meanfrp_min=None, limit=1000, max_requests=10)
¶
Get fire perimeter data for a bounding box.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bbox
|
List[float]
|
Bounding box [west, south, east, north] in EPSG:4326. |
required |
collection
|
str
|
Fire collection ID. One of: - "snapshot_perimeter_nrt": 20-day recent fire perimeters - "lf_perimeter_nrt": Current year large fires (>5 km²) - "lf_perimeter_archive": 2018-2021 Western US archived fires - "lf_fireline_nrt": Active fire lines - "lf_newfirepix_nrt": New fire pixels |
'snapshot_perimeter_nrt'
|
datetime
|
Optional[str]
|
ISO 8601 date/time or interval (e.g., "2024-07-01/2024-07-31"). |
None
|
farea_min
|
Optional[float]
|
Minimum fire area in km². |
None
|
farea_max
|
Optional[float]
|
Maximum fire area in km². |
None
|
duration_min
|
Optional[float]
|
Minimum fire duration in days. |
None
|
duration_max
|
Optional[float]
|
Maximum fire duration in days. |
None
|
meanfrp_min
|
Optional[float]
|
Minimum mean Fire Radiative Power. |
None
|
limit
|
int
|
Maximum total number of features to return. |
1000
|
max_requests
|
int
|
Maximum number of API requests for pagination. |
10
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
A GeoDataFrame containing fire perimeter features. |
Raises:
| Type | Description |
|---|---|
ImportError
|
If geopandas is not installed. |
ValueError
|
If no features are found. |
Example
Get fires in California for July 2024¶
bbox = [-124.48, 32.53, -114.13, 42.01] gdf = fire_gdf_from_bbox(bbox, datetime="2024-07-01/2024-07-31") print(f"Found {len(gdf)} fires")
fire_gdf_from_place(place, collection='snapshot_perimeter_nrt', datetime=None, farea_min=None, farea_max=None, duration_min=None, duration_max=None, meanfrp_min=None, limit=1000, buffer_dist=None)
¶
Get fire perimeter data for a place by name.
Uses OpenStreetMap Nominatim for geocoding the place name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
place
|
str
|
Place name to geocode (e.g., "California", "Los Angeles County"). |
required |
collection
|
str
|
Fire collection ID. Defaults to "snapshot_perimeter_nrt". |
'snapshot_perimeter_nrt'
|
datetime
|
Optional[str]
|
ISO 8601 date/time or interval (e.g., "2024-07-01/2024-07-31"). |
None
|
farea_min
|
Optional[float]
|
Minimum fire area in km². |
None
|
farea_max
|
Optional[float]
|
Maximum fire area in km². |
None
|
duration_min
|
Optional[float]
|
Minimum fire duration in days. |
None
|
duration_max
|
Optional[float]
|
Maximum fire duration in days. |
None
|
meanfrp_min
|
Optional[float]
|
Minimum mean Fire Radiative Power. |
None
|
limit
|
int
|
Maximum number of features to return. |
1000
|
buffer_dist
|
Optional[float]
|
Distance to buffer around the place geometry, in meters. |
None
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
A GeoDataFrame containing fire perimeter features. |
Raises:
| Type | Description |
|---|---|
ImportError
|
If required packages are not installed. |
ValueError
|
If place cannot be geocoded. |
Example
gdf = fire_gdf_from_place("California", datetime="2024-07-01/2024-07-31") print(f"Found {len(gdf)} fires")
fire_timeseries(fire_id, collection='snapshot_perimeter_nrt', datetime=None)
¶
Get fire perimeter evolution over time for a specific fire.
Returns multiple perimeters showing how the fire grew over time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fire_id
|
str
|
The fire ID to track. |
required |
collection
|
str
|
Fire collection ID. Defaults to "snapshot_perimeter_nrt". |
'snapshot_perimeter_nrt'
|
datetime
|
Optional[str]
|
ISO 8601 date/time or interval to filter by. |
None
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
A GeoDataFrame with perimeters sorted by time. |
Example
gdf = fire_timeseries("2024_CA_001") print(f"Found {len(gdf)} perimeter snapshots")
get_fire_by_id(fire_id, collection='snapshot_perimeter_nrt', datetime=None)
¶
Get a specific fire by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fire_id
|
Union[str, int]
|
The fire ID to retrieve (can be string or numeric). |
required |
collection
|
str
|
Fire collection ID. Defaults to "snapshot_perimeter_nrt". |
'snapshot_perimeter_nrt'
|
datetime
|
Optional[str]
|
ISO 8601 date/time or interval to filter by. |
None
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
A GeoDataFrame containing the fire perimeter. |
Example
gdf = get_fire_by_id(101)
get_fire_collections(verbose=False)
¶
Get available fire collections from OpenVEDA.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
verbose
|
bool
|
If True, print collection details to console. |
False
|
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
A dictionary mapping collection IDs to their descriptions. |
Example
collections = get_fire_collections(verbose=True) print(collections.keys())
search_fires(bbox=None, place=None, collection='snapshot_perimeter_nrt', datetime=None, farea_min=None, farea_max=None, duration_min=None, duration_max=None, meanfrp_min=None, limit=1000)
¶
Search for fires with flexible filters.
This is a convenience function that combines bbox and place-based search. Either bbox or place must be provided.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bbox
|
Optional[List[float]]
|
Bounding box [west, south, east, north] in EPSG:4326. |
None
|
place
|
Optional[str]
|
Place name to geocode (e.g., "California"). |
None
|
collection
|
str
|
Fire collection ID. Defaults to "snapshot_perimeter_nrt". |
'snapshot_perimeter_nrt'
|
datetime
|
Optional[str]
|
ISO 8601 date/time or interval (e.g., "2024-07-01/2024-07-31"). |
None
|
farea_min
|
Optional[float]
|
Minimum fire area in km². |
None
|
farea_max
|
Optional[float]
|
Maximum fire area in km². |
None
|
duration_min
|
Optional[float]
|
Minimum fire duration in days. |
None
|
duration_max
|
Optional[float]
|
Maximum fire duration in days. |
None
|
meanfrp_min
|
Optional[float]
|
Minimum mean Fire Radiative Power. |
None
|
limit
|
int
|
Maximum number of features to return. |
1000
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
A GeoDataFrame containing fire perimeter features. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither bbox nor place is provided. |