Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Search with partial postcode confuses namefinder #1249

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 2 comments
Closed

Search with partial postcode confuses namefinder #1249

openstreetmap-trac opened this issue Jul 23, 2021 · 2 comments

Comments

@openstreetmap-trac
Copy link

Reporter: eda[at]waniasset.com
[Submitted to the original trac issue database at 1.47pm, Thursday, 9th October 2008]

Searching for '1 Snowden Street, London EC2A' produces no results, while searching for '1 Snowden Street, London' works.

The EC2A is the first part of a United Kingdom postcode. These postcodes are two words and by convention you can give just the first part to refer to an area. Existing maps such as the 'London A-Z' use the first part of the postcode to disambiguate street names.

In general I suggest that if a search finds no results, but there is something that looks like a postal code at the end of the string, try removing that bit and retrying the search.

@openstreetmap-trac
Copy link
Author

Author: eda[at]waniasset.com
[Added to the original trac issue at 4.38pm, Thursday, 9th October 2008]

Um, actually the '1' at the beginning of the address might need to be removed too. This is another enhancement that should be added: if a search returns no results then strip off the house number at the front and try again.

@openstreetmap-trac
Copy link
Author

Author: david[at]frankieandshadow.com
[Added to the original trac issue at 9.30am, Wednesday, 26th November 2008]

Namefinder was never set up to search for partial postcodes, so it's not surprising it didn't find them. It was doing a search just like any other.

Rather than build this in as a special case, what I've done is to insert nodes into the OSM data for each of the 3,000-odd postcode area centroids, so that a search for them finds those nodes like any other. (This also opens up the possibility of using this data to confine postcode searches to near the centroid - at the moment, a search for XX1 1YY can determine it should look for "Foobar Street, Cambridge" and then finds that street in Cambridge Massachusetts because there happens to be one there too).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant