Modify

Opened 5 months ago

Last modified 4 months ago

#16988 new defect

[Patch] Plugin importvec should not create duplicate nodes

Reported by: lmason_aph Owned by: Upliner
Priority: normal Milestone:
Component: Plugin importvec Version: tested
Keywords: template_report Cc: GerdP

Description

What steps will reproduce the problem?

  1. Inkscape to JOSM conversion is adding 100's of nodes in some cases

What is the expected result?

We wish to come to a solution whereas conversion process does not add unnecessary nodes.

What happens instead?

Conversion process works as it should, but adds 100s of nodes that are not apparent, visually

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

I have attached an Inkscape SVG file, a JOSM conversion done from that file, and screenshots of elements and the amount of nodes associated with those elements showing at the bottom of the screen.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2018-10-28 22:27:31 +0100 (Sun, 28 Oct 2018)
Build-Date:2018-10-28 21:33:32
Revision:14382
Relative:URL: ^/trunk

Identification: JOSM/1.5 (14382 en) Windows 10 64-Bit
OS Build number: Windows 10 Pro 1803 (17134)
Memory Usage: 1217 MB / 3611 MB (682 MB allocated, but free)
Java version: 1.8.0_181-b13, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 1920x1080, \Display1 1920x1080, \Display2 1920x1080
Maximum Screen Size: 1920x1080
Dataset consistency test: No problems found

Plugins:
+ CADTools (1008)
+ FastDraw (34510)
+ QuickLabel (18)
+ apache-commons (34506)
+ auto_tools (67)
+ buildings_tools (34572)
+ colorscheme (34573)
+ imagery_offset_db (34641)
+ importvec (34520)
+ indoorhelper (34522)
+ jts (34524)
+ namemanager (34532)
+ photoadjust (34684)
+ utilsplugin2 (34506)

Tagging presets:
+ https://josm.openstreetmap.de/josmfile?page=Presets/OSMRookie&zip=1

Map paint styles:
+ <josm.pref>\styles\sit.mapcss
+ <josm.pref>\styles\sit.mapcss
+ <josm.pref>\styles\sit.mapcss

Validator rules:
+ <josm.pref>\validator\indoorhelper.validator.mapcss

Last errors/warnings:
- W: No configuration settings found.  Using hardcoded default values for all pools.

Attachments (6)

sac LvL 0 josm upload.svg (36.9 KB) - added by anonymous 5 months ago.
OSM Test. Raw upload, No node manipulation.osm (280.4 KB) - added by anonymous 5 months ago.
osm 84 node error screenshot.png (467.5 KB) - added by anonymous 5 months ago.
Node 1 (320,051).png (173.1 KB) - added by anonymous 5 months ago.
Node 2 (163,991).png (216.9 KB) - added by anonymous 5 months ago.
16988.patch (3.7 KB) - added by GerdP 5 months ago.

Download all attachments as: .zip

Change History (13)

Changed 5 months ago by anonymous

Attachment: sac LvL 0 josm upload.svg added

Changed 5 months ago by anonymous

Changed 5 months ago by anonymous

Changed 5 months ago by anonymous

Attachment: Node 1 (320,051).png added

Changed 5 months ago by anonymous

Attachment: Node 2 (163,991).png added

comment:1 Changed 5 months ago by GerdP

I can reproduce the problem with duplicate nodes, it seems that the importvec plugin contains no code to handle this, also it seems to
have no code to verify the correctnes of the input file. So this is probably not a simple bug but missing functionality in the plugin.
I'll see if I can improve that.

It seems that you use a high value for "Curve Steps", did you try with 1? This seems to give much better results.
A small trick to get help: Add the tag building=yes to all ways. This gives better hints about geometry problems in the file.

Besides that the lines in svg file should not "jump" across points so that those points lie on/under the line. Instead they sjould jump from point to point. This might be correct for svg but makes it difficult for the plugin. Also, the points in the svg file should really be at the exact same place, not close to each other.
I hope this helps.

comment:2 Changed 5 months ago by GerdP

You should also have a look at #16948 comment14, I think some of your problems are caused by the same rounding effects which I describe there.

comment:3 Changed 5 months ago by GerdP

Component: CorePlugin importvec
Summary: Re: GerdP - ongoing issue with extra nodes and conversion process. SVG and JOSM files attachedPlugin importvec should not create duplicate nodes

Changed 5 months ago by GerdP

Attachment: 16988.patch added

comment:4 Changed 5 months ago by GerdP

Summary: Plugin importvec should not create duplicate nodes[Patch] Plugin importvec should not create duplicate nodes

I've attached a patch that implements some checks so that
a) empty ways are ignored
b) nodes with nearly the same position are deduplicated

I think it would be a good idea to write information to the log for those svg elements which caused empty ways or ways with just one
node. It seems that each svg element has an id, e.g. "rect990-2-2".
@team: Do we have something like that for other importers?

One problem remains: For the given sample svg you get obsolete points when you use a "Curve steps" value > 1. The reason is that the
shapes in the svg are translated to curves rather than straight lines. No idea if this is a problem in the svg file or in the kitfox classes which are used to read the svg file.

comment:5 Changed 5 months ago by Upliner

If you use HashMap to detect duplicate points you should check 3x3 box around each new point because points can be very close to each other, but still in different cells of the map.

comment:6 Changed 5 months ago by GerdP

So you think it is not enough to use the rounded value? What is meant with cell of the map?

comment:7 Changed 4 months ago by GerdP

Owner: changed from GerdP to Upliner
Status: assignednew

In other importers we use SimplifyWay action to remove obsolete points. I think that would also be a good idea here.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Upliner.
as The resolution will be set.
to The owner will be changed from Upliner to the specified user.
The owner will change to lmason_aph
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from Upliner to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.