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

Use new max_dist functionality from latest version of od to speed-up si_to_od() #38

Closed
Robinlovelace opened this issue Aug 20, 2024 · 0 comments · Fixed by #39
Closed

Comments

@Robinlovelace
Copy link
Owner

Relevant bit of code can be made more concise and way faster:

simodels/R/si_to_od.R

Lines 48 to 59 in 70ab502

if(identical(origins, destinations)) {
od_df = od::points_to_od(origins)
} else {
od_df = od::points_to_od(origins, destinations)
}
od_df$distance_euclidean = geodist::geodist(
x = od_df[c("ox", "oy")],
y = od_df[c("dx", "dy")],
paired = TRUE
)
# Max dist check
if(max(od_df$distance_euclidean) > max_dist) {

Relevant issue in {od} package: itsleeds/od#18

Want to give this a go @mem48? Basically a one-liner I think.

@Robinlovelace Robinlovelace linked a pull request Aug 21, 2024 that will close this issue
Robinlovelace added a commit that referenced this issue Aug 21, 2024
…nality-from-latest-version-of-od-to-speed-up-si_to_od

Update si_to_od() to include max_dist in {od}, close #38
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 a pull request may close this issue.

1 participant