movestore / animation-moveVis

0 stars 2 forks source link

Error in if (row1 == 1 & row2 == nrow(x) & col1 == 1 & col2 == ncol(x)) {: missing value where TRUE/FALSE needed #14

Open sarahcd opened 6 months ago

sarahcd commented 6 months ago

I'll share a workflow.

 2024-04-30 14:09:09.622 INFO : app will be started with configuration:
 2024-04-30 14:09:09.623 INFO : {
 2024-04-30 14:09:09.623 INFO :   "reso": 12,
 2024-04-30 14:09:09.623 INFO :   "uni": "hours",
 2024-04-30 14:09:09.623 INFO :   "frames_per_sec": 25,
 2024-04-30 14:09:09.623 INFO :   "maptype": "streets",
 2024-04-30 14:09:09.624 INFO :   "mapres": 0.2,
 2024-04-30 14:09:09.624 INFO :   "col_opt": "one",
 2024-04-30 14:09:09.624 INFO :   "other": {},
 2024-04-30 14:09:09.624 INFO :   "show_legend": false,
 2024-04-30 14:09:09.625 INFO :   "capt": " Yukon-NWT moose and wolves: Richardson moose",
 2024-04-30 14:09:09.625 INFO :   "file_format": "mp4",
 2024-04-30 14:09:09.625 INFO :   "ext_adap": 1.1
 2024-04-30 14:09:09.625 INFO : }
 2024-04-30 14:09:10.894 INFO : You request an anitmation output file with alignment time intervals of 12 hours . Beware that the calculations will likely take some time.
 2024-04-30 14:09:11.081 INFO : Temporal resolution of 12 [hours] is used to align trajectories.
 2024-04-30 14:09:13.352 INFO : You have seleted to colour all your tracks in one colour (red).
 2024-04-30 14:09:13.353 INFO : Checking temporal alignment...
 2024-04-30 14:09:14.321 INFO : Processing movement data...
 2024-04-30 14:09:16.024 INFO : Approximated animation duration: ≈ 22.6s at 25 fps for 565 frames
 2024-04-30 14:09:16.112 INFO : Retrieving and compositing basemap imagery...
 2024-04-30 14:09:16.124 INFO : Loading basemap 'streets' from map service 'osm'...
 2024-04-30 14:09:16.150 INFO :
 2024-04-30 14:09:16.404 INFO :   |                                                  | 0 % ~calculating
 2024-04-30 14:09:16.464 INFO :   |=============                                     | 25% ~01s
 2024-04-30 14:09:16.502 INFO :   |=========================                         | 50% ~00s
 2024-04-30 14:09:16.569 INFO :   |======================================            | 75% ~00s
 2024-04-30 14:09:16.569 INFO :   |==================================================| 100% elapsed=00s
 2024-04-30 14:09:16.868 INFO : Assigning raster maps to frames...
 2024-04-30 14:09:16.913 INFO : [1] "ERROR:  Error in if (row1 == 1 & row2 == nrow(x) & col1 == 1 & col2 == ncol(x)) {: missing value where TRUE/FALSE needed\n"
 2024-04-30 14:09:16.914 ERROR: Error in if (row1 == 1 & row2 == nrow(x) & col1 == 1 & col2 == ncol(x)) { :
 2024-04-30 14:09:16.914 ERROR:   missing value where TRUE/FALSE needed
 2024-04-30 14:09:16.915 ERROR: Calls: tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
 2024-04-30 14:09:16.915 ERROR: Execution halted
sarahcd commented 6 months ago

In this example, the error seems to be introduced by adding the Filter/Annotate by Time Interval App. However it does not occur in another instance of the same workflow with different input data.

andreakoelzsch commented 6 months ago

@sarahcd Hi Sarah, I have had this error several times. It has to do with the fact that moveVis is using the bounding box format from sf, but does technically only accept move1 objects, where the sp bounding box format is used. I have tried to avoid using the whole extent issue right now, and also commented it in the code. Something to solve with Jakob, I guess...

For your workflow (Create simple animations: Yukon-NWT moose and wolves), please set the last Setting "Adaption factor for map extent" to 1, then it works.