In hill_diversity_number.php, within each output function, add the line
$total = $gen->current()['total'];
and change all return statements return x to return [x, $total] or return [null, 0]
In get_gbif_stats_g.php, change the diversity function call to:
[$loc_diversity, $total] = $diversity($gbif_data_gen);
and the yield statement to
yield [ 'location' => $loc, 'diversity' => $loc_diversity, 'observations' => $total ];
In get_gbif_diversity.php, change the result building function call to
$geojson_ar = make_geojson($res, ['iteration', 'diversity', 'observations']);
In hill_diversity_number.php, within each output function, add the line
$total = $gen->current()['total'];
and change all return statementsreturn x
toreturn [x, $total]
orreturn [null, 0]
In get_gbif_stats_g.php, change the diversity function call to:[$loc_diversity, $total] = $diversity($gbif_data_gen);
and the yield statement to yield [ 'location' => $loc, 'diversity' => $loc_diversity, 'observations' => $total ]; In get_gbif_diversity.php, change the result building function call to$geojson_ar = make_geojson($res, ['iteration', 'diversity', 'observations']);