Repository navigation
Made point hint matching stricter and avoid problems for short street names - #1406
Conversation
This is a really good change! It was quite hard to get the matching right in some cases with full addresses. |
This reverts commit c36aad7.
boldtrn
left a comment
There was a problem hiding this comment.
I really like the approach but I think we should add some more common road names to the overwrite logic just to cover some more cases, WDYT?
| put("straße", ""); | ||
| put("strasse", ""); | ||
| put("st.", ""); // saint vs. street | ||
| put("street", ""); |
There was a problem hiding this comment.
Rewriting to an empty string could be problematic in some more exotic cases. But I think the alternatives also introduce potential errors, so this is probably the best approach.
I miss a couple of strings here (not sure if they get abbreviated though, so maybe it's better not to add them?):
strada (e.g. Strada Provinciale 209)
via (e.g. Via Fosso Ancaiano)
calle (Calle el Dr. Mabuse)
plaza (Plaza de la Bámbola)
Some English ones:
lane
ln. (short form of lane)
place
pl.
track
tr.
pathway
path
crescend
cres
cres.
parade
pde
I found a great resource for street abbreviations in English here. An even longer list can be found here.
There was a problem hiding this comment.
Yes :)
We could even extract them from OSM:
https://github.com/komoot/photon/pull/46/files#diff-751e12c3a9da7a1987a479baab0ff97c
https://github.com/karussell/languator
But probably we should not overcomplicate things here and improve this just a bit.
Another question is how we handle those common words if they are part of the street name like with "Hauptstraße" we can't just remove them because e.g. st could be a part of a street name without the street-meaning
There was a problem hiding this comment.
Another question is how we handle those common words if they are part of the street name like with "Hauptstraße" we can't just remove them because e.g. st could be a part of a street name without the street-meaning
Yes I think we cannot really do anything about these without introducing bigger errors as well.
But probably we should not overcomplicate things here and improve this just a bit.
I know that English speakers love abbreviations, so I think fixing the English abbreviations is quite important. The names I mentioned above are pretty common, the ones in the first link are quite common as well, the second link contains more uncommon ones as well. But Google Maps loves to abbreviate them in english speaking countries as well, most abbreviations are rather short like Drive and Dr, so the dr will be removed anyway. So I think if anyone tries to combine the point_hint with GMaps Geocoding, this will become an issue.
| "sq.", "square", | ||
| "tr.", "track", | ||
| "via")) { | ||
| put(remove, ""); |
There was a problem hiding this comment.
Do you think this is now sufficient and we could add new stuff if required later? I think adding all these words does not necessarily improve the result. We probably could try an automated way to find areas where our snapping is not optimal now. E.g. pick a location and 4 close streets and pick one street to see if the others get rejected or similar.
There was a problem hiding this comment.
Ok sure, we can always add more later and see how we go :).
Personally, I would add:
crescend, cres, cres., parade, pde, pde., boulevard, bvd, bvd.
These are really common ones. In GB there are many Close, Cl, which could make sense to add as well. Probably we just need to see how we go.
There was a problem hiding this comment.
Have added a few as requested :)
There was a problem hiding this comment.
Thanks :). Let's see how we go then :)
| "sq.", "square", | ||
| "tr.", "track", | ||
| "via")) { | ||
| put(remove, ""); |
There was a problem hiding this comment.
Ok sure, we can always add more later and see how we go :).
Personally, I would add:
crescend, cres, cres., parade, pde, pde., boulevard, bvd, bvd.
These are really common ones. In GB there are many Close, Cl, which could make sense to add as well. Probably we just need to see how we go.
The biggest change is that with this PR we require now the input to be just the street and not the full address to improve matching. Was able to increase the JARO_WINKLER_ACCEPT_FACTOR from under 0.8 to 0.9
Also it: