Opened 3 years ago

Last modified 7 months ago

#4378 reopened defect

Potlatch 2: create ways with only 1 node

Reported by: Firefly! Owned by: stevage
Priority: critical Milestone:
Component: potlatch2 Version: 2.0
Keywords: Cc:

Description

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

Change History (9)

comment:1 Changed 3 years ago by Oli-Wan

  • Priority changed from minor to major

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.

comment:2 Changed 3 years ago by stevage

  • Owner changed from potlatch-dev@… to stevage
  • Status changed from new to assigned

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.

comment:4 Changed 3 years ago by stevage

  • Resolution set to fixed
  • Status changed from assigned to closed

comment:5 Changed 3 years ago by Firefly!

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

comment:6 Changed 3 years ago by stevage

  • Resolution set to fixed
  • Status changed from reopened to closed

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.

comment:7 Changed 3 years ago by maetma

  • Priority changed from major to critical
  • Resolution fixed deleted
  • Status changed from closed to reopened

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

comment:8 Changed 2 years ago by EdLoach

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.

Last edited 2 years ago by EdLoach (previous) (diff)

comment:9 Changed 7 months ago by stephankn

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

Note: See TracTickets for help on using tickets.