Skip to content

Comments

Add shared paths algorithm#51

Closed
lehtojaa wants to merge 2 commits intomainfrom
refactor-shared-paths
Closed

Add shared paths algorithm#51
lehtojaa wants to merge 2 commits intomainfrom
refactor-shared-paths

Conversation

@lehtojaa
Copy link
Collaborator

@lehtojaa lehtojaa commented Dec 29, 2025

Description

Adds algorithm for road network that consists of shared paths. It removes shared path links that go too close to bigger roads.

Type of change

  • Bug fix

  • New feature

  • Other

  • Non-breaking change

  • Breaking change

Developer checklist

  • A CHANGELOG entry has been included (only when change is visible to users)

@lehtojaa
Copy link
Collaborator Author

lehtojaa commented Jan 7, 2026

@JuhoErvasti After opening this PR, it occurred to me the resemblance of the task with the generalize cliffs algorithm. Maybe this could be refactored to functions etc. in that PR? Or having read the discussion under PR #49, what would be the best way forward.

@lehtojaa lehtojaa changed the title DRAFT: Add shared paths algorithm Add shared paths algorithm Jan 7, 2026
@JuhoErvasti
Copy link
Collaborator

JuhoErvasti commented Jan 7, 2026

@lehtojaa

Maybe this could be refactored to functions etc. in that PR?

I didn't entirely understand how do you mean this, do you mean that the "helper" functions remove_close_line_segments and get_paths_along_roads would be refactored to one function, or the algorithm classes themselves?

As far as I can tell there is a difference between the algorithms in that GeneralizeCliffs straight up removes parts of the "lesser priority" lines which overlap with the buffered "higher priority" lines and can lead to features splitting to multigeometries, whereas GeneralizeSharedPaths remove only entire features which are fully within the buffered "higher priority" lines. Also GeneralizeCliffs removes short lines.

If these are the intended behaviors of each algorithm I don't think they can be entirely refactored, or the behaviors would have to be controlled by parameters. IMO if we're talking about the helper functions I'd prefer to keep the functions separate and not parametrize the behavior as the results are quite different, but that's just my preference. IMO combining the algorithms would make more sense, but I'm not sure which is better from the perspective of integrating the algorithms to a wider system.

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