Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#21315 closed defect (fixed)

[Patch]Using buildings_tools with a double click produces invalid buildings

Reported by: ff5722 Owned by: GerdP
Priority: normal Milestone:
Component: Plugin buildings_tools Version:
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

See also attached .osm file with annotations

  1. Draw a building using buildings_tools
  2. Double click at the end so that the building is shaped like a one-dimensional line

...

What is the expected result?

A building with width zero is automatically converted to a line object having only 2 nodes. When the user would try to upload, they will be warned for having 'unclosed way - building' anyways, which is easier to fix than duplicated nodes (that requires first merging the nodes and then extruding the building, 2 steps instead of 1).

What happens instead?

...

  1. Check the result using JOSM validator and note the duplicated nodes error
  2. Use the create areas tool (shortcut: X) to fix the 'line' building)
  3. The building will still have duplicated nodes, the only way to solve it is to manually merge the dupes

Please provide any additional information below. Attach a screenshot if possible.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2021-09-03 03:12:33 +0200 (Fri, 03 Sep 2021)
Build-Date:2021-09-03 01:31:19
Revision:18193
Relative:URL: ^/trunk

Identification: JOSM/1.5 (18193 en) Windows 10 64-Bit
OS Build number: Windows 10 Pro 2009 (19042)
Memory Usage: 396 MB / 1820 MB (85 MB allocated, but free)
Java version: 1.8.0_301-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920×1080 (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: Cp1252
System property sun.jnu.encoding: Cp1252
Locale info: en_US
Numbers with default locale: 1234567890 -> 1234567890
Dataset consistency test: No problems found

Plugins:
+ EasyPresets (1623509627)
+ FastDraw (35640)
+ buildings_tools (35756)
+ terracer (35640)
+ touchscreenhelper (35640)
+ utilsplugin2 (35792)

Tagging presets:
+ <josm.pref>/EasyPresets.xml

Last errors/warnings:
- 00012.432 W: Update plugins - You updated your JOSM software. To prevent problems the plugins should be updated as well.  Update plugins now?

Attachments (3)

Example.osm (2.8 KB ) - added by ff5722 4 years ago.
21315.patch (645 bytes ) - added by GerdP 4 years ago.
continue drawing if building width is extremely small
21315-2.patch (2.4 KB ) - added by GerdP 4 years ago.
don't switch mode if length or width are too small

Download all attachments as: .zip

Change History (19)

by ff5722, 4 years ago

Attachment: Example.osm added

comment:1 by ff5722, 4 years ago

Summary: Drawing building using buildings_tools with zero width produces duplicated nodesDrawing building with zero width using buildings_tools produces duplicated nodes

comment:2 by mdk, 4 years ago

What is the use case of drawing a "building" with the building_tools which should result in a line with two nodes (and a tag building=yes)?

comment:3 by ff5722, 4 years ago

There is no use case, but it can happen by accident, for example when not zooming in far enough.

comment:4 by mdk, 4 years ago

But in case of an accident the warning about a "strange building" (with duplicate nodes and ways) would be helpful. And the warning about duplicated nodes is in my opinion better than a warning about unclosed way.

You can use the "create area [x]" tool also on the closed way created above. Only one of the two overlapping segments will be extruded.

Maybe it would make sense to prevent building_tools from creating such illegal buildings when performing a double-click.

in reply to:  4 comment:5 by skyper, 4 years ago

Type: enhancementdefect

Replying to mdk:

Maybe it would make sense to prevent building_tools from creating such illegal buildings when performing a double-click.

Yes, creating invalid objects is a bug.

comment:6 by mdk, 4 years ago

Summary: Drawing building with zero width using buildings_tools produces duplicated nodesUsing buildings_tools with a double click produces invalid buildings

comment:7 by GerdP, 4 years ago

Owner: changed from Upliner to GerdP

comment:8 by GerdP, 4 years ago

I agree. The plugin should either ignore a (double) click when this would produce an invalid object and continue in draw mode or stop the draw mode without creating an object (as with Esc button).
Any preference?

Version 0, edited 4 years ago by GerdP (next)

by GerdP, 4 years ago

Attachment: 21315.patch added

continue drawing if building width is extremely small

comment:9 by GerdP, 4 years ago

Patch implements the first alternative.
This is only solving the mentioned issue. There are more special cases, e.g.

  1. start building-mode
  2. left click somewhere, note that the instruction on the bottom line changes from "Point on the corner of the building to start drawing" to "Point on opposite end of the building"
  3. left click again without moving the mouse, note that the text changes to "Set width of the building" but no (invalid) building is drawn.

by GerdP, 4 years ago

Attachment: 21315-2.patch added

don't switch mode if length or width are too small

comment:10 by GerdP, 4 years ago

Hmm, this is a bit tricky. Maybe JOSM allows to zoom in "too much". In max. zoom it is possible to draw all kinds of "invalid" objects. E.g. a simple line short is rendered with two distinct points but Validator may complain about duplicated points, same for areas.
OTOH JOSM might be used to produce data that is not uploaded to OSM, so rounding to the OSM limits might not happen.
The 2nd patch fixes the problems caused by unintended double clicks but still allows to produce such invalid objects.
If nobody suggests a better solution I'll commit this tomorrow.

comment:11 by GerdP, 4 years ago

Summary: Using buildings_tools with a double click produces invalid buildings[Patch]Using buildings_tools with a double click produces invalid buildings

comment:12 by GerdP, 4 years ago

Resolution: fixed
Status: newclosed

In 35818/osm:

fix #21315: Using buildings_tools with a double click produces invalid buildings

comment:13 by anonymous, 4 years ago

draw a building.
now select it.
try and draw another building... you can't finish it.

comment:14 by GerdP, 4 years ago

Resolution: fixed
Status: closedreopened

comment:15 by GerdP, 4 years ago

Resolution: fixed
Status: reopenedclosed

In 35823/osm:

fix #21315: Using buildings_tools with a double click produces invalid buildings

  • fix regression introduced with 35818/osm (can't always finish drawing when a building is selected)

in reply to:  13 comment:16 by GerdP, 4 years ago

Replying to anonym:

draw a building.
now select it.
try and draw another building... you can't finish it.

In some cases it worked, depending on the relative position of the first and second node. Seems I tested only the working way before...

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain GerdP.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.