" target="_blank"> |
DNA Data Input |
|
|
";
$jsonfile = file_get_contents('http://api.gbif.org/v0.9/occurrence/search?catalogNumber='.urlencode('B 10 0426933').'&limit=50');
// endpoint holen : http://api.gbif.org/v0.9/dataset/85714c48-f762-11e1-a439-00145eb45e9a/endpoint
// die GUID is datasetKey aus der Occurrence
$json_array = json_decode($jsonfile, true);
foreach ($json_array as $key1 => $list1) {
// Check type
if ($key1 == "results" and is_array($list1)) {
// Scan through inner loop
echo '
|
Specimen details (voucher) | ';
echo '
Preferred Taxon Name:
'.$list1[0]["scientificName"].'
Unit ID:
'.$list1[0]["catalogNumber"].'
Record Basis:
'.$list1[0]["basisOfRecord"].'
';
if(isset($list1[0]["occurrenceID"])) { echo
'Unit GUID:
'.$list1[0]["occurrenceID"].''; }
echo ' |
Institution Code:
'.$list1[0]["institutionCode"].'
Collection Code:
'.$list1[0]["collectionCode"].'
|
';
echo 'Identification(s):
Name: |
'.$list1[0]["scientificName"].' |
Identifier: | '.$list1[0]["identifiedBy"].' |
Taxonomy: |
'.$list1[0]["family"].' (familia) |
';
echo 'Collection Info:
Collector(s): '.$list1[0]["recordedBy"].'
';
if(isset($list1[0]["recordNumber"])) { echo
'Field number:
2011-14
'; }
echo 'Collection Date: '.$list1[0]["eventDate"].'
|
Locality | Other info |
Country: '.$list1[0]["country"].' '.$list1[0]["countryCode"].'
Locality: '.$list1[0]["locality"].'
Coordinates (Lat|Lon): '.$list1[0]["decimalLatitude"].' | '.$list1[0]["decimalLongitude"].' | ';
if(isset($list1[0]["elevation"])) { echo
'Altitude: '.$list1[0]["elevation"].' m '; }
echo ' |
|
';
foreach ($list1 as $key2 => $list2) {
// echo "Parameter: " . $list2 . "\n";
if (is_array($list2)) {
// Scan through inner loop
foreach($list2 as $key3 => $list3) {
if(!is_array($list3)) {
echo " |
Parameter: " . $key3;
echo " Value: " . $list3 . " |
"; }
else {} // nicht auflösende Arrays unterdrücken
} // foreach($list2 as $key3 => $list3)
} // if (is_array($list2))
} //foreach ($list1 as $key2 => $list2)
} //if ($key1 == "results" and is_array($list1))
} //foreach ($json_array as $key1 => $list1)
?>