gbif / occurrence-cube

Workflows for producing species occurrence cubes from GBIF mediated data
Apache License 2.0
4 stars 1 forks source link

Temporal dimension: date intervals #10

Open MattBlissett opened 8 months ago

MattBlissett commented 8 months ago

The dimensions year, yearmonth and yearmonthday can be derived from the existing GBIF year, month and day columns:

  CONCAT_WS('-', year, month, day) AS date
  ...
  WHERE year IS NOT NULL AND month IS NOT NULL AND day IS NOT NULL

Though it might be helpful to provide a function to calculate the middle of a date range:

  date_average(eventdategte, eventdatelte)

equivalent to

  (eventdatelte + eventdategte) / 2

Also consider formatting this as as string when output.

https://docs.gbif-uat.org/b-cubed/1.0/en/#temporal