Opened 5 years ago
Closed 5 years ago
#17227 closed defect (fixed)
[Patch] Show error message for erroneous poly file or accept it
Reported by: | GerdP | Owned by: | GerdP |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Plugin poly | Version: | |
Keywords: | template_report | Cc: | Zverikk |
Description
What steps will reproduce the problem?
- Import the attached bremen.poly from geofabrik
What is the expected result?
An Error message that shows that the file is not correct (two END statements instead of one in lines 88-89)
What happens instead?
The file is silently imported but the part with "Bremerhaven" is missing.
Please provide any additional information below. Attach a screenshot if possible.
Build-Date:2019-01-21 14:23:49 Revision:14715 Is-Local-Build:true Identification: JOSM/1.5 (14715 SVN en) Windows 10 64-Bit OS Build number: Windows 10 Home 1803 (17134) Memory Usage: 629 MB / 1753 MB (426 MB allocated, but free) Java version: 1.8.0_191-b12, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Screen: \Display0 1920x1080 Maximum Screen Size: 1920x1080 VM arguments: [-agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:50989, -ea, -Dfile.encoding=UTF-8] Program arguments: [--debug] Plugins: + OpeningHoursEditor (34535) + apache-commons (34506) + buildings_tools (34807) + download_along (34838) + ejml (34389) + geotools (34513) + jaxb (34506) + jts (34524) + o5m (34842) + opendata (34805) + pbf (34829) + poly (34678) + reltoolbox (34788) + reverter (34552) + utilsplugin2 (34840) Tagging presets: + https://raw.githubusercontent.com/OpenNauticalChart/josm/master/INT-1-preset.xml + https://josm.openstreetmap.de/josmfile?page=Presets/Historical_Objects&zip=1 Last errors/warnings: - W: No configuration settings found. Using hardcoded default values for all pools. - W: Cannot start IPv4 remotecontrol https server on port 8112: Keystore was tampered with, or password was incorrect - W: Cannot start IPv6 remotecontrol https server on port 8112: Keystore was tampered with, or password was incorrect
Attachments (3)
Change History (12)
by , 5 years ago
Attachment: | bremen.poly added |
---|
comment:1 by , 5 years ago
Owner: | changed from | to
---|
comment:2 by , 5 years ago
Component: | Core → Plugin poly |
---|
comment:3 by , 5 years ago
by , 5 years ago
Attachment: | poly.patch added |
---|
comment:4 by , 5 years ago
Cc: | added |
---|---|
Summary: | Show error message for erroneous poly file → [Patch] Show error message for erroneous poly file or accept it |
Please review.
The patch is more or less a rewrite of importer and exporter. I've also added unit tests for the importer.
I've changed the code so that it is able to import the bogus bremen.poly mentioned in this ticket.
I've also added code to handle some common errors.
Open questions:
1) If a poly file contains multiple (outer) rings the old code used the name only for the first ring, the others got no name.
With the patch a multipolygon is created that is named and each way also has a name.
2) See #14664: With the patch an IOException is thrown if the data contains unclosed ways. I think this is better than automatically closing it, but with current JOSM this exception is only displayed on the console. I think class SaveActionBase.doInternalSave()
should catch it.
comment:7 by , 5 years ago
Already happened: https://forum.openstreetmap.org/viewtopic.php?pid=735317#p735317
comment:9 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I've now learned that osmconvert ignores the extra END, so another option would be to do it osmconvert.