iobis / obis-qc

OBIS QC checks
9 stars 3 forks source link

depth checks #22

Open ymgan opened 1 year ago

ymgan commented 1 year ago

obis-qc checks

Check Fields Flags Absence Dropped Vandepitte et al. flag number
minimumDepthInMeters and maximumDepthInMeters should be present. minimumDepthInMeters, maximumDepthInMeters  NO_DEPTH      
minimumDepthInMeters and maximumDepthInMeters should be within range. minimumDepthInMeters, maximumDepthInMeters DEPTH_OUT_OF_RANGE      
minimumDepthInMeters and maximumDepthInMeters should be less than or equal to the bathymetric depth. minimumDepthInMeters, maximumDepthInMeters DEPTH_EXCEEDS_BATH     19
minimumDepthInMeters exceeds maximumDepthInMeters minimumDepthInMeters, maximumDepthInMeters MIN_DEPTH_EXCEEDS_MAX ?

TDWG BDQ TG2 Tests

Validation

*Parameterized

Amendment

Parameters

test default_parameters obis-qc_current_parameters
VALIDATION_MAXDEPTH_INRANGE bdq:minimumValidDepthInMeters default="0" -100000
VALIDATION_MAXDEPTH_INRANGE bdq:maximumValidDepthInMeters default="11000" 11000
VALIDATION_MINDEPTH_INRANGE bdq:minimumValidDepthInMeters="0" -100000
VALIDATION_MINDEPTH_INRANGE bdq:maximumValidDepthInMeters="11000" 11000

GBIF flags

https://github.com/gbif/gbif-api/blob/dev/src/main/java/org/gbif/api/vocabulary/OccurrenceIssue.java

  /**
   * Set if supplied depth is not given in the metric system, for example using feet instead of
   * meters
   */
  DEPTH_NOT_METRIC(WARNING, DwcTerm.minimumDepthInMeters, DwcTerm.maximumDepthInMeters),

  /**
   * Set if depth is larger than 11,000m or negative.
   */
  DEPTH_UNLIKELY(WARNING, DwcTerm.minimumDepthInMeters, DwcTerm.maximumDepthInMeters),

  /**
   * Set if supplied minimum depth > maximum depth
   */
  DEPTH_MIN_MAX_SWAPPED(WARNING, DwcTerm.minimumDepthInMeters, DwcTerm.maximumDepthInMeters),

  /**
   * Set if depth is a non-numeric value
   */
  DEPTH_NON_NUMERIC(WARNING, DwcTerm.minimumDepthInMeters, DwcTerm.maximumDepthInMeters),

Visualization for OBIS data

Notebook here

enddepth <= 0

image

verbatimDepth, based on facet API

https://api.obis.org/v3/facet?facets=verbatimDepth

image

Related issues

ymgan commented 1 year ago

I think it is worth mentioning that depth should not be negative: https://github.com/tdwg/bdq/issues/107#issuecomment-961330986

Maybe we should take this into consideration while considering the parameters minimumValidDepthInMeters~

albenson-usgs commented 1 year ago

I think it also means adding support for minimumDistanceAboveSurface and maximumDistanceAboveSurface?

ymgan commented 1 year ago

I think it also means adding support for minimumDistanceAboveSurface and maximumDistanceAboveSurface?

@albenson-usgs I don't know. I am just mapping the obis-qc checks to checks in BDQ and GBIF. I leave the other tests relevant for the fields here since I had to go through them.

Unless OBIS indicates the capacity to implement the checks for minimumDistanceAboveSurface and maximumDistanceAboveSurface, I will not look at that (no funding haha) I am doing this outside office hours. Anyone else is welcome to look at that though.

pieterprovoost commented 1 year ago

@albenson-usgs Are there any existing BDQ checks that take into account minimumDistanceAboveSurface and maximumDistanceAboveSurface?

I do think we'll need to take these into account when deriving depth values, if I understand correctly a min/maximumDepthInMeters of 100 (which then becomes the reference surface) and a min/maximumDistanceAboveSurface of 10 should result in a derived depth value of 90 (for filtering purposes etc).

ymgan commented 1 year ago

Thanks @pieterprovoost! There isn't any test for minimumDistanceAboveSurfaceInMeters and maximumDistanceAboveSurfaceInMeters from BDQ. There are only tests for depth and elevations.

I don't see any test for min/maximumDistanceAboveSurfaceInMeters in GBIF either.

ymgan commented 12 months ago

2023-04-20 meeting

Determining min/maxValidDepthInMeters

Depth check against bathymetry

Derived depth