X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/a8a700e16d286971c43c013b322a1fd4a339de4d..0df5f77bc4c92e2f8f635105441779277435da67:/utils/importWikipedia.php diff --git a/utils/importWikipedia.php b/utils/importWikipedia.php index 5a6e6e04..6e429754 100755 --- a/utils/importWikipedia.php +++ b/utils/importWikipedia.php @@ -37,7 +37,7 @@ $sTestPageText = << 10) { + if (!isset($aPageProperties['sPossibleInfoboxType']) && count($aParams) > 10) { $aPageProperties['sPossibleInfoboxType'] = trim($aTemplate[0]); // $aPageProperties['aInfoboxParams'] = $aParams; } @@ -309,7 +309,7 @@ if (isset($aCMDResult['parse-wikipedia'])) { $oDB =& getDB(); $sSQL = 'select page_title from content where page_namespace = 0 and page_id %10 = '; $sSQL .= $aCMDResult['parse-wikipedia']; - $sSQL .= ' and (page_content ilike \'%{{Coord%\' or (page_content ilike \'%lat%\' and page_content ilike \'%lon%\'))' + $sSQL .= ' and (page_content ilike \'%{{Coord%\' or (page_content ilike \'%lat%\' and page_content ilike \'%lon%\'))'; $aArticleNames = $oDB->getCol($sSQL); /* $aArticleNames = $oDB->getCol($sSQL = 'select page_title from content where page_namespace = 0 and (page_content ilike \'%{{Coord%\' or (page_content ilike \'%lat%\' @@ -495,7 +495,7 @@ if (isset($aCMDResult['link'])) { if (!isset($aNominatRecords[0])) { $aNameParts = preg_split('#[(,]#', $aRecord['name']); - if (sizeof($aNameParts) > 1) { + if (count($aNameParts) > 1) { $sNameURL = $sURL.'&q='.urlencode(trim($aNameParts[0])); var_Dump($sNameURL); $sXML = file_get_contents($sNameURL); @@ -509,7 +509,7 @@ if (isset($aCMDResult['link'])) { } // assume first is best/right - for ($i = 0; $i < sizeof($aNominatRecords); $i++) { + for ($i = 0; $i < count($aNominatRecords); $i++) { $fDiff = ($aRecord['lat']-$aNominatRecords[$i]['LAT']) * ($aRecord['lat']-$aNominatRecords[$i]['LAT']); $fDiff += ($aRecord['lon']-$aNominatRecords[$i]['LON']) * ($aRecord['lon']-$aNominatRecords[$i]['LON']); $fDiff = sqrt($fDiff);