Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basemap are not correctly rendered #120

Open
Bevann opened this issue Sep 25, 2023 · 11 comments
Open

Basemap are not correctly rendered #120

Bevann opened this issue Sep 25, 2023 · 11 comments

Comments

@Bevann
Copy link

Bevann commented Sep 25, 2023

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?

@cbreiter
Copy link

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

@smerker
Copy link

smerker commented Oct 5, 2023

Yes I've seen this same problem.

@andrewdigby
Copy link

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}.

@ingomiller
Copy link

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

@samfranks
Copy link

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.

@ErikaPeirce-USDA
Copy link

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.

@NinoPierantonio
Copy link

NinoPierantonio commented Dec 4, 2023

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.

@agblake22
Copy link

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

@Bevann
Copy link
Author

Bevann commented Feb 14, 2024

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")

@NinoPierantonio
Copy link

@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

@16EAGLE
Copy link
Owner

16EAGLE commented Mar 5, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants