Skip to content

Commit

Permalink
fix: Correctly import sf::st_set_geometry 🔧
Browse files Browse the repository at this point in the history
  • Loading branch information
luukvdmeer committed Nov 17, 2024
1 parent 7367f18 commit 4101561
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions R/project.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.
Expand Down

0 comments on commit 4101561

Please sign in to comment.