Skip to content

type_col in weight_streetnet.sc - #341

Merged
mpadge merged 2 commits into
UrbanAnalyst:type-colfrom
RegularnaMatrica:fix/type_col_recovered
Aug 28, 2026
Merged

mpadge merged 2 commits into
UrbanAnalyst:type-colfrom
RegularnaMatrica:fix/type_col_recovered

Conversation

@RegularnaMatrica

Copy link
Copy Markdown
Contributor

Added type_col to weight_streetnet.sc by adding it as parameter to functions weight_sc_edges and set_maxspeed.

Comment thread R/weight-streetnet-times.R Outdated
set_maxspeed <- function (graph, wt_profile, wt_profile_file, type_col) {

if (!"maxspeed" %in% names (graph)) {
if (!type_col %in% names (graph)) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wrong, here it should use maxspeed

@mpadge

mpadge commented May 15, 2026

Copy link
Copy Markdown
Member

@RegularnaMatrica Thanks for this, and sorry it's taken me a while to get back to you. Your PR looks like a good abstraction that will improve flexibility here. To clarify what the abstraction of type_col is intended to do, could you please just update function signatures with default values? So replace this:

weight_sc_edges <- function (graph, wt_profile, wt_profile_file, type_col)

with this:

weight_sc_edges <- function (graph, wt_profile, wt_profile_file, type_col = "highway")

Alternatively, if you prefer to avoid duplicating that hard-coded value defined in weight-streetnet.R, could you instead add some documentation to weight_sc_edges just explaining that type_col is defined in weight_streetnet() with a default of "highway".


You should also be able to see that the tests currently fail, because one more set_maxspeed() call needs to be updated:

graph <- set_maxspeed (graph, wt_profile_name, wt_profile_file) %>%

@mpadge

mpadge commented Aug 25, 2026

Copy link
Copy Markdown
Member

@RegularnaMatrica Are you still interested in getting this PR merged? Please let me know; thanks.

@mpadge
mpadge changed the base branch from main to type-col August 28, 2026 10:09
@mpadge
mpadge merged commit 3750e37 into UrbanAnalyst:type-col Aug 28, 2026
0 of 7 checks passed
mpadge added a commit that referenced this pull request Aug 28, 2026
mpadge added a commit that referenced this pull request Aug 28, 2026
mpadge added a commit to harrysroberts/dodgr that referenced this pull request Sep 1, 2026
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 this pull request may close these issues.

2 participants