tylermorganwall / rayshader

R Package for 2D and 3D mapping and data visualization
https://www.rayshader.com/
2.05k stars 211 forks source link

render_highquality() fails - cannot find temprayfile.png #216

Closed gavinrozzi closed 2 years ago

gavinrozzi commented 2 years ago

Hello! Thank you Tyler for this excellent package. I am having some trouble creating a high quality render using the render_highquality() function after passing a ggplot object to plot_gg(). Rayshader plots the ggplot as expected, and I can save a low res snapshot using render_snapshot(), however render_highquality() always fails for me when trying to render a ggplot.

This is the output after attempting to run render_highquality() with no cache file specified in the argument:

Error in render_scene_rcpp(camera_info = camera_info, scene_info = scene_info) : 
  Could not find [MY TEMPDIR]\temprayfile.png

Have tried this on two different machines to rule out an issue with my setup. Even specifying a cache file returns the same error. Would appreciate any thoughts on how to resolve.

tylermorganwall commented 2 years ago

Firts, copy and paste the output of sessionInfo() here so I can see what package versions you have. Do the files appear in the temp directory when you run the script?

simoncarrignon commented 2 years ago

Same issue for me on ubuntu with rayshader 0.24.10. It looks like tempdir() is pasted twice somewhere. When using the default function it returns something like :

Error in file(filename, "w") : cannot open the connection In addition: Warning message: In file(filename, "w") : cannot open file '/tmp/RtmpLpcKrk//tmp/RtmpLpcKrk/tmpray.obj': No such file or directory

And even when specifying cache_filename manually with something like :

render_highquality(cache_filename="/home/me/myfile")

I get the error

Error in file(filename, "w") : cannot open the connection In addition: Warning message: In file(filename, "w") : cannot open file '/tmp/RtmpLpcKrk//home/me/myfile.obj': No such file or directory

simoncarrignon commented 2 years ago

update: it looks like it works using the version on github (rayshader_0.27.4)

bianchenhao commented 2 years ago

Same issue for me on ubuntu with rayshader 0.24.10. It looks like tempdir() is paste twice somewhere. When using the default function it return something like :

Error in file(filename, "w") : cannot open the connection In addition: Warning message: In file(filename, "w") : cannot open file '/tmp/RtmpLpcKrk//tmp/RtmpLpcKrk/tmpray.obj': No such file or directory

And even when specifying cache_filename manually with something like :

render_highquality(cache_filename="/home/me/myfile")

I get the error

Error in file(filename, "w") : cannot open the connection In addition: Warning message: In file(filename, "w") : cannot open file '/tmp/RtmpLpcKrk//home/me/myfile.obj': No such file or directory

@simoncarrignon same error in windows, tempdir() pastes twice in rayshader 0.24.10.And follow your advice to update to rayshader_0.27.4, it works.