From 4101561fc778b3834d7f4a937570dd7c5886ed98 Mon Sep 17 00:00:00 2001 From: Luuk van der Meer Date: Sun, 17 Nov 2024 18:42:54 +0100 Subject: [PATCH] fix: Correctly import sf::st_set_geometry :wrench: --- NAMESPACE | 1 + R/project.R | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 2a5c17c6..6edab0db 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -307,6 +307,7 @@ importFrom(sf,st_precision) importFrom(sf,st_reverse) importFrom(sf,st_sample) importFrom(sf,st_segmentize) +importFrom(sf,st_set_geometry) importFrom(sf,st_set_precision) importFrom(sf,st_sf) importFrom(sf,st_sfc) diff --git a/R/project.R b/R/project.R index 05fb8b0d..07297d6c 100644 --- a/R/project.R +++ b/R/project.R @@ -76,13 +76,14 @@ st_project_on_network.sfc = function(x, network, on = "edges") { ) } +#' @importFrom sf st_set_geometry #' @export st_project_on_network.sf = function(x, network, on = "edges") { P = st_project_on_network(st_geometry(x), network, on) st_set_geometry(x, P) } -#' @importFrom sf st_geometry<- st_nearest_feature st_nearest_points +#' @importFrom sf st_nearest_feature st_nearest_points #' @importFrom sfheaders sfc_cast project_on_edges = function(x, y) { E = pull_edge_geom(y) @@ -99,7 +100,7 @@ project_on_edges = function(x, y) { linestring_end_points(L) } -#' @importFrom sf st_geometry<- st_nearest_feature +#' @importFrom sf st_nearest_feature project_on_nodes = function(x, y) { N = pull_node_geom(y) # Find the nearest node to each feature.