DOI: 10.15468/dl.ccbx35
title: Occurrence Download

description: A dataset containing 65467 records in GBIF matching the query:
SELECT
 kingdom,
 kingdomkey,
 phylum,
 phylumkey,
 class,
 classkey,
 "order",
 orderkey,
 family,
 familykey,
 genus,
 genuskey,
 species,
 specieskey,
 PRINTF('%04d-%02d', "year", "month") yearmonth,
 GBIF_EQDGCODE(2, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)) eqdcellcode,
 IF(ISNULL(kingdomkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY kingdomkey, GBIF_EQDGCODE(2, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)), PRINTF('%04d-%02d', "year", "month"))) kingdomcount,
 IF(ISNULL(phylumkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY phylumkey, GBIF_EQDGCODE(2, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)), PRINTF('%04d-%02d', "year", "month"))) phylumcount,
 IF(ISNULL(classkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY classkey, GBIF_EQDGCODE(2, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)), PRINTF('%04d-%02d', "year", "month"))) classcount,
 IF(ISNULL(orderkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY orderkey, GBIF_EQDGCODE(2, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)), PRINTF('%04d-%02d', "year", "month"))) ordercount,
 IF(ISNULL(familykey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY familykey, GBIF_EQDGCODE(2, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000)), PRINTF('%04d-%02d', "year", "month"))) familycount,
 IF(ISNULL(genuskey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY genuskey, GBIF_EQDGCODE(2, 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 ('OBSERVATION', 'MACHINE_OBSERVATION', 'HUMAN_OBSERVATION', 'MATERIAL_SAMPLE', 'MATERIAL_CITATION', 'PRESERVED_SPECIMEN', 'FOSSIL_SPECIMEN', 'LIVING_SPECIMEN', 'OCCURRENCE')
 AND occurrence.continent = 'ASIA'
 AND occurrence.datasetkey IN ('4fa7b334-ce0d-4e88-aaae-2e0c138d049e', '50c9509d-22c7-4a22-a47d-8c48425ef4a7', '6c8d87be-829d-4364-b2bc-578258761cc2', '78fc169f-cef0-4054-88ec-9b694bcbf6e4', '040c5662-da76-4782-a48e-cdea1892d14c', 'ef6e0754-8bf2-4854-9aa3-3a2a1a90810b', '9f0e1ca6-fb08-4c72-9a4a-1e3b7a528c10', 'f170f056-3f8a-4ef3-ac9f-4503cc854ce0', '4410edca-3bdd-4475-98a2-de823b2266bc', 'ac9b5a09-a1b4-416c-9538-ca85078a7210')
 AND (occurrence.decimallatitude &gt;= 16.40883 AND occurrence.decimallatitude &lt;= 31.72051 AND (occurrence.decimallongitude &gt;= 35.04354 AND occurrence.decimallongitude &lt;= 54.53193) AND GBIF_WITHIN('POLYGON ((42.45765 25.63546, 48.09887 28.03013, 39.39532 31.72051, 35.04354 28.1136, 43.08487 16.40883, 54.34272 20.0917, 54.53193 21.6826, 51.03159 24.12244, 48.09887 27.86298, 42.45765 25.63546))', occurrence.decimallatitude, occurrence.decimallongitude) = TRUE)
 AND occurrence.hascoordinate = TRUE
 AND occurrence.hasgeospatialissues = FALSE
 AND LOWER(occurrence.iucnredlistcategory) = LOWER('LC')
 AND occurrence.license IN ('CC_BY_4_0', 'CC_BY_NC_4_0', 'CC0_1_0')
 AND occurrence."month" IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
 AND occurrence.occurrencestatus = 'PRESENT'
 AND NOT GBIF_STRINGARRAYCONTAINS(occurrence.issue, 'TAXON_MATCH_FUZZY', TRUE)
 AND (occurrence.distancefromcentroidinmeters &gt;= 2000.0 OR occurrence.distancefromcentroidinmeters IS NULL)
 AND (occurrence.specieskey 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,
 PRINTF('%04d-%02d', "year", "month"),
 GBIF_EQDGCODE(2, decimallatitude, decimallongitude, COALESCE(coordinateuncertaintyinmeters, 1000))

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