make_attribute_topology: Make Attribute Topology

View source: R/make_attribute_topology.R

make_attribute_topologyR Documentation

Make Attribute Topology

Description

given a set of lines with starting and ending nodes that form a geometric network, construct an attribute topology.

Usage

make_attribute_topology(x, min_distance)

## S3 method for class 'data.frame'
make_attribute_topology(x, min_distance)

## S3 method for class 'hy'
make_attribute_topology(x, min_distance)

Arguments

x

data.frame network compatible with hydroloom_names.

min_distance

numeric distance in units compatible with the units of the projection of lines. If no nodes are found within this distance, no connection will be returned.

Details

If a future plan is set up, node distance calculations will be applied using future workers.

Value

data.frame with id and toid

Examples


x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))

y <- dplyr::select(x, COMID)

y <- sf::st_transform(y, 5070)

z <- make_attribute_topology(y, 10)

x <- add_toids(hy(x), return_dendritic = FALSE)

x[x$id == x$id[1],]$toid
z[z$COMID == x$id[1],]$toid


hydroloom documentation built on Sept. 11, 2024, 8:20 p.m.