h-a-graham / rayvista

An R plugin for {rayshader} to view a 3D vista anywhere on earth.
GNU General Public License v3.0
107 stars 5 forks source link

Error: The elevatr package requires longitude in a range from -180 to 180. #38

Closed mnahmad closed 1 year ago

mnahmad commented 1 year ago

I changed lat long in example code but getting the following error

Error: The elevatr package requires longitude in a range from -180 to 180.

The longitude is 36.834583.

library(rayshader) 
library(rayvista)

#.lat <- 57.219566
#.long <- -6.092690

.lat <- -1.362863
.long <- 36.834583

cuillins <- plot_3d_vista(lat = .lat, long = .long, phi=30, outlier_filter=0.001)

render_label(heightmap= cuillins, text='Bla Bheinn: 928 m', lat = .lat,
             long=.long, extent = attr(cuillins, 'extent'),altitude=600,
             clear_previous = T, zscale = 1)

render_compass() 

render_scalebar(limits=c(round(dim(cuillins)[2]*attr(cuillins, 'resolution')/1000,1)), label_unit = 'km')

render_snapshot()
h-a-graham commented 1 year ago

Hey, check out this issue here: https://github.com/h-a-graham/rayvista/issues/36. This should be solved by installing {elevatr} from GitHub.

mnahmad commented 1 year ago

thanks, it worked