Skip to content

Commit

Permalink
Merge pull request egbot#91 from bryo-lichen/master
Browse files Browse the repository at this point in the history
Occurrence Batch Georeferencing
  • Loading branch information
egbot authored Apr 7, 2021
2 parents 7606a55 + 1f54ed1 commit 58ffd52
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions classes/OccurrenceGeorefTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,28 @@ public function getLocalityArr(){
if($countryStr != trim($r->country) || $stateStr != trim($r->stateprovince) || $countyStr != trim($r->county)
|| $municipalityStr != trim($r->municipality) || $localityStr != trim($r->locality," .,;")
|| $verbCoordStr != trim($r->verbatimcoordinates) || $decLatStr != $r->decimallatitude || $decLngStr != $r->decimallongitude){
$countryStr = trim($r->country);
$stateStr = trim($r->stateprovince);
$countyStr = trim($r->county);
$municipalityStr = trim($r->municipality);
$localityStr = trim($r->locality," .,;");
$verbCoordStr = trim($r->verbatimcoordinates);
$decLatStr = $r->decimallatitude;
$decLngStr = $r->decimallongitude;
$totalCnt++;
$retArr[$totalCnt]['occid'] = $r->occid;
$retArr[$totalCnt]['country'] = $countryStr;
$retArr[$totalCnt]['stateprovince'] = $stateStr;
$retArr[$totalCnt]['county'] = $countyStr;
$retArr[$totalCnt]['municipality'] = $municipalityStr;
$retArr[$totalCnt]['locality'] = $localityStr;
$retArr[$totalCnt]['verbatimcoordinates'] = $verbCoordStr;
$retArr[$totalCnt]['decimallatitude'] = $decLatStr;
$retArr[$totalCnt]['decimallongitude'] = $decLngStr;
$retArr[$totalCnt]['cnt'] = 1;
$locCnt = 1;
$localityStr = trim($r->locality,' .,;');
$verbCoordStr = trim($r->verbatimcoordinates,' .,;');
if($localityStr && $verbCoordStr){
$countryStr = trim($r->country);
$stateStr = trim($r->stateprovince);
$countyStr = trim($r->county);
$municipalityStr = trim($r->municipality);
$decLatStr = $r->decimallatitude;
$decLngStr = $r->decimallongitude;
$totalCnt++;
$retArr[$totalCnt]['occid'] = $r->occid;
$retArr[$totalCnt]['country'] = $countryStr;
$retArr[$totalCnt]['stateprovince'] = $stateStr;
$retArr[$totalCnt]['county'] = $countyStr;
$retArr[$totalCnt]['municipality'] = $municipalityStr;
$retArr[$totalCnt]['locality'] = $localityStr;
$retArr[$totalCnt]['verbatimcoordinates'] = $verbCoordStr;
$retArr[$totalCnt]['decimallatitude'] = $decLatStr;
$retArr[$totalCnt]['decimallongitude'] = $decLngStr;
$retArr[$totalCnt]['cnt'] = 1;
$locCnt = 1;
}
}
else{
$locCnt++;
Expand Down

0 comments on commit 58ffd52

Please sign in to comment.