Skip to contents

Hydrofabric I/O

Read and write hydrofabric layers from GeoPackages, and lazily query any GDAL/OGR vector source with dplyr.

read_hydrofabric()
Read Hydrofabric Layers from a GeoPackage (or accept in-memory `sf` objects)
write_hydrofabric()
Write a hydrofabric GeoPackage (mixed sf + non-sf)
as_ogr()
Delayed read for vector resources
layer_exists()
Check if a layer exists in a geopackage
OGRSQL()
OGRSQL OGRSQL driver, use to [dbConnect()] to a data source readable by sf

Cloud & GeoParquet

Authenticated cloud access and GeoParquet/Arrow round-trips for sf objects.

lynker_spatial_auth()
Authenticate with Lynker Spatial
lynker_spatial_token()
Get an OAuth2 token for Lynker Spatial
lynker_spatial_refresh()
Refresh an existing Lynker Spatial token
duckdb_connection()
Create a new DuckDB connection
tbl_http()
Read DuckDB File(s) over HTTP
st_read_parquet()
Read a Parquet file to sf object
st_write_parquet()
Write sf object to Parquet file
read_sf_dataset()
Read Parquet Dataset
write_sf_dataset()
Write Parquet Dataset

Geometry cleaning

Repair and simplify DEM-derived catchment geometry, and fast unions by ID.

clean_geometry()
Clean Catchment Geometry
clean_gpkg_layer()
Clean polygon topology in a GeoPackage layer using GDAL and Mapshaper
union_polygons()
Fast polygon union by ID
union_linestrings()
Fast linestring union by ID
flowpaths_to_linestrings()
Convert MULTILINESTRINGS to LINESTRINGS

Network & topology

Algorithms over the directed (DAG) flow network.

accumulate_downstream()
Accumulate an attribute downstream over a directed acyclic network
get_hydroseq()
Compute and add the hydrosequence to a directed acyclic network
get_streamorder()
Compute and add Strahler stream order to a directed acyclic network
add_measures()
Add length and area measures to flowpaths/divides
add_areasqkm()
Compute area in square kilometers (numeric)
add_lengthkm()
Compute length in kilometers (numeric)
get_node()
Get endpoint or startpoint of LINESTRING
node_geometry()
Node geometry from line endpoints
rename_geometry()
Rename geometry column of sf object

Versioning & quality assurance

Stamp dataset versions and provenance into GeoPackages, and run staged pipeline invariant checks shared across the stack.

gpkg_set_version()
Stamp a dataset version into a GeoPackage's metadata tables
gpkg_get_version()
Read the dataset version written by [gpkg_set_version()]
hf_check_invariants()
Pipeline invariant checks
hf_check_merge_invariants()
Global-merge (Stage 4) conservation + completeness invariants
hf_check_attr_bounds()
Check divide/flowpath attribute values against physical-range bounds
hf_attr_bounds()
Physical-range bounds for divide and flowpath attributes

DBI / OGR-SQL backend

Low-level S4 classes and methods backing the lazy as_ogr() interface.