Opened 6 years ago
Last modified 6 years 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?
- 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)
Change History (13)
by , 6 years ago
Attachment: | sac LvL 0 josm upload.svg added |
---|
by , 6 years ago
Attachment: | OSM Test. Raw upload, No node manipulation.osm added |
---|
by , 6 years ago
Attachment: | osm 84 node error screenshot.png added |
---|
by , 6 years ago
Attachment: | Node 1 (320,051).png added |
---|
by , 6 years ago
Attachment: | Node 2 (163,991).png added |
---|
comment:1 by , 6 years ago
comment:2 by , 6 years ago
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 by , 6 years ago
Component: | Core → Plugin importvec |
---|---|
Summary: | Re: GerdP - ongoing issue with extra nodes and conversion process. SVG and JOSM files attached → Plugin importvec should not create duplicate nodes |
by , 6 years ago
Attachment: | 16988.patch added |
---|
comment:4 by , 6 years ago
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 by , 6 years ago
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 by , 6 years ago
So you think it is not enough to use the rounded value? What is meant with cell of the map?
comment:7 by , 6 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
In other importers we use SimplifyWay action to remove obsolete points. I think that would also be a good idea here.
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.