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

insert a number of evenly distributed nodes #2696

Open
alotbsol555 opened this issue Oct 9, 2024 · 4 comments
Open

insert a number of evenly distributed nodes #2696

alotbsol555 opened this issue Oct 9, 2024 · 4 comments

Comments

@alotbsol555
Copy link

hi everyone, I would like to propose a new feature:
allow to insert a user defined number of nodes between two neighboring nodes of an existing way. the new nodes should be evenly distributed between the two existing nodes.

adding 1 node (the default) would insert the new node exactly in the middle of the two selected nodes. adding 2 nodes would "split" the way into 3 thirds of the selected way, and so on…

initially, I thought about evenly distributing existing nodes, but found #1267 and #1552, where something like this is already discussed. it seems that distributing nodes along (maybe not so straight) ways is not trivial. therefore, I hope that inserting nodes along a straight way of 2 points is easier to solve.

the result might not be exactly the same, but it would allow users to create ways with evenly distributed nodes.

@jajajaneeneenee
Copy link

I think such a feature is not really necessary, (maybe a nice-to-have, but not a must-have), if #1267 would be solved in all aspects mentioned in the comments.

Very often there are already nodes which have to be straightend or better distributed (sometimes mixed with new nodes).

I just think that if JOSM can do something very well, Vespucci should be able to do it too... Can't you look in the JOSM code to see how it's solved there (it's open source, isn't it? I'm not entirely sure...)? Or do we always have to reinvent the wheel?

@alotbsol555
Copy link
Author

you are right! if the other issue would be solved, this issue here is obsolete.

However, since the other issue is open for 4 years and it seemed difficult to solve, I wanted to suggest a smaller but useful change: insert equidistant nodes to a straight way between two existing nodes.

of course there is no need to solve both issues. so, if there is a good perspective of solving the other one, this one here could be closed right away…

@simonpoole
Copy link
Collaborator

Same comment as for #1267

OSM ways do not have a geometry independent of the nodes that make them up. Or put differently: evenly distributing nodes in the general case -changes- the geometry of the way and it is unclear what the operation should do. Move the nodes along the original geometry? But then they wont be evenly spaced in the resulting new geometry. Evenly space them in some new geometry? But then the new geometry will potentially be very different from the original one.

This is not an issue for ways that are presumed to be straight (aka defined by their start and end point), or have other fixed geometries (circle) and implementing that is more or less trivial. Both cases, that is move existing nodes so that they are evenly spaced along that predefined geometry, or adding new nodes evenly spaced are completely doable. However nobody expressed that that is what they want.

@alotbsol555
Copy link
Author

Both cases, that is move existing nodes so that they are evenly spaced along that predefined geometry, or adding new nodes evenly spaced are completely doable. However nobody expressed that that is what they want.

really sorry for the confusion, but I thought that's what the two other issues mentioned in the first post and this issue here were about :D

anyway, "completely doable" sounds great! I think adding nodes is more or less obsolete and only nice to have, if you would be able to move existing nodes between two selected nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants