DOI: 10.15468/dl.twuhan
title: Occurrence Download

description: A dataset containing 52192 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(5, decimallatitude, decimallongitude, 0.0) eqdcellcode,
 IF(ISNULL(kingdomkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY kingdomkey, GBIF_EQDGCODE(5, decimallatitude, decimallongitude, 0.0), PRINTF('%04d-%02d', "year", "month"))) kingdomcount,
 IF(ISNULL(phylumkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY phylumkey, GBIF_EQDGCODE(5, decimallatitude, decimallongitude, 0.0), PRINTF('%04d-%02d', "year", "month"))) phylumcount,
 IF(ISNULL(classkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY classkey, GBIF_EQDGCODE(5, decimallatitude, decimallongitude, 0.0), PRINTF('%04d-%02d', "year", "month"))) classcount,
 IF(ISNULL(orderkey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY orderkey, GBIF_EQDGCODE(5, decimallatitude, decimallongitude, 0.0), PRINTF('%04d-%02d', "year", "month"))) ordercount,
 IF(ISNULL(familykey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY familykey, GBIF_EQDGCODE(5, decimallatitude, decimallongitude, 0.0), PRINTF('%04d-%02d', "year", "month"))) familycount,
 IF(ISNULL(genuskey), NULL, SUM(COUNT(*)) OVER (
 PARTITION BY genuskey, GBIF_EQDGCODE(5, decimallatitude, decimallongitude, 0.0), PRINTF('%04d-%02d', "year", "month"))) genuscount,
 COUNT(DISTINCT recordedby) distinctobservers,
 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', 'PRESERVED_SPECIMEN', 'OCCURRENCE', 'LIVING_SPECIMEN')
 AND occurrence.countrycode = 'PT'
 AND (occurrence.level0gid = 'PRT.13_1' OR occurrence.level1gid = 'PRT.13_1' OR occurrence.level2gid = 'PRT.13_1' OR occurrence.level3gid = 'PRT.13_1')
 AND occurrence.occurrencestatus = 'PRESENT'
 AND (occurrence.taxonkey = 6 OR occurrence.acceptedtaxonkey = 6 OR occurrence.kingdomkey = 6 OR occurrence.phylumkey = 6 OR occurrence.classkey = 6 OR occurrence.orderkey = 6 OR occurrence.familykey = 6 OR occurrence.genuskey = 6 OR occurrence.specieskey = 6)
 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 (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', occurrence."year", occurrence."month"),
 GBIF_EQDGCODE(5, occurrence.decimallatitude, occurrence.decimallongitude, 0.0)

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