Search GBIF occurrences.
$occ = new Occurrences();
$species = new Species();
$occ->search(['taxonKey' => 3329049]);
$occ->search(['taxonKey' => 3329049, 'limit' => 2]);
$occ->search(['scientificName' => 'Ursus americanus']);
$sp = $species->nameBackbone([
'name' => 'Ursus americanus',
'rank' => 'species',
]);
$occ->search(['taxonKey' = $sp['usageKey']]);
$occ->search([
'datasetKey' => '7b5d6a48-f762-11e1-a439-00145eb45e9a',
'limit' =>20,
]);
$occ->search(['catalogNumber' => '49366', limit => 20]);
$occ->search([
'catalogNumber' => ['49366', 'Bird.27847588'],
'limit' => 20,
]);
$occ->search([
'datasetKey' => '7b5d6a48-f762-11e1-a439-00145eb45e9a',
'offset' => 10,
'limit' => 5,
]);
$occ->search([
'datasetKey' => '7b5d6a48-f762-11e1-a439-00145eb45e9a',
'offset' => 20,
'limit' => 5,
]);
$occ->search([
'datasetKey' => [
'50c9509d-22c7-4a22-a47d-8c48425ef4a7',
'7b5d6a48-f762-11e1-a439-00145eb45e9a',
],
'limit' => 20,
]);
$res = $occ->search(['recordedBy' => 'smith', 'limit' => 20]);
$occ->search(['recordedBy' => ['smith', 'BJ Stacey'], 'limit' => 20]);
$occ->search([
'recordedByID' => 'https://orcid.org/0000-0003-1691-239X',
'limit' => 3,
]);
$occ->search([
'identifiedByID' => 'https://orcid.org/0000-0003-1691-239X',
'limit' => 3,
]);
$splist = ['Cyanocitta stelleri', 'Junco hyemalis', 'Aix sponsa'];
$keys = [];
foreach ($splist as $sp) {
$keys[] = $species->nameSuggest($sp)[0]['key'];
}
$out = [];
foreach ($keys as $key) {
$out[] = $occ->search(['taxonKey' => $key, 'limit' => 1]);
}
$occ->search(['q' => 'kingfisher', 'limit' => 20]);
$occ->search(['q' => 'kingfisher', 'limit' => 20, 'spellCheck' = TRUE]);
$occ->search(['q' => 'kajsdkla', 'limit' => 20, 'spellCheck' => TRUE]);
$occ->search(['q' => 'helir', 'limit' => 20, 'spellCheck' => TRUE]);
$occ->search([
'decimalLatitude' => 50,
'decimalLongitude' => 10,
'limit' => 2,
]);
$occ->search([
'geometry' => 'POLYGON((30.1 10.1, 10 20, 20 40, 40 40, 30.1 10.1))',
'limit' => 20,
]);
$key = $species->nameSuggest(['q' => 'Aesculus hippocastanum'])[0]['key'];
$occ->search([
'taxonKey' => $key,
'geometry' => 'POLYGON((30.1 10.1, 10 20, 20 40, 40 40, 30.1 10.1))',
'limit' => 20,
]);
$wkt = 'MULTIPOLYGON(((-123 38, -123 43, -116 43, -116 38, -123 38)),((-97 41, -97 45, -93 45, -93 41, -97 41)))';
$occ->search(['geometry' => $wkt, 'limit' => 20]);
$occ->search('country' => 'US', 'limit' => 20);
$occ->search('country' => 'FR', 'limit' => 20);
$occ->search('country' => 'DE', 'limit' => 20);
$occ->search([
'taxonKey' => $key,
'hasCoordinate' => TRUE,
'limit' => 20,
]);
$occ->search([
'taxonKey' => $key,
'basisOfRecord' => 'LIVING_SPECIMEN',
'hasCoordinate' => TRUE,
'limit' => 20,
]);
$occ->search(['taxonKey' => $key, 'eventDate' => '2013', 'limit' => 20]);
$occ->search(['taxonKey' => $key, 'year' => '2013', limit => 20]);
$occ->search(['taxonKey' => $key, 'month' => '6', 'limit' => 20]);
$key = $species->nameBackbone(['name' => 'Salmo salar', 'kingdom' => 'animals'])['usageKey'];
$occ->search(['taxonKey' => $key, 'depth' => '5', 'limit' => 20]);
$key = $species->nameBackbone(['name' => 'Puma concolor', 'kingdom' => 'animals'])['usageKey'];
$occ->search([
'taxonKey' => $key,
'elevation' => 50,
'hasCoordinate' => TRUE,
'limit' => 20,
]);
$occ->search(['institutionCode' => 'TLMF', 'limit' =>20]);
$occ->search([
'collectionCode' => 'Floristic Databases MV - Higher Plants',
'limit' => 20,
]);
$occ->search(['
taxonKey' => $key,
'hasGeospatialIssue' => TRUE,
'limit' => 20,
]);
$occ->search(['q' => 'kingfisher', 'limit' => 20]);
$occ->search(['depth' => '50,100']);
$occ->search(['year' => '1999,2000', limit => 20]);
$occ->search(['decimalLatitude' => '29.59,29.6']);
$occ->search(['typeStatus' => 'allotype']);
$occ->search(['recordNumber' => 1]);
$occ->search(['lastInterpreted' => '2014-04-01']);
$occ->search(['continent' => 'south_america']);
$occ->search(['continent' => 'africa']);
$occ->search(['continent' => 'oceania']);
$occ->search(['continent' => 'antarctica']);
$occ->search(['mediatype' => 'StillImage']);
$occ->search(['mediatype' => 'MovingImage']);
$x = $occ->search(['mediatype' => 'Sound']);
$occ->search(['taxonKey' => 1, 'issue' => 'DEPTH_UNLIKELY');
$occ->search([
'taxonKey' => 1,
'issue' => ['DEPTH_UNLIKELY','COORDINATE_ROUNDED'],
]);
matched to the GBIF backbone properly:
$occ->search([
'datasetKey' => '84c0e1a0-f762-11e1-a439-00145eb45e9a',
issue => ['TAXON_MATCH_NONE','TAXON_MATCH_HIGHERRANK'],
]);
$wkt = 'POLYGON((-178.59375 64.83258989321493,-165.9375 59.24622380205539,-147.3046875 59.065977905449806,-130.78125 51.04484764446178,-125.859375 36.70806354647625,-112.1484375 23.367471303759686,-105.1171875 16.093320185359257,-86.8359375 9.23767076398516,-82.96875 2.9485268155066175,-82.6171875 -14.812060061226388,-74.8828125 -18.849111862023985,-77.34375 -47.661687803329166,-84.375 -49.975955187343295,174.7265625 -50.649460483096114,179.296875 -42.19189902447192,-176.8359375 -35.634976650677295,176.8359375 -31.835565983656227,163.4765625 -6.528187613695323,152.578125 1.894796132058301,135.703125 4.702353722559447,127.96875 15.077427674847987,127.96875 23.689804541429606,139.921875 32.06861069132688,149.4140625 42.65416193033991,159.2578125 48.3160811030533,168.3984375 57.019804336633165,178.2421875 59.95776046458139,-179.6484375 61.16708631440347,-178.59375 64.83258989321493))';
$occ->search(['geometry' => $wkt]);
$x = $occ->search(['facet' => 'country', 'limit' => 0]);
$x['facets'];
$x = $occ->search(['facet' => 'establishmentMeans', 'limit' => 10]);
$x['facets'];
$x['results'];
$x = $occ->search([
'facet' => ['country', 'basisOfRecord'],
'limit' => 10,
]);
$x['results'];
$x['facets'];
$x['facets']['country'];
$x['facets']['basisOfRecord'];
$x['facets']['basisOfRecord']['count'];
$x = $occ->search([
'facet' => 'country',
'facetMincount' => 30000000,
'limit' => 0,
]);
$x['facets'];
'_facetOffset' = 'country_facetOffset'.
$x = $occ->search([
'facet' => ['country', 'basisOfRecord', 'hasCoordinate'],
'country_facetLimit' => 3,
'basisOfRecord_facetLimit' => 6,
'limit' => 0,
]);
$x['facets'];
Definition: Occurrences.php:8