DOI: 10.15468/dl.9y9mdd
title: Occurrence Download

description: A dataset containing 46235 records in GBIF matching the query:
SELECT
 kingdom,
 kingdomkey,
 phylum,
 phylumkey,
 class,
 classkey,
 "order",
 orderkey,
 family,
 familykey,
 genus,
 genuskey,
 species,
 specieskey,
 "year",
 IF(ISNULL(kingdomkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY kingdomkey, "year")) kingdomcount,
 IF(ISNULL(phylumkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY phylumkey, "year")) phylumcount,
 IF(ISNULL(classkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY classkey, "year")) classcount,
 IF(ISNULL(orderkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY orderkey, "year")) ordercount,
 IF(ISNULL(familykey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY familykey, "year")) familycount,
 IF(ISNULL(genuskey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY genuskey, "year")) genuscount,
 COUNT(*) occurrences,
 MIN(GBIF_TEMPORALUNCERTAINTY(eventdate, eventtime)) mintemporaluncertainty,
 MIN(COALESCE(coordinateuncertaintyinmeters, 1000)) mincoordinateuncertaintyinmeters
FROM
 occurrence
WHERE
 occurrence.basisofrecord IN ('HUMAN_OBSERVATION', 'PRESERVED_SPECIMEN')
 AND occurrence.countrycode = 'MX'
 AND occurrence.datasetkey IN ('50c9509d-22c7-4a22-a47d-8c48425ef4a7', '8016518a-f762-11e1-a439-00145eb45e9a', '98c51784-da02-4f0e-81a4-f3635cb3cba7', '356b321d-7d47-4380-89e2-87bae6d8c250', '33948acc-bfac-4107-92c8-6464de387822', '05da2f31-7301-49f7-b79f-f9e7d12d8b2c', '2c5b0d56-93bf-43d8-870f-adfd8c4c2c39')
 AND occurrence.hascoordinate = TRUE
 AND occurrence.hasgeospatialissues = FALSE
 AND LOWER(occurrence.iucnredlistcategory) IN (LOWER('EW'), LOWER('CR'), LOWER('EN'), LOWER('VU'), LOWER('LC'), LOWER('NT'), LOWER('DD'), LOWER('NE'))
 AND occurrence.occurrencestatus = 'PRESENT'
 AND occurrence.publishingorgkey IN ('ff90b050-c256-11db-b71b-b8a03c50a862', '28eb1a3f-1c15-4a95-931a-4af90ecb574d')
 AND (CAST(occurrence.taxonkey AS INTEGER) IN (1354, 1353, 718, 1370, 691, 422, 1169, 640, 552) OR CAST(occurrence.acceptedtaxonkey AS INTEGER) IN (1354, 1353, 718, 1370, 691, 422, 1169, 640, 552) OR CAST(occurrence.kingdomkey AS INTEGER) IN (1354, 1353, 718, 1370, 691, 422, 1169, 640, 552) OR CAST(occurrence.phylumkey AS INTEGER) IN (1354, 1353, 718, 1370, 691, 422, 1169, 640, 552) OR CAST(occurrence.classkey AS INTEGER) IN (1354, 1353, 718, 1370, 691, 422, 1169, 640, 552) OR CAST(occurrence.orderkey AS INTEGER) IN (1354, 1353, 718, 1370, 691, 422, 1169, 640, 552) OR CAST(occurrence.familykey AS INTEGER) IN (1354, 1353, 718, 1370, 691, 422, 1169, 640, 552) OR CAST(occurrence.genuskey AS INTEGER) IN (1354, 1353, 718, 1370, 691, 422, 1169, 640, 552) OR CAST(occurrence.specieskey AS INTEGER) IN (1354, 1353, 718, 1370, 691, 422, 1169, 640, 552))
 AND (occurrence."year" &gt;= 1901 AND occurrence."year" &lt;= 2025)
 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)
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"

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