]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/reverse.php
Fix wrong variable used with PEAR::IsError()
[nominatim.git] / website / reverse.php
index b053d764657b545fb1f203f9eb33e5d28aa6205e..70779dd714efbe647cbf5d549481e5c16cf78828 100755 (executable)
                        $sSQL .= ' WHERE ST_DWithin('.$sPointSQL.', geometry, '.$fSearchDiam.')';
                        $sSQL .= ' and rank_search != 28 and rank_search >= '.$iMaxRank;
                        $sSQL .= ' and (name is not null or housenumber is not null)';
-                       $sSQL .= ' and class not in (\'waterway\')';
+                       $sSQL .= ' and class not in (\'waterway\',\'railway\',\'tunnel\',\'bridge\')';
                        $sSQL .= ' and (ST_GeometryType(geometry) not in (\'ST_Polygon\',\'ST_MultiPolygon\') ';
                        $sSQL .= ' OR ST_DWithin('.$sPointSQL.', ST_Centroid(geometry), '.$fSearchDiam.'))';
                        $sSQL .= ' ORDER BY ST_distance('.$sPointSQL.', geometry) ASC limit 1';
 //var_dump($sSQL);
                        $aPlace = $oDB->getRow($sSQL);
-                       $iPlaceID = $aPlace['place_id'];
-                       $iParentPlaceID = $aPlace['parent_place_id'];
-                       if (PEAR::IsError($iPlaceID))
+                       if (PEAR::IsError($aPlace))
                        {
                                failInternalError("Could not determine closest place.", $sSQL, $iPlaceID); 
                        }
+                       $iPlaceID = $aPlace['place_id'];
+                       $iParentPlaceID = $aPlace['parent_place_id'];
                }
 
                // The point we found might be too small - use the address to find what it is a child of