]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/lib.php
adapt settings for poldi
[nominatim.git] / lib / lib.php
index 20b1f8ce260418ed8f48f9b00d4fc42dd6c2c5f5..a7c805f7ddc274c55bef435423a8bf949421d480 100644 (file)
@@ -3,7 +3,7 @@
        function fail($sError, $sUserError = false)
        {
                if (!$sUserError) $sUserError = $sError;
-               log('ERROR:'.$sError);
+               error_log('ERROR: '.$sError);
                echo $sUserError."\n";
                exit;
        }
                        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));