Modify

Opened 9 months ago

#22958 new defect

KML importer stop after the first malformed coordinates

Reported by: pyrog Owned by: Don-vip
Priority: normal Milestone:
Component: Plugin opendata Version:
Keywords: template_report KmlKmzImporter KML Cc:

Description

What steps will reproduce the problem?

  1. Install opendata plugin
  2. Open this malformed KML file from MemorialGenWeb

What is the expected result?

JOSM should load all objects and warn for wrong elements and/or ask to continue.
Bad elements could be listed with error and line number and/or line content.

What happens instead?

JOSM display:

Could not read file 'sources_google_maps.kml'.
Error is:
java.lang.NumberFormatException: empty String

When JOSM is started from the terminal, it display the following messages on the console:

2023-05-19 17:41:38.187 INFO: Open file: /Users/yves/Desktop/sources_google_maps.kml (2674259 bytes)
2023-05-19 17:41:38.202 SEVERE: org.openstreetmap.josm.io.IllegalDataException: java.lang.NumberFormatException: empty String. Cause: java.lang.NumberFormatException: empty String
org.openstreetmap.josm.io.IllegalDataException: java.lang.NumberFormatException: empty String
	at org.openstreetmap.josm.plugins.opendata.core.io.geographic.KmlKmzImporter.parseDataSet(KmlKmzImporter.java:38)
	at org.openstreetmap.josm.gui.io.importexport.OsmImporter.loadLayer(OsmImporter.java:121)
	at org.openstreetmap.josm.gui.io.importexport.OsmImporter.importData(OsmImporter.java:97)
	at org.openstreetmap.josm.plugins.opendata.core.io.AbstractImporter.importData(AbstractImporter.java:59)
	at org.openstreetmap.josm.gui.io.importexport.FileImporter.importDataHandleExceptions(FileImporter.java:103)
	at org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.importData(OpenFileAction.java:401)
	at org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.realRun(OpenFileAction.java:350)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:94)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:142)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NumberFormatException: empty String
	at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(Unknown Source)
	at java.base/jdk.internal.math.FloatingDecimal.parseDouble(Unknown Source)
	at java.base/java.lang.Double.parseDouble(Unknown Source)
	at java.base/java.lang.Double.valueOf(Unknown Source)
	at org.openstreetmap.josm.plugins.opendata.core.io.geographic.KmlReader.parseNode(KmlReader.java:189)
	at org.openstreetmap.josm.plugins.opendata.core.io.geographic.KmlReader.parsePlaceMark(KmlReader.java:151)
	at org.openstreetmap.josm.plugins.opendata.core.io.geographic.KmlReader.parseDoc(KmlReader.java:84)
	at org.openstreetmap.josm.plugins.opendata.core.io.geographic.KmlReader.parseDataSet(KmlReader.java:69)
	at org.openstreetmap.josm.plugins.opendata.core.io.geographic.KmlKmzImporter.parseDataSet(KmlKmzImporter.java:33)
	... 13 more

2023-05-19 17:41:38.770 JOSM[60772:2472851] 2023-05-19 17:41:38.202 SEVERE: org.openstreetmap.josm.io.IllegalDataException: java.lang.NumberFormatException: empty String. Cause: java.lang.NumberFormatException: empty String
org.openstreetmap.josm.io.IllegalDataException: java.lang.NumberFormatException: empty String
	at org.openstreetmap.josm.plugins.opendata.core.io.geographic.KmlKmzImporter.parseDataSet(KmlKmzImporter.java:38)
	at org.openstreetmap.josm.gui.io.importexport.OsmImporter.loadLayer(OsmImporter.java:121)
	at org.openstreetmap.josm.gui.io.importexport.OsmImporter.importData(OsmImporter.java:97)
	at org.openstreetmap.josm.plugins.opendata.core.io.AbstractImporter.importData(AbstractImporter.java:59)
	at org.openstreetmap.josm.gui.io.importexport.FileImporter.importDataHandleExceptions(FileImporter.java:103)
	at org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.importData(OpenFileAction.java:401)
	at org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.realRun(OpenFileAction.java:350)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:94)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:142)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NumberFormatException: empty String
	at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(Unknown Source)
	at java.base/jdk.internal.math.FloatingDecimal.parseDouble(Unknown Source)
	at java.base/java.lang.Double.parseDouble(Unknown Source)
	at java.base/java.lang.Double.valueOf(Unknown Source)
	at org.openstreetmap.josm.plugins.opendata.core.io.geographic.KmlReader.parseNode(KmlReader.java:189)
	at org.openstreetmap.josm.plugins.opendata.core.io.geographic.KmlReader.parsePlaceMark(KmlReader.java:151)
	at org.openstreetmap.josm.plugins.opendata.core.io.geographic.KmlReader.parseDoc(KmlReader.java:84)
	at org.openstreetmap.josm.plugins.opendata.core.io.geographic.KmlReader.parseDataSet(KmlReader.java:69)
	at org.openstreetmap.josm.plugins.opendata.core.io.geographic.KmlKmzImporter.parseDataSet(KmlKmzImporter.java:33)
	... 13 more

2023-05-19 17:41:38.999 SEVERE: Error - <html>Could not read file 'sources_google_maps.kml'.<br>Error is:<br>java.lang.NumberFormatException: empty String</html>
2023-05-19 17:41:39.000 JOSM[60772:2472853] 2023-05-19 17:41:38.999 SEVERE: Error - <html>Could not read file 'sources_google_maps.kml'.<br>Error is:<br>java.lang.NumberFormatException: empty String</html>

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

The original encoding of this file is bad (Windows latin 1 instead of UTF-8).

Also 9 elements have bad coordinates (but manually discarded).

The URL of the original file is https://www.memorialgenweb.org/memorial3/nwoutils/sources_google_maps.kml

Revision:18721
Build-Date:2023-05-03 12:37:58

Identification: JOSM/1.5 (18721 en_GB) Mac OS X 12.6.3
OS Build number: macOS 12.6.3 (21G419)
Memory Usage: 1201 MB / 2048 MB (416 MB allocated, but free)
Java version: 17.0.7+7-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM
Look and Feel: com.apple.laf.AquaLookAndFeel
Screen: Display 69732928 1280×800 (scaling 2.00×2.00)
Maximum Screen Size: 1280×800
Best cursor sizes: 16×16→16×16, 32×32→32×32
Environment variable LANG: fr_FR.UTF-8
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: en_GB
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djpackage.app-version=18721, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=/Applications/JOSM.app/Contents/MacOS/JOSM]

Plugins:
+ Mapillary (2.1.3)
+ PicLayer (1.0.2)
+ apache-commons (36034)
+ apache-http (35924)
+ buildings_tools (36011)
+ cadastre-fr (36079)
+ conflation (0.6.11)
+ continuosDownload (1.3.4)
+ contourmerge (v0.1.9)
+ ejml (35924)
+ geotools (36068)
+ jackson (36034)
+ javafx (36034)
+ jaxb (35952)
+ jna (36005)
+ jts (36004)
+ log4j (36045)
+ mbtiles (v2.6.1)
+ opendata (36079)
+ photo_geotagging (36079)
+ photoadjust (36079)
+ pt_assistant (2.1.15-19-g9aeec3c-SNAPSHOT)
+ reverter (36066)
+ scripting (v0.2.7)
+ utilsplugin2 (36079)
+ wikipedia (605)

Tagging presets:
+ https://raw.githubusercontent.com/yopaseopor/traffic_signs_preset_JOSM/master/FR.zip

Map paint styles:
- ${HOME}/Downloads/Styles_ColourGPSData-style.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/Osmc&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/NumberedWalkingNodeNetworks&zip=1
+ ${HOME}/Downloads/Guidepost.mapcss
+ https://raw.githubusercontent.com/yopaseopor/traffic_signs_style_JOSM/master/Styles_Traffic_signs_EUR_OC.zip
- https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/NumberedCycleNodeNetworks&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/NumberedWalkingNodeNetworks&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/MapWithAI&zip=1

Last errors/warnings:
- 00013.240 W: Failed to load Mappaint styles from '${HOME}/Downloads/Styles_ColourGPSData-style.mapcss'. Exception was: java.nio.file.NoSuchFileException: ${HOME}/Downloads/Styles_ColourGPSData-style.mapcss
- 00013.241 E: java.nio.file.NoSuchFileException: ${HOME}/Downloads/Styles_ColourGPSData-style.mapcss
- 00013.248 W: Failed to load Mappaint styles from '${HOME}/Downloads/Guidepost.mapcss'. Exception was: java.nio.file.NoSuchFileException: ${HOME}/Downloads/Guidepost.mapcss
- 00013.248 E: java.nio.file.NoSuchFileException: ${HOME}/Downloads/Guidepost.mapcss
- 00013.279 W: Initializing map style ${HOME}/Downloads/Guidepost.mapcss completed in 31 ms (1 errors, 0 warnings)
- 00061.906 E: org.openstreetmap.josm.io.IllegalDataException: java.lang.NumberFormatException: empty String. Cause: java.lang.NumberFormatException: empty String
- 00062.701 E: Error - <html>Could not read file 'sources_google_maps.kml'.<br>Error is:<br>java.lang.NumberFormatException: empty String</html>

Attachments (1)

sources_google_maps.kml (2.6 MB ) - added by pyrog 9 months ago.
memorial in KML file format (encoding fixed and 9 bad elements were discarded manually)

Change History (1)

by pyrog, 9 months ago

Attachment: sources_google_maps.kml added

memorial in KML file format (encoding fixed and 9 bad elements were discarded manually)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Don-vip.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from Don-vip to the specified user.
Next status will be 'needinfo'. The owner will be changed from Don-vip to pyrog.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from Don-vip to anonymous. Next status will be 'assigned'.

Add Comment


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