]> git.openstreetmap.org Git - nominatim.git/commitdiff
enable exact search of GB postcodes in aux postcode data,
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 11 Feb 2012 09:19:42 +0000 (09:19 +0000)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 11 Feb 2012 09:19:42 +0000 (09:19 +0000)
partial search still disabled due to performance problems

lib/lib.php
website/search.php

index 20b1f8ce260418ed8f48f9b00d4fc42dd6c2c5f5..d04c191b31318849c2bea7370ba7a6941d9c65ba 100644 (file)
                        return array(array('lat' => $aNearPostcodes[0]['lat'], 'lon' => $aNearPostcodes[0]['lon'], 'radius' => 0.005));
                }
 
+               return false;
+
+               /* partial search disabled because it sequentially scans placex
+               
                $sSQL = 'select substring(upper(postcode) from \'^[A-Z][A-Z]?[0-9][0-9A-Z]? [0-9]([A-Z][A-Z])$\'),ST_X(ST_Centroid(geometry)) as lon,ST_Y(ST_Centroid(geometry)) as lat from placex where country_code::text = \'gb\'::text AND substring(postcode from \'^([A-Z][A-Z]?[0-9][0-9A-Z]? [0-9])[A-Z][A-Z]$\') = \''.$sPostcodeSector.'\' and class=\'place\' and type=\'postcode\' ';
                $sSQL .= ' union ';
                $sSQL .= 'select substring(upper(postcode) from \'^[A-Z][A-Z]?[0-9][0-9A-Z]? [0-9]([A-Z][A-Z])$\'),ST_X(ST_Centroid(geometry)) as lon,ST_Y(ST_Centroid(geometry)) as lat from gb_postcode where substring(postcode from \'^([A-Z][A-Z]?[0-9][0-9A-Z]? [0-9])[A-Z][A-Z]$\') = \''.$sPostcodeSector.'\'';
                        return array(array('lat' => $fLat, 'lon' => $fLon, 'radius' => $fRadius));
                }
                return false;
-
+               */
                /*
                        $fTotalFac is a suprisingly good indicator of accuracy
                        $iZoom = 18 + round(log($fTotalFac,32));
index 7169c829abba66041c1d7a31c6940e418499be9c..37ddd23c4118c9885cfc54397745f4c7a270bc9a 100755 (executable)
                                }
                        }
                        if ($bSuggestion) $sSuggestion = join(', ',$aSuggestion);
-/*
+
                        // Try and calculate GB postcodes we might be missing
                        foreach($aTokens as $sToken)
                        {
                                        }
                                }
                        }
-*/
 
                        foreach($aTokens as $sToken)
                        {