Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fpr_sp_assign_utm fails with empty rows, need to build safety checks #62

Open
lucy-schick opened this issue Mar 8, 2024 · 0 comments
Open
Assignees

Comments

@lucy-schick
Copy link
Collaborator

lucy-schick commented Mar 8, 2024

fpr_sp_assign_utm fails when dat contains empty rows because it cannot find a crs due to NAs.

Need to build in a check to make sure dat doesn't contain any empty rows, and inform user about whats going on.

Found this problem when calling fpr_sp_gpkg_backup which calls fpr_sp_assign_utm:

> # first we back up the gpkg in the repo and update the coordinate columns in the gpkg in QGIS
> pscis_export_raw <- fpr_sp_gpkg_backup(
+   path_gpkg = "~/Projects/gis/sern_lchl_necr_fran_2023/data_field/2023/form_pscis_2023.gpkg",
+   update_utm = TRUE,
+   update_site_id = TRUE,
+   write_back_to_path = TRUE,
+   write_to_csv = TRUE,
+   # this versions on git everytime due to metadata and can't be tracked visually. Should only be committed when
+   # csv is versioned
+   write_to_rdata = TRUE,
+   return_object = TRUE)

Error in `purrr::map2()`:
ℹ In index: 3.
Caused by error:
! crs not found: is it missing?

Removed the 3 empty rows from form_pscis_2023.gpkg in Q and then it worked.

@lucy-schick lucy-schick changed the title fpr_sp_assign_utm fails with empty rows, need to build sanity checks fpr_sp_assign_utm fails with empty rows, need to build safety checks Mar 8, 2024
@lucy-schick lucy-schick self-assigned this Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant