nish-kishore / sirfunctions

Key functions used by the SIR team
Other
0 stars 0 forks source link

extract_country_data() - handling of spatial file errors #73

Closed mcuadera closed 5 months ago

mcuadera commented 5 months ago

In extract_country_data(), errors in downloading of spatial files are handled by toggling sf_use_s2(). It would be preferable to have the ability to handle errors in loading spatial files in an iterative way:

  1. sf_use_s2(T): default
  2. Change mode by toggling sf_use_s2(F) if first pass fails.
  3. If step 2 fails, then use a st_make_valid()

In cases other than no. 1, we should write a clear warning stating the process we are using and which data we are implementing it to. This helps with informing the user potential issues when they end up mapping their data and help us potentially spot future errors that we may not have accounted for.