moveVis icon indicating copy to clipboard operation
moveVis copied to clipboard

Basemap are not correctly rendered

Open Bevann opened this issue 2 years ago • 12 comments

When animating GPS collar data everything works as expected, with the exception of the base maps that are downloaded through frames_spatial. The output does not contain all tiles, and are only in black and white. image This is not unique to my data, when I run the example vignette the result is also in black and white, though all the tiles are present. image

Is this perhaps related to the retirement of rgdal/rgeos and the change to the move2 package? If so, what would be the necessary changes to workflow as outlined in the vignette to include basemaps in animations?

Bevann avatar Sep 25 '23 23:09 Bevann

Following. I've been having the same issue. Running the same script as I did prior to April 2023, but was using basemap OSM watercolor which no longer works... Any advice or updates on this? vlcsnap-2023-09-29-12h52m10s741

cbreiter avatar Sep 29 '23 17:09 cbreiter

Yes I've seen this same problem.

smerker avatar Oct 05 '23 14:10 smerker

I'm also having the same problem with scripts which were previously fine, using several services & types (e.g. osm/topographic; mapbox/satellite).

Screenshot 2023-10-17 at 16 22 35

For some service/type combinations (osm/streets, carto/voyager) I'm now also getting this new error:

Loading basemap 'streets' from map service 'osm'...
Assigning raster maps to frames...
Error in if (row1 == 1 & row2 == nrow(x) & col1 == 1 & col2 == ncol(x)) { : 
  missing value where TRUE/FALSE needed

I'm seeing similar problems with package {basemaps}.

andrewdigby avatar Oct 17 '23 03:10 andrewdigby

I'm having the same error for all basemap types I tried (esri). Using the same script as before where the basemaps showed in colour. Please advise/fix

ingomiller avatar Nov 07 '23 03:11 ingomiller

I've also run into this problem. This is almost certainly caused by the same issue logged here for the basemaps package, caused by major changes in the terra package. There is a potential workaround logged in the final comment in the issue thread, if it could also be applied in moveVis - I've not personally tried. Further up the thread, this comment suggests that reverting to earlier versions of terra might not be straightforward as a workaround.

samfranks avatar Nov 16 '23 16:11 samfranks

I applied the work around samfranks mentioned (Thank you!) and it solved the basemaps issue. To do this I 1. uninstalled basemaps, 2. forked the repo from zross . 3. downloaded my forked repo using devtools and it worked like a charm.

ErikaPeirce-USDA avatar Nov 29 '23 22:11 ErikaPeirce-USDA

Hi, I am having the same issue with moveVis. I have followed the solution posted by ErikaPeirce-USDA and R does not crash anymore. However, I get the following:


Checking temporal alignment...
Processing movement data...
Approximated animation duration: ≈ 34.12s at 25 fps for 853 frames
Retrieving and compositing basemap imagery...
Loading basemap 'topographic' from map service 'osm'...
  |==============================================| 100% elapsed=01s  
Assigning raster maps to frames...
Error in if (row1 == 1 & row2 == nrow(x) & col1 == 1 & col2 == ncol(x)) { : 
  missing value where TRUE/FALSE needed

If I just run a basic example as posted on zross github, e.g.,:

data(ext)
set_defaults(map_service = "osm", map_type = "topographic")
basemap_magick(ext)

I obtain a map so I am not sure where the above error is coming from. Any advice would be great.

NinoPierantonio avatar Dec 04 '23 12:12 NinoPierantonio

I am having the same issues with my basemap displaying correctly; however, I am having trouble applying the workaround.

@ErikaPeirce-USDA could you please elaborate for this novice on what your 2nd and 3rd bullet points mean (e.g., what does fork the repo mean exactly?)

image

agblake22 avatar Feb 14 '24 17:02 agblake22

You should be able to install his fork (duplication of a package where some of the code is modified) of the package and then use it in place of the original basemaps package

remotes::install_github("zross/basemap-fork")

Bevann avatar Feb 14 '24 17:02 Bevann

@agblake22, i solved my issue by:

remotes::install_github("16eagle/moveVis") #install.packages("remotes") from github

paths<-.libPaths() #list the directories where R has saved packages in your local machine

remove.packages("basemaps", paths[1]) #remove the package basemaps from each directory (in my case 2)
remove.packages("basemaps", paths[2]) 

.rs.restartR() #restart the R session

remotes::install_github("zross/basemap-fork") #install the basemap-fork from ZROSS @https://github.com/zross/basemap-fork.git

library(basemaps) #load the package

If you still have problems with basemaps, you need to install the proper version of Rtools for your computer from https://cran.r-project.org/bin/windows/Rtools/

N

NinoPierantonio avatar Feb 14 '24 17:02 NinoPierantonio

Thanks for reporting this bug. This should be resolved with the latest version of basemaps on CRAN: Please update basemaps using install.packages("basemaps") and optionally update moveVis from GitHub using remotes::install_github("16eagle/moveVis") to apply the patch.

16EAGLE avatar Mar 05 '24 16:03 16EAGLE

I'm not sure if this is helpful or not for this issues (if others are still having issues with it), but the maps seem to render correctly only if all the projections from the original data (e.g. locations from movement data) are at WGS 84 (EPSG: 4326). I've tried mapbox and esri basemaps which seem to render well at that projection, but not in others (e.g. EPSG: 3347).

Perhaps this might help narrow in on the parts of frames_spatial() that might not be rendering correctly with other projections?

Thanks!

cshuert avatar Jun 25 '24 20:06 cshuert