Modify

Opened 6 years ago

Closed 5 years ago

#17234 closed defect (fixed)

GPX data without time stamps throws NPE at ElevationProfile.visitWayPoint

Reported by: suburbanstudio Owned by: OliverW
Priority: normal Milestone:
Component: Plugin elevationprofile Version:
Keywords: template_report Cc:

Description (last modified by Don-vip)

What steps will reproduce the problem?

  1. When updating Elevation plugin I got this error

What is the expected result?

What happens instead?

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

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2018-12-31 15:09:58 +0100 (Mon, 31 Dec 2018)
Build-Date:2018-12-31 14:24:10
Revision:14620
Relative:URL: ^/trunk

Identification: JOSM/1.5 (14620 it) Windows 10 64-Bit
OS Build number: Windows 10 Enterprise 1803 (17134)
Memory Usage: 380 MB / 989 MB (189 MB allocated, but free)
Java version: 1.8.0_191-b12, Oracle Corporation, Java HotSpot(TM) Client VM
Screen: \Display0 1366x768
Maximum Screen Size: 1366x768
Dataset consistency test: No problems found

Plugins:
+ ElevationProfile (34746)
+ ImportImagePlugin (34576)
+ ejml (34389)
+ geotools (34513)
+ jts (34524)
+ log4j (34527)
+ print (34576)
+ turnrestrictions (34643)

Last errors/warnings:
- W: No configuration settings found.  Using hardcoded default values for all pools.
- E: Handled by bug report queue: java.lang.NullPointerException
- W: Attenzione - <html>JOSM non riesce a trovare le <user.name>rmazioni riguardanti le seguenti estensioni:<ul><li>print</li><li>geotools</li><li>ElevationProfile</li><li>ImportImagePlugin</li><li>jts</li><li>ejml</li><li>turnrestrictions</li><li>log4j</li></ul>Le estensioni non saranno caricate.</html>


=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (15) of main
java.lang.NullPointerException
	at org.openstreetmap.josm.plugins.elevation.gpx.ElevationProfile.visitWayPoint(ElevationProfile.java:380)
	at org.openstreetmap.josm.plugins.elevation.gpx.ElevationProfile.updateValues(ElevationProfile.java:131)
	at org.openstreetmap.josm.plugins.elevation.gpx.ElevationProfile.setWayPoints(ElevationProfile.java:219)
	at org.openstreetmap.josm.plugins.elevation.gpx.ElevationModel.commitProfile(ElevationModel.java:222)
	at org.openstreetmap.josm.plugins.elevation.gpx.ElevationModel.endTrack(ElevationModel.java:158)
	at org.openstreetmap.josm.plugins.elevation.gpx.GpxIterator.visitTrack(GpxIterator.java:99)
	at org.openstreetmap.josm.plugins.elevation.gpx.GpxIterator.visit(GpxIterator.java:50)
	at org.openstreetmap.josm.plugins.elevation.gpx.ElevationModel.<init>(ElevationModel.java:52)
	at org.openstreetmap.josm.plugins.elevation.gui.ElevationProfileDialog.setActiveLayer(ElevationProfileDialog.java:368)
	at org.openstreetmap.josm.plugins.elevation.gui.ElevationProfileDialog.layerAdded(ElevationProfileDialog.java:382)
	at org.openstreetmap.josm.gui.layer.LayerManager.fireLayerAdded(LayerManager.java:459)
	at org.openstreetmap.josm.gui.layer.LayerManager.realAddLayer(LayerManager.java:234)
	at org.openstreetmap.josm.gui.layer.MainLayerManager.realAddLayer(MainLayerManager.java:282)
	at org.openstreetmap.josm.gui.layer.LayerManager.lambda$addLayer$0(LayerManager.java:218)
	at org.openstreetmap.josm.gui.util.GuiHelper.runInEDTAndWaitWithException(GuiHelper.java:238)
	at org.openstreetmap.josm.gui.layer.LayerManager.addLayer(LayerManager.java:218)
	at org.openstreetmap.josm.gui.layer.OsmDataLayer$ConvertToGpxLayerAction.actionPerformed(OsmDataLayer.java:947)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.AbstractButton.doClick(Unknown Source)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

Attachments (2)

17234.patch (1.5 KB ) - added by GerdP 6 years ago.
brouter.gpx (5.3 KB ) - added by GerdP 6 years ago.
Track created with brouter (no timestamps)

Download all attachments as: .zip

Change History (11)

comment:1 by Don-vip, 6 years ago

Component: CorePlugin elevationprofile
Description: modified (diff)
Owner: changed from team to OliverW
Summary: When updating Elevation plugin I got this errorNPE at ElevationProfile.visitWayPoint

comment:2 by simon04, 6 years ago

Ticket #17245 has been marked as a duplicate of this ticket.

comment:3 by Don-vip, 6 years ago

Ticket #17259 has been marked as a duplicate of this ticket.

by GerdP, 6 years ago

Attachment: 17234.patch added

comment:4 by GerdP, 6 years ago

Attached patch avoids the NPE. It happens when you active "Download Raw GPS" because WayPoint.getDate() will return null for that data.

Last edited 6 years ago by GerdP (previous) (diff)

by GerdP, 6 years ago

Attachment: brouter.gpx added

Track created with brouter (no timestamps)

comment:5 by GerdP, 6 years ago

The patch doesn't work with the attached file brouter.gpx. This plugin seems to depend on timestamp values in the gpx data. I think it should be able to calculate a profile without that presuming that the points are in order.

comment:6 by GerdP, 5 years ago

Ticket #17352 has been marked as a duplicate of this ticket.

comment:7 by GerdP, 5 years ago

Ticket #17409 has been marked as a duplicate of this ticket.

comment:8 by Hb---, 5 years ago

Summary: NPE at ElevationProfile.visitWayPointGPX data without time stamps throws NPE at ElevationProfile.visitWayPoint

comment:9 by GerdP, 5 years ago

Resolution: fixed
Status: newclosed

fixed with [o34928:34929] : check if waypoints have a timestamp before using them for calculations

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain OliverW.
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.