openstreetmap / iD

🆔 The easy-to-use OpenStreetMap editor in JavaScript.
https://www.openstreetmap.org/edit?editor=id
ISC License
3.37k stars 1.21k forks source link

Easy to create single node ways in iD #2303

Closed SomeoneElseOSM closed 8 years ago

SomeoneElseOSM commented 10 years ago

I did this by accident in https://www.openstreetmap.org/changeset/24343839

What I did was:

Click Line

Click an existing node

Move the map down a bit

Click the map to draw an "end" node

Decide that that wasn't quite the right place

Press delete

Try and click where the end node should have gone - but I'm not drawing a line any more!

So click line, draw the thing in the right place, tag it etc. - but the original aborted attempt is added as single-node way https://www.openstreetmap.org/way/294294495

Browser is Chrome Version 36.0.1985.125 m on Windows 7.

pnorman commented 8 years ago

Another case

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

This one is with iD 1.8.0, and had one tagless way and one single-node way, as well as a bunch of Haiti mapping. The errors were in Washington, DC near the default start location.

jfirebaugh commented 8 years ago

I can't reproduce creating single node ways using the steps given.

  1. Click Line - OK
  2. Click an existing node - OK
  3. Move the map down a bit - Shouldn't make any difference, but OK
  4. Click the map to draw an "end" node - Ambiguous. A single click would not create an "end" node, it would continue drawing the line. Did you mean "click the map to add a vertex" or "double click to finish the line"?
  5. Press delete
    • If you meant "click the map to add a vertex" in the previous step, pressing delete now ends the draw operation and creates a two-vertex line. No bug.
    • If you meant "double click to finish the line" in the previous step, pressing delete now deletes the created two-vertex line. No bug.

It sounds like you may have been expecting the behavior requested in #2057, but that's not implemented in iD yet, and in any case is independent of any potential single-node-way creation bug.

SomeoneElseOSM commented 8 years ago

I've managed to reproduce a single-node way again doing this - see http://api06.dev.openstreetmap.org/way/4299893242 .

To clarify:

Firstly the initial node must (now) have a tag on it, hence the fake place of worship in the test change I just made.

When I said "end node" I just meant "vertex" - single click, not double.

Moving the map down a bit isn't needed to cause the problem.

(and for the avoidance of doubt) When I mean "press delete" I mean "delete" not "backspace".

jfirebaugh commented 8 years ago

OK, so:

  1. Starting condition: have a tagged vertex visible.
  2. Click the "Line" button
  3. Click the tagged vertex to begin drawing a line.
  4. Single-click empty space on the map, creating a second vertex and continuing the draw operation.
  5. ?

Could you clarify step 5 and any further steps? Is this the "delete" key on the keyboard or a button on screen? What happens after that?

SomeoneElseOSM commented 8 years ago

5 is "press the delete key on the keyboard"

Then:

Click the "line" button with the mouse Click The tagged vertex again Click a bit of empty space Press return Click Save Notice there are two "untagged line" warnings Enter a changeset comment Click Save

That gives me http://api06.dev.openstreetmap.org/changeset/71066

which contains http://api06.dev.openstreetmap.org/way/4299895284

jfirebaugh commented 8 years ago

I can't replicate using those steps. I got two two-node ways, as expected.

http://api06.dev.openstreetmap.org/changeset/71069

SomeoneElseOSM commented 8 years ago

Same again for me if I use your initial node:

http://api06.dev.openstreetmap.org/way/4299895290

What browser / OS are you using?

matthijsmelissen commented 8 years ago

I can reproduce this issue. Minimal example:

Expected behaviour: I'd expect these actions not to cause any changes.

jfirebaugh commented 8 years ago

@math1985 What browser are you using? I'm on Chrome 47.0.2526.111, and pressing delete does not visually remove the line at that point. Instead, it ends the draw operation and produces a two-node line.

matthijsmelissen commented 8 years ago

Reproduced in Firefox 43.0 and Chrome 47.0.2526.106.

pressing delete does not visually remove the line at that point

That feels like a user experience bug in itself - I wouldn't expect 'Delete' to mean 'end operation'.

What happens in your environment when you draw a two-node line starting from nowhere and press Delete after the second note? In my case, the line is removed and the counter is not increased (as I would expect). Does this produce a two-node line in your environment? What if you do the same starting from an untagged node or starting from a vertex of an untagged area?

tyrasd commented 8 years ago

I can reproduce the issue as well: iD-issue-2303.ogv.zip – I'm on chrome 47 on Ubuntu.

tyrasd commented 8 years ago

From what I can see, this line is where the data gets corrupted after a uses cancels drawing by pressing the delete key: https://github.com/openstreetmap/iD/blob/master/js/id/behavior/draw_way.js#L181 edit: the following commit seems to be the actual breaking point: https://github.com/openstreetmap/iD/commit/8a215cac81a88e2346ac0e0fbe4f55140d1845cc