fire module¶
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")
Source code in leafmap/fire.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | |
fire_gdf_from_place(place, collection='snapshot_perimeter_nrt', datetime=None, farea_min=None, farea_max=None, duration_min=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
|
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")
Source code in leafmap/fire.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | |
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")
Source code in leafmap/fire.py
479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 | |
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)
Source code in leafmap/fire.py
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | |
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())
Source code in leafmap/fire.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | |
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. |
Example
Search by place name¶
gdf = search_fires(place="California", datetime="2024-07-01/2024-07-31")
Search by bounding box with filters¶
bbox = [-124.48, 32.53, -114.13, 42.01] gdf = search_fires(bbox=bbox, farea_min=10, datetime="2024-07-01/2024-07-31")
Source code in leafmap/fire.py
509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 | |