Occurrence Cube provides user defined functions (UDF) to aggregate species occurrence data with Structured Query Language (SQL). They avoid users having to write complex aggregation queries themselves. The functions are especially relevant when creating species occurrence cubes and can be used in the SQL download API.
Found a bug or have a suggestion? Submit it as an issue.
The following query counts the number of species occurrences from Belgium for each cell in the EEA reference grid. The user defined function GBIF_EEARGCode()
simplifies this query.
SELECT
GBIF_EEARGCode(
1000, -- Size of the grid cell (1 km)
decimalLatitude, -- Latitude of the occurrence
decimalLongitude, -- Longitude of the occurrence
0.0 -- Spatial uncertainty (0 m)
) AS eeaCellCode,
count(*) AS occurrences
FROM
occurrence
WHERE
countryCode = 'BE'
GROUP BY
eeaCellCode
- Function documentation: all functions start with
GBIF_
. - Initial specification for the software
Occurrence Cube is licensed under the Apache License, Version 2.0 or the MIT license, at your option.
The GBIF development of species occurrence cubes is part of B³ (Biodiversity Building Blocks for policy) Work Package 2, led by the Research Institute for Nature and Forest (INBO) and funded by the European Union’s Horizon Europe Research and Innovation Programme (ID No 101059592).