get_lake_boundary: Get Lake Boundary

View source: R/lake_sources.R

get_lake_boundaryR Documentation

Get Lake Boundary

Description

Get lake boundary polygon(s) either from OpenStreetMap or from a local file.

Usage

get_lake_boundary(sites, file = NULL)

Arguments

sites

A data.frame with latitude and longitude columns, or an sf object.

file

Optional file path to a shapefile or geopackage with lake boundaries.

Details

If file is provided, the lake boundary is loaded from the file. Otherwise, the function downloads lake boundaries from OpenStreetMap based on the bounding box of the provided sites.

Value

A list with elements:

all_lakes

sf object with lake polygons in UTM projection

sites

sf object with site points in UTM projection

utm_epsg

EPSG code for the UTM projection used

Examples


csv_path <- system.file("extdata", "sample_sites.csv", package = "lakefetch")
sites <- load_sites(csv_path)
lake_data <- get_lake_boundary(sites)



lakefetch documentation built on March 20, 2026, 5:10 p.m.