Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzhao0217 committed Oct 9, 2024
1 parent 3343c69 commit 5bea2e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data-raw/remove_dangles.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ remove_dangles <- function(network, crs_proj = 27700, tolerance = 1, iterative =
library(sf)
library(igraph)
library(dplyr)
library(tidyr) # For the 'separate' function
library(tidyr)
# Step 1: Transform to Projected CRS
projected_crs <- st_crs(crs_proj)
Expand All @@ -296,7 +296,7 @@ remove_dangles <- function(network, crs_proj = 27700, tolerance = 1, iterative =
network_noded <- st_line_merge(network_noded)
network_noded_sf <- st_cast(network_noded, "LINESTRING")
# Step 3: Snap the Network to Itself (Optional, can be skipped if not needed)
# Step 3: Snap the Network to Itself
threshold <- units::set_units(tolerance, "m")
network_snapped <- st_snap(network_noded_sf, st_union(network_noded_sf), tolerance = threshold)
Expand Down

0 comments on commit 5bea2e6

Please sign in to comment.