Skip to content

How to deal with missing coordinates #215

Description

@sannegovaert

If there are missing coordinates:

Should camtrapdp

  • throw an error eg when rounding coordinates
  • only warn and do the calculations or updates ignoring the na's

2 case studies so far

Case study 1

A Camtrap DP with missing coordinates in 1 deployment.
Calling round_coordinates() results in a non-specific error:

dataset <-
  dataset %>% 
  camtrapdp::round_coordinates(digits = 3)

> Error in if (digits >= original_digits) { :
> missing value where TRUE/FALSE needed

Case study 2

A Camtrap DP with missing coordinates in 1 deployment.
The DP is read and manipulated with camtrapdp. Eg some observations were filtered out. It is written to disk. Frictionless validation fails because the spatial metadata has been updated automatically and set to NA:

───────────────────────────────────────────────────────────────────────────────────────── Tables ──────────────────────────────────────────────────────────────────────────────────────────
                                                                                          dataset                                                                                          
┏━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Row  ┃ Field ┃ Type          ┃ Message                                                                                                                                                  ┃
┡━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ None │ None  │ package-error │ The data package has an error: {'type': 'Polygon', 'coordinates': [[[None, None], [None, None], [None, None], [None, None], [None, None]]]} is not valid │
│      │       │               │ under any of the given schemas at property 'spatial'                                                                                                     │
└──────┴───────┴───────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions