-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Follow a path #1614
Comments
Not super clear what this means: you mean following an existing shape? From a vector, or raster source? What's the user experience/input that goes into this? |
Yes, sorry about my vague description. I mean exactly what you said, following an existing shape. Lets say you have an island (already created coastline) where parts of it is covered by a forest. When mapping the forest you want to follow the coastline for a while and if the coastline is very complex it takes ages now when you have to click on every node. What I'd like it to be: You create your shape by clicking the nodes like now, and when you get to an already existing polygon/line you hold down some key and click on that path, then instead of clicking on each node, you just follow the path with the mouse (without clicking) until you have followed what's needed and then you release the key and continue putting out other nodes outside the existing shape. Voila! |
Here's an example of tracing in ArcGIS: And here's an example in OCAD: |
I'm reading this issue as being like the Follow Line feature in JOSM/Potlatch2. |
Looks like it should be enough to just select first and last node you want from a path segment, isn't it? Maybe three nodes if it's a closed shape to determine direction. |
bhousel made a good point in IRC, which deserves consideration, so I want to preserve for posterity: "it could just be a key that connects the next point, and you can repeatedly press it to connect more points." |
The logic in #3539 for staying on the same line will come in handy here. |
https://josm.openstreetmap.de/wiki/Help/Action/FollowLine has an example of how this works in JOSM. The DWG has recently been in discussions with an user who was mapping everything as multipolygons, because splitting a way into segments and building an MP in iD is easier than manually following big parts of another line. Having this feature would directly help this user's mapping. |
I've come across some mapping tasks for this as well. It would be nice to click a node (A) on a complicated poly, click the next node (B) and tap some key (f for "follow"?) and have new nodes added to follow in the direction A->B->.... |
We should also support to follow a path with constant distance. Otherwise, we would encourage users to glue landuses to highways. |
Looks like a very sane and time efficient method to me. I would really like to see this implemented in iD! 😃 |
This seems straightforward to implement: If a hotkey is pressed (while creating a line/area) and the current point is a boundary point of an existing line or the current and the previous point are on an existing line, follow this line by adding the next point (if there is more than one line do nothing). |
Here is a patch and two gist: one for the action and one for the operation. You must first select the target way (the one that will follow the source way), then the source way, then the starting point, then the ending point. There must not be any other point between the start point and end point on the target way, and both points must be connected to both the source and target ways. I did not create an icon in the toolbar nor any test or specs yet, but it is functional until someone finds the time to complete the code. |
@kaligrafy Looks cool! Could you create a branch and draft pull request for what you've done so far? It's hard to work with code in gists. Also, we're not updating the |
OK, I'll try with the develop branch and add a pull request. I tested it a bit more this morning. It works most of the time, but there can be some issues when following can be done on two sides. |
@kaligrafy Let me know if you need any assistance! I can help with the code issues once the PR is up. |
I am working on a second action called smooth to add automatic curves to lines. When I'm done with it, I will review the code and provide a pull request for both actions. The follow action does not work all the time (it fails when there are two sides to choose from or when the first point and last points are the starting and ending nodes of the target line). I will try to fix them. I have a question: where is the code that loads the icon for the action? Where should I put the svg icon and where can I link it to the action? Thanks! |
Now the gist is fixed for any kind of ways for source and target (closed, not closed, clockwise, counterclockwise) and no need to select the two intersecting points if there are only two between the source and target ways. I will post a pull request soon. |
Great! Looking forward to the PR.
Sounds interesting, but please make a separate PR since it's not related to following a path.
Simply put the file under svg/iD-sprite/operations/ with the operation ID and it will be loaded automatically. Don't worry about the icon too much, we can work on that later. |
Manual:
|
@kaligrafy: Any plans to resolve conflict PR #7649 or rather re-implement this greatly needed feature on the latest iD? |
Well, unfrotunalty, I don't have the time right now to do that, but fell free to try to fix it if you think it could be usefull on the short term. Thanks! |
I would keep this issue open, since my method is very different from the merged one. I still think we should add mine too. I use it everyday on my fork. |
My follow operation can use a beginning and an end points and follow in between, which is way faster on complex polygons. However, the merged version is really useful for short segments though |
In other mapping software like ArcGIS and OCAD there is an option for following a polyline/polygon when creating a new object instead of adding all nodes one by one.
This function would be amazing and time saving if iD had it!
The text was updated successfully, but these errors were encountered: