- $sSQL .= ") UNION ";
- $sSQL .= " SELECT place_id ";
- $sSQL .= " FROM location_property_osmline ";
- $sSQL .= " WHERE place_id in (".join(',', array_keys($aResultPlaceIDs)).")";
- $sSQL .= " AND startnumber is not NULL AND (30 between $this->iMinAddressRank and $this->iMaxAddressRank)";
+ if ($this->iMaxAddressRank == 30) {
+ $sSQL .= "UNION ";
+ $sSQL .= " SELECT place_id ";
+ $sSQL .= " FROM location_property_osmline ";
+ $sSQL .= " WHERE place_id in (".join(',', array_keys($aResultPlaceIDs)).")";
+ }