Skip to content

Conversation

@robitalec
Copy link

Details in #289

Adds tests for NAs returned when X and/or Y coordinates are nan.

Current behaviour:

library(s2)
p1 <- 'POINT (1 1)'
p2 <- 'POINT (2 nan)'
p3 <- 'POINT (nan nan)'

s2_distance_matrix(c(p1, p2, p3), c(p1, p2, p3))
#>          [,1]     [,2] [,3]
#> [1,]        0 20015118   NA
#> [2,] 20015118 20015118   NA
#> [3,]       NA       NA   NA

Expected behaviour:

library(s2)
p1 <- 'POINT (1 1)'
p2 <- 'POINT (2 nan)'
p3 <- 'POINT (nan nan)'

s2_distance_matrix(c(p1, p2, p3), c(p1, p2, p3))
#>          [,1]  [,2] [,3]
#> [1,]        0  NA   NA
#> [2,]       NA  NA   NA
#> [3,]       NA  NA   NA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant