forked from hans/Nominatim
Merge branch 'observe-bounded-viewbox-in-postcode-search' of https://github.com/mtmail/Nominatim into mtmail-observe-bounded-viewbox-in-postcode-search
This commit is contained in:
@@ -588,6 +588,9 @@ class SearchDescription
|
|||||||
|
|
||||||
$sSQL .= "p.postcode = '".reset($this->aName)."'";
|
$sSQL .= "p.postcode = '".reset($this->aName)."'";
|
||||||
$sSQL .= $this->countryCodeSQL(' AND p.country_code');
|
$sSQL .= $this->countryCodeSQL(' AND p.country_code');
|
||||||
|
if ($this->oContext->bViewboxBounded) {
|
||||||
|
$sSQL .= ' AND ST_Intersects('.$this->oContext->sqlViewboxSmall.', geometry)';
|
||||||
|
}
|
||||||
$sSQL .= $this->oContext->excludeSQL(' AND p.place_id');
|
$sSQL .= $this->oContext->excludeSQL(' AND p.place_id');
|
||||||
$sSQL .= " LIMIT $iLimit";
|
$sSQL .= " LIMIT $iLimit";
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,18 @@ Feature: Searches with postcodes
|
|||||||
| country_code |
|
| country_code |
|
||||||
| li |
|
| li |
|
||||||
|
|
||||||
|
Scenario: Postcode search with bounded viewbox restriction
|
||||||
|
When sending json search query "9486" with address
|
||||||
|
| bounded | viewbox |
|
||||||
|
| 1 | 9.55,47.20,9.58,47.22 |
|
||||||
|
Then result addresses contain
|
||||||
|
| postcode |
|
||||||
|
| 9486 |
|
||||||
|
When sending json search query "9486" with address
|
||||||
|
| bounded | viewbox |
|
||||||
|
| 1 | 5.00,20.00,6.00,21.00 |
|
||||||
|
Then exactly 0 results are returned
|
||||||
|
|
||||||
Scenario: Postcode search with structured query
|
Scenario: Postcode search with structured query
|
||||||
When sending json search query "" with address
|
When sending json search query "" with address
|
||||||
| postalcode | country |
|
| postalcode | country |
|
||||||
|
|||||||
Reference in New Issue
Block a user