Skip to main content

landfire-python

PyPI Status Python Version License

Read the documentation at https://landfire-python.firesci.io/ Tests Codecov

pre-commit Black

Features

landfire-python is a wrapper around the LANDFIRE Products Service API, allowing users to obtain any of the available LANDFIRE data layers with just a few lines of code. This library was initially built to faciliate automated data ingest for wildfire modeling and analysis internally at FireSci. However, we're happy to open-source and maintain this tool to enable broader user of LANDFIRE data across the wildfire community! 🔥

Supported LANDFIRE functionality

  • Clipping requested data to a specific bounding box
  • Reprojection of output data coordinate system to user-specified well-known integer ID format
  • Specifying a list of data product layers and obtaining a multi-band .tif output
  • Modifying the resampling resolution

Additional functionality

  • Search functionality to allow users to search for products by LANDFIRE version, name, product theme, product code, or availability regions (US, AK, HI). If you're a highly visual person, take a look at the LANDFIRE product availability table to find your layer(s) of interest.
  • Geospatial helpers to obtain suitable bounding box from a GeoJSON polygon or file (GeoJSON, ESRI Shapefile, ESRIJSON, CSV, FlatGeobuf, SQLite)
  • Robust model and enumerations of LANDFIRE products
  • User input validation to reduce potential failed API jobs and server load

Planned but not currently supported

  • Specifying edit rules for fuels data (requires a great deal of user-input validation)
  • Specifying an edit mask for edit rules (requires more LANDFIRE API i/o implementation)
  • Note the LANDFIRE API does not currently provide support for insular regions
  • We will add new products here as they become available

Requirements

Installation

pip install landfire

To use the geospatial tools found in geospatial.py, you'll need to install the extra dependencies:

pip install "landfire[geospatial]"

Usage

The simplest possible example requires simply initializing a Landfire() object for a bounding box of interest and then submitting a request for data with request_data(), specifying the layers of interest and file location to download to (note that the file does not need to exist yet, but the path to the file should be valid).

This example downloads the minimum required layers to construct a landscape (.lcp) file for FlamMap.

import landfire

# Obtain required layers for FlamMap landscape file
lf = landfire.Landfire(bbox="-107.70894965 46.56799094 -106.02718124 47.34869094")
lf.request_data(layers=["ELEV2020",   # elevation
                        "SLPD2020",   # slope degrees
                        "ASP2020",    # aspect
                        "220F40_22",  # fuel models
                        "220CC_22",   # canopy cover
                        "220CH_22",   # canopy height
                        "220CBH_22",  # canopy base height
                        "220CBD_22"], # canopy bulk density
                output_path="./test_flammap.zip")

Please see the documentation for further information on possible options, geospatial utilities, and searching for products!

Contributing

Contributions are very welcome! 🙏 To learn more, see the contributor guide.

License

Distributed under the terms of the MIT license, landfire-python is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description! 🙌

Metadata

Release files for landfire 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for landfire 0.5.0
File Size Uploaded
landfire-0.5.0.tar.gz 17.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for landfire 0.5.0
File Interpreter ABI Platform
landfire-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.4 kB

Release files / landfire-0.5.0.tar.gz

Download URL landfire-0.5.0.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a5242500e187b94bbc82261457f77508d73490819f49306aa2494eaf1af1d2d8
BLAKE2b-256 checksum
How to use checksums
4672b927918a83e49aaa2bb72453345ab06cc321fe3c74e1f5167fb1c7b53a7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / landfire-0.5.0-py3-none-any.whl

Download URL landfire-0.5.0-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a22dd150de5020582b05124489b13922941cf8ed00312836d81af24d571e69f
BLAKE2b-256 checksum
How to use checksums
828e79fe6a1840c59921e8f498825391dc90b7e58555c866ba03b9d6d8f054a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page