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

Merge/Simplify split ways #11

Open
Nate-Wessel opened this issue Jan 14, 2020 · 2 comments
Open

Merge/Simplify split ways #11

Nate-Wessel opened this issue Jan 14, 2020 · 2 comments
Labels
feature New feature/development thought needed undecided, uncertain, needs attention

Comments

@Nate-Wessel
Copy link
Owner

OSM data for Toronto has hundreds of split ways representing larger streets where they are divided by traffic islands:
Screenshot_2020-01-14_11-46-25

This is usually done to help with car routing, but they are ugly and inappropriate at the scale of this map. They should somehow be merged/simplified into a single way. Some of this can be done directly in OSM where appropriate, but most of the changes will need to be made algorithmically while processing the data.

Split ways can be detected as oneway pairs having the same name, especially if they connect at a shared node to a two-way with the same common name.

There may also be cases where it would be innapropiate to merge ways, such as some parts of Spadina, Queensway, University, etc. We would need to specify some sort of distance threshold past which merging wouldn't happen. We wouldn't want to eliminate the Spadina Crescent or Queens Park!

@Nate-Wessel Nate-Wessel added the feature New feature/development label Jan 14, 2020
@Nate-Wessel
Copy link
Owner Author

See also:
https://gist.github.com/Nate-Wessel/e7d72da7c7c12e00a472b41537334f8d
A slow overpass query for helping to detect split ways

@Nate-Wessel Nate-Wessel added the thought needed undecided, uncertain, needs attention label Jan 17, 2020
@Nate-Wessel
Copy link
Owner Author

It seems like some sort of force-based (e.g. D3-force) algorithm could work here.

  1. identify / isolate the split ways
  2. apply inverse square (gravity) force to pull nodes on opposite ways together, perhaps interpolating/adding nodes
  3. apply force (linear???) to pull nodes back toward their given positions
  4. apply tension to line, so nodes pulling together can pull in nodes that would otherwise stay putt
  5. construct single line from collapsed edges

Where very close, lines should essentially snap together. Where very far apart (e.g. Spadina Crescent) they should stay at their original positions. Edge cases like the approach to that crescent should have a smooth transition between merged and split.

See interactive JS demo: https://observablehq.com/d/0f97e8cb32b46de4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature/development thought needed undecided, uncertain, needs attention
Projects
None yet
Development

No branches or pull requests

1 participant