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

Add arguments to rnet_merge() preventing sideroads getting values of main roads #520

Closed
Robinlovelace opened this issue Aug 24, 2023 · 3 comments · Fixed by #521
Closed

Comments

@Robinlovelace
Copy link
Member

Robinlovelace commented Aug 24, 2023

Reproducible example showing this behaviour with high values on sideroads:

remotes::install_dev("stplanr")
#> Using github PAT from envvar GITHUB_PAT
#> Skipping install of 'stplanr' from a github remote, the SHA1 (6583e631) has not changed since last install.
#>   Use `force = TRUE` to force installation
library(stplanr)

rnet_x = rnet_subset(osm_net_example[1], route_network_small)
#> Warning: attribute variables are assumed to be spatially constant throughout
#> all geometries
#> Warning in st_cast.sf(sf::st_cast(x, "MULTILINESTRING"), "LINESTRING"):
#> repeating attributes for all sub-geometries for which they may not be constant
# The source object:
rnet_y = route_network_small["flow"]
rnet_y$quietness = rnorm(nrow(rnet_y))
funs = list(flow = sum, quietness = mean)
rnet_merged = rnet_merge(rnet_x[1], rnet_y[c("flow", "quietness")],
                         dist = 9, segment_length = 20, funs = funs)
#> Warning: attribute variables are assumed to be spatially constant throughout
#> all geometries

#> Warning: repeating attributes for all sub-geometries for which they may not be
#> constant
#> Linking to GEOS 3.11.1, GDAL 3.6.4, PROJ 9.1.1; sf_use_s2() is TRUE
#> Warning: st_centroid assumes attributes are constant over geometries
#> Joining with `by = join_by(osm_id)`
plot(rnet_y["flow"])

plot(rnet_merged["flow"])

Created on 2023-08-24 with reprex v2.0.2

See nptscot/networkmerge#54
for details

@Robinlovelace
Copy link
Member Author

Interesting separate issue identified here: bridge over lady beck isn't being picked-up:

image

Robinlovelace added a commit that referenced this issue Aug 24, 2023
@Robinlovelace
Copy link
Member Author

Latest version avoids sideroads, I think, but worsens the problem of missing links for sections in x that are short.

@Robinlovelace
Copy link
Member Author

image

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