Skip to contents

A dataset containing example lake sampling sites from the Adirondack region of New York State. These synthetic but realistic coordinates demonstrate typical multi-lake sampling scenarios.

Usage

adirondack_sites

Format

A data frame with 12 rows and 5 variables:

Site

Unique site identifier

lake.name

Name of the lake

latitude

Latitude in decimal degrees (WGS84)

longitude

Longitude in decimal degrees (WGS84)

datetime

Date and time of sampling (POSIXct)

Source

Synthetic data for demonstration purposes

Details

The dataset includes sites from four Adirondack lakes:

  • Blue Mountain Lake (3 sites)

  • Raquette Lake (4 sites)

  • Long Lake (2 sites)

  • Tupper Lake (3 sites)

Examples

# Load the dataset
data(adirondack_sites)

# View structure
str(adirondack_sites)
#> 'data.frame':	12 obs. of  5 variables:
#>  $ Site     : chr  "Blue_Mountain_1" "Blue_Mountain_2" "Blue_Mountain_3" "Raquette_1" ...
#>  $ lake.name: chr  "Blue Mountain Lake" "Blue Mountain Lake" "Blue Mountain Lake" "Raquette Lake" ...
#>  $ latitude : num  43.9 43.9 43.9 43.8 43.8 ...
#>  $ longitude: num  -74.4 -74.4 -74.4 -74.7 -74.7 ...
#>  $ datetime : POSIXct, format: "2024-07-15 09:30:00" "2024-07-15 10:15:00" ...

# Use with lakefetch (requires internet connection)
# \donttest{
sites <- load_sites(adirondack_sites)
#>   Loaded 12 rows with columns: Site, lake.name, latitude, longitude, datetime
#>   Using columns: Latitude = latitude, Longitude = longitude
#>   Detected datetime column: datetime
#>   Preserved lake name column: lake.name
#>   Final valid samples: 12
#>   Detected location from column 'lake.name': 4 lakes
lake_data <- get_lake_boundary(sites)
#> Converting to spatial format...
#> Spherical geometry (s2) switched off
#> Downloading lake boundaries from OpenStreetMap...
#>   Bounding box: [-74.7115, 43.7742, -74.3775, 44.2712]
#>     Trying name-filtered query for: Blue Mountain Lake, Raquette Lake, Long Lake, Tupper Lake
#>     Error: arguments imply differing number of rows: 1160, 0
#>     Server error, trying another server in 10s...
#>     Failed after 3 attempts: arguments imply differing number of rows: 1160, 0
#>     Found 23 polygons
#>     Found 1 multipolygons
#>     Found 17 polygons
#>     Found 1 multipolygons
#>     Error: arguments imply differing number of rows: 3426, 0
#>     Server error, trying another server in 10s...
#>     Failed after 3 attempts: arguments imply differing number of rows: 3426, 0
#>     Name-filtered query found results, skipping broad query
#>   Combining results...
#>   Total water bodies found: 42
#>   Auto-detected UTM Zone: 18N
#>   Transforming to UTM for analysis...
#>   Processing lake polygons...
#>   Filtered 4 water bodies < 1e-04 km2
#>   Processed 38 unique lake polygons
#>   Total area: 38.99 km2
#> Spherical geometry (s2) switched on
results <- fetch_calculate(sites, lake_data)
#> Effective fetch method: top3
#> Using default depth: 10 m
#> Assigning sites to lakes...
#>   Checking direct intersections...
#>     1 sites matched directly
#>   Checking 11 unmatched sites with 100m tolerance...
#>     1 additional sites matched within tolerance
#>   Trying name-based matching using 'lake.name' column...
#>     WARNING: No OSM lake found matching 'Blue Mountain Lake' (3 sites)
#>     Matched 2 sites to 'Raquette Lake' via name matching from 'Raquette Lake'
#> Warning: Skipped 1 site(s) named 'Raquette Lake': too far from OSM lake 'Raquette Lake' (>500m). Site(s) may be on a different water body. Sites: Raquette_3_20240716
#>     Matched 1 sites to 'Long Lake' via name matching from 'Long Lake'
#>     WARNING: No OSM lake found matching 'Tupper Lake' (3 sites)
#>   Site assignment summary:
#>     Matched: 5/12
#>     Unmatched: 7
#>     Unmatched sites claim to be in: Blue Mountain Lake, Raquette Lake, Tupper Lake
#>     Unmatched coordinate range:
#>       Lat: 4852677.9675 to 4897537.8688
#>       Lon: 526526.3106 to 545349.3624
#>     TIP: Try lakefetch_options(gps_tolerance_m = 100) for larger buffer
#>     TIP: Check if the lake exists in OpenStreetMap at openstreetmap.org
#>   Sites per lake:
#>     ID: 1871997: 2 sites
#>     ID: 555231: 3 sites
#> Calculating fetch for multiple lakes...
#>   Buffering sites 10m inward
#>   Angle resolution: 5 degrees
#> Warning: Skipping 7 sites not matched to any lake: Blue_Mountain_1_20240715, Blue_Mountain_2_20240715, Blue_Mountain_3_20240715, Raquette_3_20240716, Tupper_1_20240718, Tupper_2_20240718, Tupper_3_20240718
#> Processing 2 lake(s)...
#> Using parallel processing with 2 cores for 2 lakes
#> Fetch calculation complete.
#> Adding lake context (NHD integration)...
#>   Fetching NHD waterbodies...
#>     Found 297 NHD waterbodies
#>   Processing lake: 555231
#> Warning: attribute variables are assumed to be spatially constant throughout all geometries
#> Warning: attribute variables are assumed to be spatially constant throughout all geometries
#> Warning: attribute variables are assumed to be spatially constant throughout all geometries
#>     Found 1 outlet(s) and 8 inlet(s)
#> Warning: st_centroid assumes attributes are constant over geometries
#>   Processing lake: 1871997
#> Warning: attribute variables are assumed to be spatially constant throughout all geometries
#> Warning: attribute variables are assumed to be spatially constant throughout all geometries
#>     Found 1 outlet(s) and 10 inlet(s)
#> Warning: st_centroid assumes attributes are constant over geometries
#> Lake context complete.
# }