Giter VIP home page Giter VIP logo

Comments (3)

JosiahParry avatar JosiahParry commented on July 2, 2024

One note is that this would require vctrs to become an explicit dependency rather than an implicit one as it presently is (due to recursive import of dplyr etc.)

from stplanr.

Robinlovelace avatar Robinlovelace commented on July 2, 2024

Agreed, and big 👍 to this looking at the old code

stplanr/R/line_via.R

Lines 19 to 29 in 9661722

mats2line <- function(mat1, mat2, crs = NA) {
l <- lapply(1:nrow(mat1), function(i) {
mat_combined <- rbind(mat1[i, ], mat2[i, ])
sf::st_linestring(mat_combined)
})
if(is.na(crs)) {
sf::st_sfc(l)
} else {
sf::st_sfc(l, crs = crs)
}
}

I say old because the function should probably be superseded by a function in the {od} package which {stplanr} already imports

od,

Wondering if the function should move across and maybe call od::matrices_to_od() or whatever the function ends up being called. Thoughts?

See here for the closest thing in that new package, the aim of which was and is still (when time allows) to split out all the OD processing code from {stplanr} which is, truth be told, a bit of a bloated metapackage... So any wider points on general 'where to put things' etc welcome, big refactor of this and related package could be overdue.

from stplanr.

Robinlovelace avatar Robinlovelace commented on July 2, 2024

https://itsleeds.github.io/od/reference/coords_to_od.html

from stplanr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.