Closed caver456 closed 2 years ago
This implies that removeSpurs actually removed everything:
02:26:02 [sartopo_python:1926:INFO] c2
02:26:02 [sartopo_python:1469:INFO] spur removed at [-120.91045418017751, 39.309811765302285]
02:26:02 [sartopo_python:1469:INFO] spur removed at [-120.91045418017751, 39.309811765302285]
02:26:02 [sartopo_python:1469:INFO] spur removed at [-120.91045418017751, 39.309811765302285]
02:26:02 [sartopo_python:1469:INFO] spur removed at [-120.91045418017751, 39.309811765302285]
02:26:02 [sartopo_python:1469:INFO] spur removed at [-120.91045418017751, 39.309811765302285]
02:26:02 [sartopo_python:1469:INFO] spur removed at [-120.91048799674455, 39.30977389835933]
02:26:02 [sartopo_python:1469:INFO] spur removed at [-120.91048799674455, 39.30977389835933]
02:26:02 [sartopo_python:1469:INFO] spur removed at [-120.91048799674455, 39.30977389835933]
02:26:02 [sartopo_python:1469:INFO] spur removed at [-120.91048799674455, 39.30977389835933]
02:26:02 [sartopo_python:1469:INFO] spur removed at [-120.91048799674455, 39.30977389835933]
02:26:02 [sartopo_python:1469:INFO] spur removed at [-120.91048799674455, 39.30977389835933]
02:26:02 [sartopo_python:679:ERROR] Exception during sync of map AKC; stopping sync: IndexError:('pop from empty list',)
That was recoverable during sync (though it's not clear if sync actually restarted after pressing the Play button a few times) but during initial read on restart it was not recoverable - it showed the uncaught exception dialog then the program exited:
02:29:33 [sartopo_bg:1510:INFO] t1: cropping cfbf3f4b-7af3-4163-a694-7478e2af6fee
02:29:33 [sartopo_bg:1516:INFO] t2
02:29:33 [sartopo_python:1910:INFO] c1
02:29:33 [sartopo_python:621:INFO] refresh requested for map GKH: 1392ms since last completed sync; shorter than syncInterval; forceImmediate not specified: not syncing now
02:29:33 [sartopo_python:1926:INFO] c2
02:29:33 [sartopo_python:1469:INFO] spur removed at [-120.91045418017751, 39.309811765302285]
02:29:33 [sartopo_python:1469:INFO] spur removed at [-120.91045418017751, 39.309811765302285]
02:29:33 [sartopo_python:1469:INFO] spur removed at [-120.91045418017751, 39.309811765302285]
02:29:33 [sartopo_python:1469:INFO] spur removed at [-120.91045418017751, 39.309811765302285]
02:29:33 [sartopo_python:1469:INFO] spur removed at [-120.91045418017751, 39.309811765302285]
02:29:33 [sartopo_python:1469:INFO] spur removed at [-120.91048799674455, 39.30977389835933]
02:29:33 [sartopo_python:1469:INFO] spur removed at [-120.91048799674455, 39.30977389835933]
02:29:33 [sartopo_python:1469:INFO] spur removed at [-120.91048799674455, 39.30977389835933]
02:29:33 [sartopo_python:1469:INFO] spur removed at [-120.91048799674455, 39.30977389835933]
02:29:33 [sartopo_python:1469:INFO] spur removed at [-120.91048799674455, 39.30977389835933]
02:29:33 [sartopo_python:1469:INFO] spur removed at [-120.91048799674455, 39.30977389835933]
02:29:33 [plans_console:280:CRITICAL] Uncaught exception
Traceback (most recent call last):
File "C:\Users\caver\Documents\GitHub\plans_console\plans_console.py", line 1286, in <module>
main()
File "C:\Users\caver\Documents\GitHub\plans_console\plans_console.py", line 1281, in main
w = PlansConsole(app)
File "C:\Users\caver\Documents\GitHub\plans_console\plans_console.py", line 510, in __init__
self.debriefButtonClicked()
File "C:\Users\caver\Documents\GitHub\plans_console\plans_console.py", line 792, in debriefButtonClicked
self.dmg=DebriefMapGenerator(self,self.sts,self.debriefURL)
File "C:\Users\caver\Documents\GitHub\plans_console\sartopo_bg.py", line 468, in __init__
self.newFeatureCallback(f)
File "C:\Users\caver\Documents\GitHub\plans_console\sartopo_bg.py", line 1646, in newFeatureCallback
self.addOuting(f)
File "C:\Users\caver\Documents\GitHub\plans_console\sartopo_bg.py", line 1330, in addOuting
self.cropUncroppedTracks()
File "C:\Users\caver\Documents\GitHub\plans_console\sartopo_bg.py", line 1517, in cropUncroppedTracks
croppedTrackLines=self.sts2.crop(utid,bid,beyond=cropDegrees)
File "C:\Users\caver\Documents\GitHub\plans_console\sartopo_python.py", line 1938, in crop
tgc=self.removeSpurs(tgc)
File "C:\Users\caver\Documents\GitHub\plans_console\sartopo_python.py", line 1470, in removeSpurs
out.pop() # delete last vertex
IndexError: pop from empty list
There actually are runs of several points with the exact same coordinates in the source data:
[
-120.91046407708849,
39.30979678292522,
1219,
1636773455156
],
[
-120.91045418017751,
39.309811765302285,
1219,
1636773458157
],
[
-120.91045418017751,
39.309811765302285,
1219,
1636773461165
],
[
-120.91045418017751,
39.309811765302285,
1219,
1636773464154
],
[
-120.91045418017751,
39.309811765302285,
1219,
1636773467164
],
[
-120.91045418017751,
39.309811765302285,
1219,
1636773470162
],
[
-120.91045418017751,
39.309811765302285,
1219,
1636773473165
],
[
-120.91045418017751,
39.309811765302285,
1219,
1636773476153
],
[
-120.91048419316307,
39.30978941464972,
1219,
1636773479165
],
Notice these reports are three seconds apart; this was about 18 seconds of absolute same coordinates. That's an issue with the upstream locator code (not sure if this was apptrack or Garmin) but it looks like removeSpurs is reporting them correctly.
But, it's not clear if or how these strings of repeated coordinates lead to the 'pop from empty list' error. The pop was intended for a real 'spur' as on a-b-c-b-d - so the out list modification should go like:
But that sequence doesn't hold up when you have a long string of repeated coordinates. So, some logic should be added before the spur check, that simply doesn't add a vertex if it's the same as the previous one. (Note that four-element vertices will not be entirely identical due to the timestamp differences - we only want to compare lat and lon.)
The numbers above are for line AI103f from 'training.json' (localhost AKC).
Ok it worked - here's the json exported from the debrief map for that same line - notice the vertices before and after are there, but the duplicates are removed:
[
-120.91046407708849,
39.30979678292522
],
[
-120.91045418017751,
39.309811765302285
],
[
-120.91048419316307,
39.30978941464972
],
So the duplicates are removed before spur-checking, so the offending pop is not called for duplicates. The crash was probably because the long chain of duplicates was encountered close to the start of the list.
Note, this does not use the removeDuplicatePoints function which isn't called by anything internally right now; it might be good to use that if the goal is to reduce output data size, but for strictly identical points, it's easier to skip those points during removeSpurs.
Also, note that preserving the four-element vertices is a different issue.
Seems strange and not optimal:
need to make a minimal test case and pair it down.