Skip to content

Commit

Permalink
Merge pull request #253 from UrbanAnalyst/match-pts
Browse files Browse the repository at this point in the history
fix match-pts tests to close #252
  • Loading branch information
mpadge authored Sep 26, 2024
2 parents 1849001 + b9b3dc0 commit ed14b4b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dodgr
Title: Distances on Directed Graphs
Version: 0.4.1.027
Version: 0.4.1.028
Authors@R: c(
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre")),
person("Andreas", "Petutschnig", role = "aut"),
Expand Down
5 changes: 2 additions & 3 deletions R/match-points.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ pre_process_xy <- function (xy) {
}
}

if (is (xy, "tbl")) {
xy <- data.frame (xy)
}
if (is (xy, "sf")) {
if (!"geometry" %in% names (xy)) {
stop ("xy has no sf geometry column")
Expand All @@ -93,6 +90,8 @@ pre_process_xy <- function (xy) {
matrix (nrow = 2) %>%
t ()
xy <- data.frame (x = xy [, 1], y = xy [, 2])
} else if (is (xy, "tbl")) {
xy <- data.frame (xy)
} else {
xyi <- find_xy_col_simple (xy)
xy <- data.frame (x = xy [, xyi [1]], y = xy [, xyi [2]])
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"codeRepository": "https://github.com/UrbanAnalyst/dodgr",
"issueTracker": "https://github.com/UrbanAnalyst/dodgr/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.4.1.027",
"version": "0.4.1.028",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-match-pts-fns.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ clear_dodgr_cache ()

test_that ("points to verts", {

set.seed (1L)
bb <- attr (hampi$geometry, "bbox")
n <- 100
x <- bb [1] + (bb [3] - bb [1]) * runif (n)
Expand Down

0 comments on commit ed14b4b

Please sign in to comment.