Modify

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?

  1. 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)

bremen.poly (10.3 KB ) - added by GerdP 5 years ago.
poly.patch (39.6 KB ) - added by GerdP 5 years ago.
poly-v2.patch (43.9 KB ) - added by GerdP 5 years ago.
unit test for exporter, further clean up

Download all attachments as: .zip

Change History (12)

by GerdP, 5 years ago

Attachment: bremen.poly added

comment:1 by GerdP, 5 years ago

Owner: changed from team to GerdP

comment:2 by GerdP, 5 years ago

Component: CorePlugin poly

comment:3 by GerdP, 5 years ago

I've now learned that osmconvert ignores the extra END, so another option would be to do it osmconvert.

by GerdP, 5 years ago

Attachment: poly.patch added

comment:4 by GerdP, 5 years ago

Cc: Zverikk 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.

by GerdP, 5 years ago

Attachment: poly-v2.patch added

unit test for exporter, further clean up

comment:5 by GerdP, 5 years ago

If I hear no complains I'll commit this on 2019-01-25

comment:6 by stoecker, 5 years ago

Please also inform Frederik, so he can fix GeoFabrik exports.

comment:8 by GerdP, 5 years ago

fixed with [o34860:34861]

comment:9 by GerdP, 5 years ago

Resolution: fixed
Status: newclosed

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.