Skip to contents

Subset a specific NFHL layer within a defined bounding box (AOI).

Usage

nfhl_get(AOI, layer = 28)

Arguments

AOI

An `sf` object representing the spatial area of interest (must have a valid CRS).

layer

Integer. The NFHL layer ID to query. Default is 28.

Value

An `sf` object containing the NFHL subset or `NULL` if the query fails.

Details

This function queries the National Flood Hazard Layers (NFHL) web service to retrieve a specific layer, clipped to a given area of interest (AOI). The result is transformed to match the CRS of the AOI.

Examples

if (FALSE) { # \dontrun{
library(sf)
# Define an AOI
AOI <- st_as_sf(data.frame(x = -105, y = 40), coords = c("x", "y"), crs = 4326) |> 
       st_buffer(0.01)

# Query NFHL layer 28
nfhl_data <- nfhl_get(AOI, layer = 28)

# Inspect result
print(nfhl_data)
} # }