DOI: 10.15468/dl.q24yb6
title: Occurrence Download

description: A dataset containing 3524595 records in GBIF matching the query:
SELECT
 kingdom,
 kingdomkey,
 phylum,
 phylumkey,
 class,
 classkey,
 "order",
 orderkey,
 family,
 familykey,
 genus,
 genuskey,
 species,
 specieskey,
 "year",
 GBIF_MGRSCODE(1, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)) mgrscellcode,
 IF(ISNULL(kingdomkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY kingdomkey, GBIF_MGRSCODE(1, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)), "year")) kingdomcount,
 IF(ISNULL(phylumkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY phylumkey, GBIF_MGRSCODE(1, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)), "year")) phylumcount,
 IF(ISNULL(classkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY classkey, GBIF_MGRSCODE(1, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)), "year")) classcount,
 IF(ISNULL(orderkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY orderkey, GBIF_MGRSCODE(1, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)), "year")) ordercount,
 IF(ISNULL(familykey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY familykey, GBIF_MGRSCODE(1, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)), "year")) familycount,
 IF(ISNULL(genuskey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY genuskey, GBIF_MGRSCODE(1, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)), "year")) genuscount,
 COUNT(*) occurrences,
 MIN(GBIF_TEMPORALUNCERTAINTY(eventdate, eventtime)) mintemporaluncertainty,
 MIN(COALESCE(coordinateuncertaintyinmeters, 1000)) mincoordinateuncertaintyinmeters
FROM
 occurrence
WHERE
 GBIF_WITHIN('POLYGON((-75.20089 5.66121,-71.82608 5.66121,-71.82608 11.08948,-75.20089 11.08948,-75.20089 5.66121))', occurrence.decimallatitude, occurrence.decimallongitude) = TRUE
 AND (occurrence.taxonkey IN ('359', '212', '358', '12170552', '12170550', '12170551', '131') OR occurrence.acceptedtaxonkey IN ('359', '212', '358', '12170552', '12170550', '12170551', '131') OR occurrence.kingdomkey IN ('359', '212', '358', '12170552', '12170550', '12170551', '131') OR occurrence.phylumkey IN ('359', '212', '358', '12170552', '12170550', '12170551', '131') OR occurrence.classkey IN ('359', '212', '358', '12170552', '12170550', '12170551', '131') OR occurrence.orderkey IN ('359', '212', '358', '12170552', '12170550', '12170551', '131') OR occurrence.familykey IN ('359', '212', '358', '12170552', '12170550', '12170551', '131') OR occurrence.genuskey IN ('359', '212', '358', '12170552', '12170550', '12170551', '131') OR occurrence.specieskey IN ('359', '212', '358', '12170552', '12170550', '12170551', '131'))
 AND occurrence.hasgeospatialissues = FALSE
 AND NOT GBIF_STRINGARRAYCONTAINS(occurrence.issue, 'TAXON_MATCH_FUZZY', TRUE)
 AND (occurrence.distancefromcentroidinmeters &gt;= 2000.0 OR occurrence.distancefromcentroidinmeters IS NULL)
 AND NOT occurrence.basisofrecord IN ('FOSSIL_SPECIMEN', 'LIVING_SPECIMEN')
 AND occurrence.occurrencestatus = 'PRESENT'
 AND (occurrence.specieskey IS NOT NULL AND occurrence."year" IS NOT NULL AND occurrence.hascoordinate = TRUE)
GROUP BY
 occurrence.kingdom,
 occurrence.kingdomkey,
 occurrence.phylum,
 occurrence.phylumkey,
 occurrence.class,
 occurrence.classkey,
 occurrence."order",
 occurrence.orderkey,
 occurrence.family,
 occurrence.familykey,
 occurrence.genus,
 occurrence.genuskey,
 occurrence.species,
 occurrence.specieskey,
 occurrence."year",
 GBIF_MGRSCODE(1, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000))

 The dataset's 3524595 records were derived from 375 constituent datasets; see https://api.gbif.org/v1/occurrence/download/0008904-251025141854904/datasets/export for details.
 
Data from some individual datasets included in this download may be licensed under less restrictive terms.