API

Types

Dataset

Dataset(products::Vector{Product}, aoi; dir=mktempdir(), kw...)

A convenience struct that encapsulates a complete LANDFIRE dataset download and extraction.

  • products: Vector of Product structs to download
  • aoi: Area of interest (see Job constructor for accepted formats)
  • kw...: Additional keyword arguments passed to the Job constructor.

Files are cached in scratchspace based on the job hash, so repeated calls with the same parameters will return the cached result without re-downloading.

Job

No documentation found for public binding Landfire.Job.

Summary

struct Landfire.Job

Fields

email               :: String
layers              :: Vector{Landfire.Product}
area_of_interest    :: String
output_projection   :: Union{Nothing, String}
resample_resolution :: Union{Nothing, Int64}
edit_rule           :: Union{Nothing, String}
edit_mask           :: Union{Nothing, String}
priority_code       :: Union{Nothing, String}

Functions

attribute_table

attribute_table(product::Product)
attribute_table(layer::String, year::Int=2024)

Download and parse the LANDFIRE attribute table CSV for the given product or layer.

Returns a vector of NamedTuples with column names from the CSV header.

attribute_table_url

attribute_table_url(layer::String, year::Int=2024)
attribute_table_url(product::Product)

Return the URL for the LANDFIRE attribute table CSV for the given layer and year.

Available layers: FBFM13, FBFM40, EVT, EVC, FVT, FVC, FRG, SCLASS, FDIST, HDIST, BPS

cancel

cancel(job_id::String) --> obj::JSON3.Object

Cancels a submitted job. Returns a JSON3.Object with job details.

extract

extract(file, dir=tempdir())

Extract a 7zip archive to the specified directory using p7zip. Returns the directory path.

files

files(data::Dataset)

Return a vector of absolute file paths for all files in the extracted dataset directory.

filesize

filesize(url::String) -> Int

Query the size of a remote file in bytes using an HTTP HEAD request.

Returns the file size, or throws an error if the size cannot be determined.

Example

url = Landfire.full_product_url("FBFM13")
size = Landfire.filesize(url)
@info Base.format_bytes(size)

full_product_url

full_product_url(layer::String, region::String="CONUS", year::Int=2024)
full_product_url(product::Product, region::String="CONUS")

Return the URL for downloading a full extent LANDFIRE product.

  • layer: Layer name (e.g., “FBFM13”, “EVT”)
  • region: Geographic region (“CONUS”, “AK”, or “HI”)
  • year: Product year (default: 2024)

Example

url = Landfire.full_product_url("FBFM13", "CONUS", 2024)
# "https://landfire.gov/data-downloads/CONUS_LF2024/LF2024_FBFM13_CONUS.zip"

# Or from a Product (extracts layer name and year from product)
prod = Landfire.products(layer="FBFM13")[1]
url = Landfire.full_product_url(prod, "CONUS")

healthcheck

No documentation found for public binding Landfire.healthcheck.

Landfire.healthcheck is a Function.

# 1 method for generic function "healthcheck" from Landfire:
 [1] healthcheck()
     @ ~/work/Landfire.jl/Landfire.jl/src/Landfire.jl:33

products

products(latest=true; refresh=false, kw...) -> Vector{Product}

Fetch and filter available products from the LANDFIRE API.

Returns a vector of Product structs sorted by name. Results are cached locally; use refresh=true to update the cache from the API.

Keyword Arguments

  • refresh::Bool=false - Set to true to refresh the cached product list from the API

Filter products by field values. Boolean fields use exact matching, string fields use substring matching.

  • name::String
  • theme::String
  • layer::String
  • version::String
  • conus::Bool
  • ak::Bool
  • hi::Bool
  • geoAreas::String

Examples

products(conus=true)              # Only CONUS products
products(theme="Fuels")           # Products with "Fuels" in theme
products(layer="FBFM13")          # Products with "FBFM13" in layer name
products(conus=true, ak=false)    # CONUS only, not Alaska
products(refresh=true)            # Refresh cache and return all latest products

status

status(job_id::String) --> obj::JSON3.Object

Queries the status of a submitted job. Returns a JSON3.Object with job details. If obj.status == "Succeeded", the output zipfile can be downloaded from URL obj.outputFile.

submit

submit(job::Job) --> job_id::String

Submits a job to the LANDFIRE API. Returns the job ID as a string.