StatisticsNZ / simplevis

Simple visualisation with ggplot2 and leaflet wrappers
https://StatisticsNZ.github.io/simplevis
Other
86 stars 11 forks source link

leaf_sf*() does not work with crs 4167 #393

Closed davidhodge931 closed 2 years ago

davidhodge931 commented 2 years ago

This is because it has an incorrect logic statement of when to transform.

if (sf::st_is_longlat(data) == FALSE) data <- sf::st_transform(data, 4326)

where it should instead be if (sf::st_crs(data) != sf::st_crs(4326)) data <- sf::st_transform(data, 4326)