DOI: 10.15468/dl.zzn386
title: Occurrence Download

description: A dataset containing 128662412 records in GBIF matching the query:
SELECT
 kingdom,
 kingdomkey,
 phylum,
 phylumkey,
 class,
 classkey,
 "order",
 orderkey,
 family,
 familykey,
 genus,
 genuskey,
 species,
 specieskey,
 acceptedtaxonkey,
 acceptedscientificname,
 PRINTF('%04d-%02d', "year", "month") yearmonth,
 GBIF_ISEA3HCODE(9, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)) isea3hcellcode,
 IF(ISNULL(orderkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY orderkey, GBIF_ISEA3HCODE(9, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)), PRINTF('%04d-%02d', "year", "month"))) ordercount,
 IF(ISNULL(familykey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY familykey, GBIF_ISEA3HCODE(9, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)), PRINTF('%04d-%02d', "year", "month"))) familycount,
 IF(ISNULL(genuskey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY genuskey, GBIF_ISEA3HCODE(9, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)), PRINTF('%04d-%02d', "year", "month"))) genuscount,
 COUNT(*) occurrences,
 MIN(GBIF_TEMPORALUNCERTAINTY(eventdate, eventtime)) mintemporaluncertainty,
 MIN(COALESCE(coordinateuncertaintyinmeters, 1000)) mincoordinateuncertaintyinmeters
FROM
 occurrence
WHERE
 occurrence.basisofrecord IN ('HUMAN_OBSERVATION', 'OBSERVATION', 'OCCURRENCE', 'MACHINE_OBSERVATION')
 AND occurrence.datasetkey IN ('4fa7b334-ce0d-4e88-aaae-2e0c138d049e', '50c9509d-22c7-4a22-a47d-8c48425ef4a7', '8a863029-f435-446a-821e-275f4f641165', '4bf1cca8-832c-4891-9e17-7e7a65b7cc81', '906e6978-e292-4a8b-9c39-adf6bb0f3323')
 AND GBIF_WITHIN('POLYGON((-180 -90,180 -90,180 90,-180 90,-180 -90))', occurrence.decimallatitude, occurrence.decimallongitude) = TRUE
 AND occurrence.hascoordinate = TRUE
 AND occurrence.hasgeospatialissues = FALSE
 AND (GBIF_STRINGARRAYCONTAINS(occurrence.issue, 'COUNTRY_INVALID', TRUE) OR GBIF_STRINGARRAYCONTAINS(occurrence.issue, 'COUNTRY_DERIVED_FROM_COORDINATES', TRUE) OR GBIF_STRINGARRAYCONTAINS(occurrence.issue, 'CONTINENT_COORDINATE_MISMATCH', TRUE) OR GBIF_STRINGARRAYCONTAINS(occurrence.issue, 'CONTINENT_COUNTRY_MISMATCH', TRUE) OR GBIF_STRINGARRAYCONTAINS(occurrence.issue, 'CONTINENT_DERIVED_FROM_COORDINATES', TRUE) OR GBIF_STRINGARRAYCONTAINS(occurrence.issue, 'TAXON_MATCH_FUZZY', TRUE) OR GBIF_STRINGARRAYCONTAINS(occurrence.issue, 'TAXON_MATCH_HIGHERRANK', TRUE) OR GBIF_STRINGARRAYCONTAINS(occurrence.issue, 'COORDINATE_ROUNDED', TRUE) OR GBIF_STRINGARRAYCONTAINS(occurrence.issue, 'GEODETIC_DATUM_ASSUMED_WGS84', TRUE))
 AND LOWER(occurrence.iucnredlistcategory) IN (LOWER('EW'), LOWER('CR'), LOWER('EN'), LOWER('VU'), LOWER('NT'), LOWER('LC'), LOWER('DD'), LOWER('NE'))
 AND occurrence.occurrencestatus = 'PRESENT'
 AND (CAST(occurrence.taxonkey AS INTEGER) = 212 OR CAST(occurrence.acceptedtaxonkey AS INTEGER) = 212 OR CAST(occurrence.kingdomkey AS INTEGER) = 212 OR CAST(occurrence.phylumkey AS INTEGER) = 212 OR CAST(occurrence.classkey AS INTEGER) = 212 OR CAST(occurrence.orderkey AS INTEGER) = 212 OR CAST(occurrence.familykey AS INTEGER) = 212 OR CAST(occurrence.genuskey AS INTEGER) = 212 OR CAST(occurrence.specieskey AS INTEGER) = 212)
 AND (occurrence."year" &gt;= 2000 AND occurrence."year" &lt;= 2026)
 AND NOT GBIF_STRINGARRAYCONTAINS(occurrence.issue, 'TAXON_MATCH_FUZZY', TRUE)
 AND (occurrence.distancefromcentroidinmeters &gt;= 2000.0 OR occurrence.distancefromcentroidinmeters IS NULL)
 AND (occurrence.acceptedtaxonkey IS NOT NULL AND occurrence."year" IS NOT NULL AND occurrence."month" 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.acceptedtaxonkey,
 occurrence.acceptedscientificname,
 PRINTF('%04d-%02d', "year", "month"),
 GBIF_ISEA3HCODE(9, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000))

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