]> git.openstreetmap.org Git - nominatim.git/commitdiff
Allow for tiger addresses when filtering by rank
authorBrian Quinion <brian.quinion@mapquest.com>
Tue, 11 Jun 2013 16:28:30 +0000 (17:28 +0100)
committerBrian Quinion <brian.quinion@mapquest.com>
Tue, 11 Jun 2013 16:28:30 +0000 (17:28 +0100)
website/search.php

index a29cb0cbfb9d77d89ca52c771304949c3eb15541..7cecb9ed5c89443e15f1ee901aa0e942a33bd7e4 100755 (executable)
                                array('amenity', 26, 30, false),
                                array('street', 26, 30, false),
                                array('city', 14, 24, false),
                                array('amenity', 26, 30, false),
                                array('street', 26, 30, false),
                                array('city', 14, 24, false),
-                               array('postalcode', 5, 11, array(5, 11)),
                                array('county', 9, 13, false),
                                array('state', 8, 8, false),
                                array('country', 4, 4, false),
                                array('county', 9, 13, false),
                                array('state', 8, 8, false),
                                array('country', 4, 4, false),
+                               array('postalcode', 5, 11, array(5, 11)),
                                );
        $aStructuredQuery = array();
        $sAllowedTypesSQLList = '';
                                );
        $aStructuredQuery = array();
        $sAllowedTypesSQLList = '';
                                        $sSQL .= "and (placex.rank_address between $iMinAddressRank and $iMaxAddressRank ";
                                        if (14 >= $iMinAddressRank && 14 <= $iMaxAddressRank) $sSQL .= " OR (extratags->'place') = 'city'";
                                        if ($aAddressRankList) $sSQL .= " OR placex.rank_address in (".join(',',$aAddressRankList).")";
                                        $sSQL .= "and (placex.rank_address between $iMinAddressRank and $iMaxAddressRank ";
                                        if (14 >= $iMinAddressRank && 14 <= $iMaxAddressRank) $sSQL .= " OR (extratags->'place') = 'city'";
                                        if ($aAddressRankList) $sSQL .= " OR placex.rank_address in (".join(',',$aAddressRankList).")";
-                                       $sSQL .= ") ";
+                                       $sSQL .= ") UNION select place_id from location_property_tiger where place_id in (".join(',',$aResultPlaceIDs).") ";
+                                       $sSQL .= "and (30 between $iMinAddressRank and $iMaxAddressRank ";
+                                       if ($aAddressRankList) $sSQL .= " OR 30 in (".join(',',$aAddressRankList).")";
+                                       $sSQL .= ")";
                                        if (CONST_Debug) var_dump($sSQL);
                                        $aResultPlaceIDs = $oDB->getCol($sSQL);
                                }
                                        if (CONST_Debug) var_dump($sSQL);
                                        $aResultPlaceIDs = $oDB->getCol($sSQL);
                                }