Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLN example crashes on Travis #267

Closed
Robinlovelace opened this issue Sep 2, 2018 · 1 comment
Closed

SLN example crashes on Travis #267

Robinlovelace opened this issue Sep 2, 2018 · 1 comment

Comments

@Robinlovelace
Copy link
Member

An locally sometimes it seems, but not in a reprex it seems:

library(stplanr)
SLN <- SpatialLinesNetwork(route_network)
class(SLN)
#> [1] "SpatialLinesNetwork"
#> attr(,"package")
#> [1] "stplanr"
weightfield(SLN) # field used to determine shortest path
#> [1] "length"
plot(SLN)
points(sln2points(SLN)[1, ], cex = 5)
points(sln2points(SLN)[50, ], cex = 5)
shortpath <- sum_network_routes(SLN, 1, 50, sumvars = "length")
plot(shortpath, col = "red", lwd = 4, add = TRUE)
points(sln2points(SLN)[35, ], cex = 5)
shortpath <- sum_network_routes(SLN, 1, 35, sumvars = "length")
plot(shortpath, col = "red", lwd = 4, add = TRUE)

library(sf)
#> Linking to GEOS 3.6.2, GDAL 2.2.3, proj.4 4.9.3
SLN_sf <- SpatialLinesNetwork(route_network_sf)
plot(SLN_sf)
shortpath <- sum_network_routes(SLN_sf, 1, 50, sumvars = "length")
plot(shortpath$geometry, col = "red", lwd = 4, add = TRUE)

Created on 2018-09-02 by the reprex package (v0.2.0).

See https://travis-ci.org/ropensci/stplanr/builds/423626174#L8581

@Robinlovelace
Copy link
Member Author

I've isolated the issue:

library(stplanr)
sln <- SpatialLinesNetwork(route_network)
class(sln)
#> [1] "SpatialLinesNetwork"
#> attr(,"package")
#> [1] "stplanr"
weightfield(sln) # field used to determine shortest path
#> [1] "length"
plot(sln)
points(sln2points(sln)[1, ], cex = 5)
points(sln2points(sln)[50, ], cex = 5)
shortpath <- sum_network_routes(sln, 1, 50, sumvars = "length")
plot(shortpath, col = "red", lwd = 4, add = TRUE)
points(sln2points(sln)[35, ], cex = 5)
shortpath <- sum_network_routes(sln, 1, 35, sumvars = "length")
plot(shortpath, col = "red", lwd = 4, add = TRUE)

library(sf)
#> Linking to GEOS 3.5.1, GDAL 2.1.2, PROJ 4.9.3
sln_sf <- SpatialLinesNetwork(route_network_sf)
plot(sln_sf)

# \dontrun{
shortpath <- sum_network_routes(sln_sf, 1, 50, sumvars = "length")
#> Column `do_union` not found in `.data`
plot(shortpath$geometry, col = "red", lwd = 4, add = TRUE)
#> Warning in min(x): no non-missing arguments to min; returning Inf
#> Warning in max(x): no non-missing arguments to max; returning -Inf
#> Warning in min(x): no non-missing arguments to min; returning Inf
#> Warning in max(x): no non-missing arguments to max; returning -Inf
#> Warning in plot.window(...): "add" is not a graphical parameter
#> Error in plot.window(...): need finite 'xlim' values

Created on 2019-05-09 by the reprex package (v0.2.1)

Robinlovelace added a commit that referenced this issue May 9, 2019
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

No branches or pull requests

1 participant