From: Brian Quinion Date: Tue, 7 Dec 2010 13:41:02 +0000 (+0000) Subject: postcode/zipcode improvements, finish work on handling extratags X-Git-Tag: v2.0.0~186 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/631e8d09ab8bcfedb4e211e6453c684312a0140a?ds=sidebyside postcode/zipcode improvements, finish work on handling extratags --- diff --git a/lib/db.php b/lib/db.php index c50b3c40..acdb31c4 100644 --- a/lib/db.php +++ b/lib/db.php @@ -7,7 +7,9 @@ $oDB =& DB::connect(CONST_Database_DSN.($bNew?'?new_link=true':''), false); if (PEAR::IsError($oDB)) { - fail($oDB->getMessage(), 'Unable to connect to the database'); + var_dump(CONST_Database_DSN); + var_Dump($oDB); + fail($oDB->getMessage()); } $oDB->setFetchMode(DB_FETCHMODE_ASSOC); $oDB->query("SET DateStyle TO 'sql,european'"); diff --git a/lib/lib.php b/lib/lib.php index 6de3f242..acd3a5f2 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -697,12 +697,8 @@ $sSQL .= " length(name::text) as namelength "; $sSQL .= " from place_addressline join placex on (address_place_id = placex.place_id)"; $sSQL .= " where place_addressline.place_id = $iPlaceID and (rank_address > 0 OR address_place_id = $iPlaceID)"; -// and isaddress"; - if ($sCountryCode) - { - $sSQL .= " and (placex.country_code IS NULL OR placex.country_code = '".$sCountryCode."' OR rank_address < 4)"; - } - $sSQL .= " order by cached_rank_address desc,fromarea desc,distance asc,rank_search desc,namelength desc"; + $sSQL .= " order by cached_rank_address desc,isaddress desc,fromarea desc,distance asc,rank_search desc,namelength +desc"; //var_dump($sSQL); $aAddressLines = $oDB->getAll($sSQL); if (PEAR::IsError($aAddressLines)) diff --git a/lib/template/details-html.php b/lib/template/details-html.php index 0d5f6dc6..707d5726 100644 --- a/lib/template/details-html.php +++ b/lib/template/details-html.php @@ -31,8 +31,8 @@ body { float: right; } - - + +