ScientiaFelis / sebmsR

Swedish Butterflies - tools and apps
GNU Affero General Public License v3.0
2 stars 0 forks source link

split get_nearby into two parts #20

Closed larspett closed 5 months ago

larspett commented 8 months ago

get_nearby is currently made to get sites at min max values in a sunhour map. It would be good to split it into:

  1. [x] one generalized part finding nearby sites from a df. default wgs84 option to use RT90 2.5 gon v with built-in transformation
  2. [x] one specific part using first part to get the results that the function currently produces
ScientiaFelis commented 8 months ago

@larspett Testa gärna get_nearby()

Det finns en till funktion nu get_nearby_SunHour() som man kan mata med sebms_sunhours_data() Om man vill hitta min och max värdena och vilka lokaler som ligger närmast finns en wrapper sebms_minmax_sunhour()

Den tar tid eftersom denska kolla alla 57000 + coordinater. Man kan testa med:

sebms_sunhours_data(year = 2022, months = 4) %>% 
  slice_sample(n=100) %>%  
  get_nearby_SunHour(findMaxMin = T)