From 9eb5b62382a93d07d4c9643e49a8c764a3e50b93 Mon Sep 17 00:00:00 2001 From: Brian Quinion Date: Thu, 15 Nov 2012 17:27:08 +0000 Subject: [PATCH 1/7] Accidentally used the same variable name for 2 things - broken search by class&type --- website/search.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/website/search.php b/website/search.php index d0b183ea..c4d37f9b 100755 --- a/website/search.php +++ b/website/search.php @@ -939,7 +939,7 @@ { $sPlaceIDs = join(',',$aPlaceIDs); - $aResultPlaceIDs = array(); + $aClassPlaceIDs = array(); if (!$aSearch['sOperator'] || $aSearch['sOperator'] == 'name') { @@ -949,7 +949,7 @@ if ($sCountryCodesSQL) $sSQL .= " and country_code in ($sCountryCodesSQL)"; $sSQL .= " order by rank_search asc limit $iLimit"; if (CONST_Debug) var_dump($sSQL); - $aResultPlaceIDs = $oDB->getCol($sSQL); + $aClassPlaceIDs = $oDB->getCol($sSQL); } if (!$aSearch['sOperator'] || $aSearch['sOperator'] == 'near') // & in @@ -967,9 +967,9 @@ if ($iMaxRank < 9 && $bCacheTable) { // Try and get a polygon to search in instead - $sSQL = "select geometry from placex where place_id in ($sPlaceIDs) and rank_search < $iMaxRank + 5 and st_geometrytype(geometry) in ('ST_Polygon','ST_MultiPolygon') order by rank_search asc limit 1"; - if (CONST_Debug) var_dump($sSQL); - $sPlaceGeom = $oDB->getOne($sSQL); + $sSQL = "select geometry from placex where place_id in ($sPlaceIDs) and rank_search < $iMaxRank + 5 and st_geometrytype(geometry) in ('ST_Polygon','ST_MultiPolygon') order by rank_search asc limit 1"; + if (CONST_Debug) var_dump($sSQL); + $sPlaceGeom = $oDB->getOne($sSQL); } if ($sPlaceGeom) @@ -1020,7 +1020,7 @@ if ($iOffset) $sSQL .= " offset $iOffset"; $sSQL .= " limit $iLimit"; if (CONST_Debug) var_dump($sSQL); - $aResultPlaceIDs = array_merge($aResultPlaceIDs, $oDB->getCol($sSQL)); + $aClassPlaceIDs = array_merge($aClassPlaceIDs, $oDB->getCol($sSQL)); } else { @@ -1042,12 +1042,12 @@ if ($iOffset) $sSQL .= " offset $iOffset"; $sSQL .= " limit $iLimit"; if (CONST_Debug) var_dump($sSQL); - $aResultPlaceIDs = array_merge($aResultPlaceIDs, $oDB->getCol($sSQL)); + $aClassPlaceIDs = array_merge($aClassPlaceIDs, $oDB->getCol($sSQL)); } } } - $aPlaceIDs = $aResultPlaceIDs; + $aPlaceIDs = $aClassPlaceIDs; } @@ -1066,6 +1066,7 @@ } if ($iQueryLoop > 20) break; } + //exit; if (isset($aResultPlaceIDs) && sizeof($aResultPlaceIDs)) break; if ($iGroupLoop > 4) break; From 0c9630b24ae572667dce4b4a6f65abe5366dd845 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 16 Nov 2012 22:22:04 +0100 Subject: [PATCH 2/7] clean up html for search form - move CSS to its own file - make it pass as valid XHTML - move attribution into Mapnik layer definition - remove Osmarender layer --- lib/template/search-html.php | 218 +++++------------------------------ website/css/search.css | 166 ++++++++++++++++++++++++++ website/js/tiles.js | 31 +---- 3 files changed, 194 insertions(+), 221 deletions(-) create mode 100644 website/css/search.css diff --git a/lib/template/search-html.php b/lib/template/search-html.php index 3fd8096d..07c26be1 100644 --- a/lib/template/search-html.php +++ b/lib/template/search-html.php @@ -1,184 +1,18 @@ - + + OpenStreetMap Nominatim: Search + - - - - - + + + - + + +