tylermorganwall / rayshader

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

render_label() with out-of-bounds location plots label multiple time a "noisy" location #205

Closed HenrikBengtsson closed 2 years ago

HenrikBengtsson commented 2 years ago

Example of problem:

issue

Produced by:

library(rayshader)
montereybay %>% sphere_shade() %>% plot_3d(montereybay, zscale=50)

santa_cruz <- c(36.962957, -122.021033)
render_label(montereybay,lat=santa_cruz[1], long=santa_cruz[2],
             extent=attr(montereybay, "extent"),
             zscale=50, text="Santa Cruz")

out_of_bounds <- c(37.20, -122.021033)
render_label(montereybay,lat=out_of_bounds[1], long=out_of_bounds[2],
             extent=attr(montereybay, "extent"),
             zscale=50, text="Out of bounds")

This is with rayshader 0.26.8 (commit dc1bb008) on Ubuntu 18.04.

Expected behavior

When out_of_bounds is outside the region, I'd expect one of the following things to happen:

tylermorganwall commented 2 years ago

Thanks! Fixed in 89119188054b9c38c09b49ffdc28a6d632f24f3f.