Package: landfire
landfire-pythonFeatureslandfire-pythonis a wrapper around theLANDFIREProducts 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 atFireSci. However, we're happy to open-source and maintain this tool to enable broader user of LANDFIRE data across the wildfire community! 🔥Supported LANDFIRE functionalityClipping requested data to a specific bounding boxReprojection of output data coordinate system to user-specified well-known integer ID formatSpecifying a list of data product layers and obtaining a multi-band .tif outputModifying the resampling resolutionAdditional functionalitySearch 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 theLANDFIRE product availability tableto 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 productsUser input validation to reduce potential failed API jobs and server loadPlanned but not currently supportedSpecifying 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 regionsWe will add new products here as they become availableRequirementspython >=3.8, <3.12attrs,pydantic, andrequestswill be installed when you install the libOptional dependencies included in thegeospatialextra arefiona,geojsonandgeopandasInstallationpipinstalllandfireTo use the geospatial tools found ingeospatial.py, you'll need to install the extra dependencies:pipinstall"landfire[geospatial]"UsageThe simplest possible example requires simply initializing aLandfire()object for a bounding box of interest and then submitting a request for data withrequest_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.importlandfire# Obtain required layers for FlamMap landscape filelf=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 densityoutput_path="./test_flammap.zip")Please see thedocumentationfor further information on possible options, geospatial utilities, and searching for products!ContributingContributions are very welcome! 🙏 To learn more, see thecontributor guide.LicenseDistributed under the terms of theMIT license, landfire-python is free and open source software.IssuesIf you encounter any problems, pleasefile an issuealong with a detailed description! 🙌