Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Potlatch 2: create ways with only 1 node #4378

Open
openstreetmap-trac opened this issue Jul 23, 2021 · 8 comments
Open

Potlatch 2: create ways with only 1 node #4378

openstreetmap-trac opened this issue Jul 23, 2021 · 8 comments

Comments

@openstreetmap-trac
Copy link

Reporter: Firefly!
[Submitted to the original trac issue database at 7.25am, Wednesday, 25th April 2012]

In discussion with other mappers about my last ticket 4375 I found out, P2 can also create ways with only 1 node.

Now I will try to reproduce it:
-You have a way "line 1"
(f.e. http://www.openstreetmap.org/browse/way/161026285)
-line 1 contains a node "point A"
(f.e. http://www.openstreetmap.org/browse/node/1730320325)
-You start to draw a new closed way "line 2" from point A, ending in point A
-Remove all nodes of line 2, except point A
-At uploading Potlatch creates the "line 2" with the only one node "point A"
(f.e. http://www.openstreetmap.org/browse/way/161026287)

Best regards

@openstreetmap-trac
Copy link
Author

Author: Oli-Wan
[Added to the original trac issue at 11.28am, Wednesday, 25th April 2012]

This is actually a duplicate of #2501; the problem has been known for a long time. However, I can confirm that the procedure outlined above actually "works" and reproduces the error.

@openstreetmap-trac
Copy link
Author

Author: stevage
[Added to the original trac issue at 1.36pm, Friday, 11th May 2012]

Ok, after investigating the code, the cause is straightforward: there are basically no checks in any of the places that way nodes get deleted. There's also some code cruft I'd like to clean up, like the existence of both RemoveNodeByIndexAction and RemoveNodeFromWayAction - which do almost identical things, but are implemented independently.

Fixing some of this isn't totally trivial, because single-issue undoable actions (like RemoveNodeFromWayAction) can't readily handle occasional side-effects like deleting the way as well. But I'm on it.

@openstreetmap-trac
Copy link
Author

Author: stevage
[Added to the original trac issue at 6.14am, Sunday, 13th May 2012]

Fixed in systemed/potlatch2#67

@openstreetmap-trac
Copy link
Author

Author: Firefly!
[Added to the original trac issue at 12.55pm, Wednesday, 23rd May 2012]

After waiting for update (It seems that I got a new P2 version yesterday. -> build = 2.3-393-gd6503c3) I did test again my described way to create a way with only 1 node.
Unfortunately it is still possible to create one, f.e. http://www.openstreetmap.org/browse/way/164694687

@openstreetmap-trac
Copy link
Author

Author: stevage
[Added to the original trac issue at 1.35pm, Friday, 25th May 2012]

The patch hasn't been accepted yet. If you want to know when it has, watch this page:

http://git.openstreetmap.org/potlatch2.git/tree/HEAD:/net/systemeD/halcyon/connection/actions

When the file "RemoveNodeByIndexAction.as" disappears, the patch is in. I think.

@openstreetmap-trac
Copy link
Author

Author: maetma
[Added to the original trac issue at 6.37pm, Tuesday, 19th June 2012]

Click node 1, click node 2, re-click node 1, delete node 2 : it gets way with one node

http://www.openstreetmap.org/browse/changeset/11951111

@openstreetmap-trac
Copy link
Author

Author: EdLoach
[Added to the original trac issue at 6.07pm, Thursday, 1st November 2012]

Slightly more detailed steps to reproduce. Add a node to an existing way. Draw new way from this node, making a way with two nodes. Press escape to exit draw way. new way is selected. Click the end node you just added, so enter draw way again. Press escape to leave draw way and just the end node selected. Press delete. This as far as I can make out calls deleteNode in selectedWayNode.as, but can't work out where the code is that firstSelected.Remove is calling at the moment. These notes to help me continue hunt later if it isn't solved in the meantime. Edit: OK, worked out that RemoveNodeFromWayAction is called. Investigating as time permits.

@openstreetmap-trac
Copy link
Author

Author: stephankn
[Added to the original trac issue at 5.33am, Friday, 12th September 2014]

still happens with 2.3-632-g1a1f24a, eg. this changeset

http://www.openstreetmap.org/changeset/25026709

created a one-node way

http://www.openstreetmap.org/way/300254015

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

No branches or pull requests

1 participant