komoot/photon — pull request #128 by Svantulden (2014-12-22 08:19:39+00:00)
Title: Remove street duplicates for NL postcodes

Hi,

This PR could help people who use Photon to search for Dutch addresses. It has a specific check for NL postcodes, that results in removing duplicate street names. Doing so solves this problem:

![image](https://cloud.githubusercontent.com/assets/7554912/5522146/6b5649cc-89b3-11e4-85cc-0fceac5a2075.png)

Here we get 5 of the same results for the query "veldsingel", which could block other queries called "veldsingel" in another town/city. These are all part of the same street, but don't get filtered automatically by the `removeStreetDuplicates` function. This is because it assumes a postcode only consists of numbers, while in The Netherlands, it consists of 4 numbers and 2 letters. The same street can have the same numbers but different letters.

This extra check, ensures we only get one street result per street, effectively removing the duplicates based on it having the same 4 numbers and having the same streetname.