OpenAthenaAndroid
OpenAthenaAndroid copied to clipboard
(rare) Concurrent GeoTIFF loading may cause wrong GeoTIFF to be loaded
Description:
In OpenAthena for Android, GeoTIFF digital elevation model loading is performed by a new thread upon initiation of the task.
The app (by design) does not preclude the user from initiating a new load operation even when one is ongoing.
The issue is that these loading threads are not synchronized with each other properly. This may cause a different GeoTIFF to be loaded than the user expects!
Steps to reproduce:
Load a large GeoTIFF file. While the load operation is ongoing, change your mind and select a small GeoTIFF file. The small file will load before the large one, but then the large one will load after (even though the task was initiated first).
When the user goes to select an image and then calculate, the loaded file will be the large one even though they expected it to be the small one.
Possible solution:
Use a synchronized stack across the loading and man UI thread. Pop from the stack only the last inputted GeoTIFF