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

error in overline fxn #111

Closed
sckott opened this issue Sep 1, 2016 · 8 comments
Closed

error in overline fxn #111

sckott opened this issue Sep 1, 2016 · 8 comments

Comments

@sckott
Copy link
Contributor

sckott commented Sep 1, 2016

When trying the example from the vignette I get

library(stplanr); library(sp); library(leaflet)
data("flow", package = "stplanr")
data("cents", package = "stplanr")
l <- od2line(flow = flow, zones = cents)
l <- l[!l$Area.of.residence == l$Area.of.workplace,]
lgb <- spTransform(l, CRSobj = CRS("+init=epsg:27700"))
l$d_euclidean <- rgeos::gLength(lgb, byid = T)
l$d_fastroute <- routes_fast@data$length
routes_fast$All <- l$All
overline(routes_fast, "All", fun = sum)
#> Assertion failed: (!"should never be reached"), function itemsTree, file ../../../../src/geos-3.4.2/src/index/strtree/AbstractSTRtree.cpp, line 371.

same session info as #110 - and same error whether using CRAN version or current version on master here

@richardellison
Copy link
Collaborator

I can't reproduce the problem and have nearly exactly the same session info as you except I'm running Linux and not OSX and I'm using a newer version of the geos library.

The error indicates it has something to do with the geos library. I'm running the same version of the rgeos package so it probably isn't that. I will have to try on a Mac and see if I can reproduce it.

Can you show me what the routes_fast SpatialLinesDataFrame summary looks like?

@sckott
Copy link
Contributor Author

sckott commented Sep 1, 2016

<r> routes_fast
#> class       : SpatialLinesDataFrame
#> features    : 42
#> extent      : -1.550964, -1.510925, 53.80248, 53.83041  (xmin, xmax, ymin, ymax)
#> coord. ref. : NA
#> variables   : 7
#> names       :    plan,             start,            finish, length, time, waypoint, All
#> min values  : fastest, Back Ruthven View, Back Ruthven View,    895,  132,       22,   5
#> max values  : fastest,       Town Street,       Town Street,   4248, 1279,      127, 165

@richardellison
Copy link
Collaborator

Strangely when I run the same example I end up with:

> routes_fast
class       : SpatialLinesDataFrame 
features    : 42 
extent      : -1.550964, -1.510925, 53.80248, 53.83041  (xmin, xmax, ymin, ymax)
coord. ref. : NA 
variables   : 7
names       :    plan,             start,            finish, length, time, waypoint, All 
min values  : fastest, Back Ruthven View, Back Ruthven View,   1318, 1097,      104,  10 
max values  : fastest,       Town Street,       Town Street,    975,  997,       99,  94

That being the case though, it really shouldn't make a difference as I would expect it to work with any valid SpatialLinesDataFrame (that yours appears to be). I'll have to do a bit more digging.

@Robinlovelace
Copy link
Member

@sckott is this still not working? Will open again if so, but overall the function works although seems to be slow and produce unexpected results sometimes - think that's a separate issue though.

@sckott
Copy link
Contributor Author

sckott commented Nov 7, 2016

i'll have a look ⏲

@sckott
Copy link
Contributor Author

sckott commented Nov 7, 2016

@Robinlovelace with the example in #111 (comment) I get

class       : SpatialLinesDataFrame 
features    : 85 
extent      : -1.550964, -1.510925, 53.80248, 53.83041  (xmin, xmax, ymin, ymax)
coord. ref. : NA 
variables   : 1
names       : All 
min values  :   5 
max values  : 825 

@Robinlovelace
Copy link
Member

OK great, that seems like a reasonable output to me, at least before we switch to sf!

@sckott
Copy link
Contributor Author

sckott commented Nov 7, 2016

ok, good

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

3 participants