prioritizr / wdpar

Interface to the World Database on Protected Areas
https://prioritizr.github.io/wdpar
GNU General Public License v3.0
39 stars 5 forks source link

verify point buffer calculations #1

Closed jeffreyhanson closed 6 years ago

jeffreyhanson commented 6 years ago
rep_area = 5 # units in km^2
pt <- st_sfc(st_point(rbind(c(0,0))), crs = 3395)
pl <- st_buffer(pt, sqrt((rep_area * 1000000) / pi))
area <- units::set_units(sf::st_area(pl), km^2)
print(area)  # should be close to 5
jeffreyhanson commented 6 years ago

This works.