X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/4b28b4fed469ef5826e61633f82b93a29e1c9b3f..6b89624f339dbf36bd668d83b3d0b12edc62f616:/lib-php/SearchDescription.php diff --git a/lib-php/SearchDescription.php b/lib-php/SearchDescription.php index 089f09c0..d6fa704f 100644 --- a/lib-php/SearchDescription.php +++ b/lib-php/SearchDescription.php @@ -769,18 +769,9 @@ class SearchDescription // if nothing found, search in the interpolation line table $sSQL = 'SELECT distinct place_id FROM location_property_osmline'; $sSQL .= ' WHERE startnumber is not NULL'; - $sSQL .= ' AND parent_place_id in ('.$sRoadPlaceIDs.') AND ('; - if ($iHousenumber % 2 == 0) { - // If housenumber is even, look for housenumber in streets - // with interpolationtype even or all. - $sSQL .= "interpolationtype='even'"; - } else { - // Else look for housenumber with interpolationtype odd or all. - $sSQL .= "interpolationtype='odd'"; - } - $sSQL .= " or interpolationtype='all') and "; - $sSQL .= $iHousenumber.'>=startnumber and '; - $sSQL .= $iHousenumber.'<=endnumber'; + $sSQL .= ' and parent_place_id in ('.$sRoadPlaceIDs.')'; + $sSQL .= ' and ('.$iHousenumber.' - startnumber) % step = 0'; + $sSQL .= ' and '.$iHousenumber.' between startnumber and endnumber'; $sSQL .= $this->oContext->excludeSQL(' AND place_id'); Debug::printSQL($sSQL);