Andi Noakes
Andi Noakes

Reputation: 41

Is there an R function that calculates sunrise/sunset and takes sf objects? Maptools appears to need sp objects

I am trying to calculate sunrise/sunset times based on lat/long coordinates and have done it previously with an sp object and maptools::sunriset. This function doesn't take sf objects and sp is being deprecated so we need to switch over our code. Is anyone aware of a similar function that takes sf objects?

pts <- sf::st_as_sf(latLon, coords=c("lon", "lat"), crs=4326)

Where latLon is a data frame with latitude and longitude, we want to use pts object to get sunrise and sunset times.

Thank you in advance for your help!

Upvotes: 1

Views: 621

Answers (0)

Related Questions