-
Notifications
You must be signed in to change notification settings - Fork 17
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
extract paths #12
Comments
|
@richardellison this could be how we do overline quicker. |
Here's a tiny use case that could be useful for testing: library(dodgr)
library(stplanr)
#> Loading required package: sp
sl <- routes_fast_sf[2:4, ]
rnet1 <- overline(sl = sl, attrib = "length")
rnet2 <- overline(sl = sl, attrib = "length", buff_dist = 1)
par(mfrow = c(1, 3))
plot(rnet1, lwd = rnet1$length/mean(rnet1$length))
plot(rnet2, lwd = rnet2$length/mean(rnet2$length))
sl$highway <- "highway" |
Note that aggregating flows along paths will require re-instating some of the code now deleted as part of #4 |
Great stuff. Note that the answer should be pretty objective as it relies on attribute data that already exists per line. I was expecting |
one thing occurred to me: i bet that trips made closer to the centres of cities are shorter than those made further out (because trip length should correlate with density of everything). This can't be implemented in any current way to aggregate trips, but i could probably easily do it in |
Yes I think the idea of distance decay curves varying by location has legs (and wheel) and would be a worthy topic of a paper. One thing you should note about the logistic polynomial curve we used on the pct is that it's the % of people who travel (or p of a single person who makes that trip) that can be expected to go by bike. This is different from the distance decay of people making that trip at all. Very good basis for a paper in any case. On a different but related note. I keep going on about ecological models providing a solid basis for modelling human behaviour patters - check this out: Paradis, E., Baillie, S.R., Sutherland, W.J., 2002. Modeling large-scale dispersal distances. Ecological Modelling 151, 279–292. |
One of my fundamental refs: If you read between the lines, most of it applies pretty directly to human behaviour as well |
The problem is with cycling mode choice it turns out distance is not a very powerful predictor in most settings - people will happily cycle 5km when conditions are right but not 3km when they are shoddy. But that can all by modelled and is what @mem48 and I are looking at in CyIPT> |
This is all now implemented. @Robinlovelace @richardellison check out the new functionality from the example of
The There's also a TODO
Issue to stay open until those two tasks are done |
Sounds good, will test asap. |
Tested this on the Bristol data with @mem48 and think we've the beginnings of a PR to demonstrate it. Struggling to find out how to get a dodgr_dists(graph = net, )
from <- sample (net$from_id, size = 10)
to <- sample (net$to_id, size = 5)
to <- to [!to %in% from]
flows <- matrix (10 * runif (length (from) * length (to)), nrow = length (from))
graph <- dodgr_flows (net, from = from, to = to, flows = flows)
dodgr_paths(graph = net, from = 1, to = 20) |
We get all zeros in the flow - intended?
|
nah, it shouldn't give zeros, and it works when i test it. The comparisons with extract a networkJust a random street network of modest size, and a set of 10 random routing points for aggregating flows. The latter are cast to long form for
The
|
Interesting, makes for a very useful comparison. Just one observation about the issue of sum_network_links results, the results should only return links with flows, so summary() will not (or should not at least) show any observations with a value of zero. |
Yeah, I realised that shortly after I wrote it. That at least makes sense |
All functions now implemented and working, so closing. @Robinlovelace @richardellison just keep this one in your proverbials for future reference, and we can discuss somewhere else down the track whether or not this functionality fits within There's also a The rest of it kind of depends on the future of spatial data representations in R, which will very quickly move beyond |
Very interesting stuff - not had a chance to test and understand (and it's too late too now) but will aim to get on it tomorrow after football. |
So that output of
dodgr
can be used directly inosmprob
. cc @karpfenThe text was updated successfully, but these errors were encountered: