-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Our address sorting is bad #6475
Comments
Related issues:
The relevant code is https://github.com/DemocracyClub/uk-geo-utils/blob/master/uk_geo_utils/helpers.py#L277 Its not awful, but I think in order to sort all those cases correctly without breaking loads of other stuff, you need to move from a model where address is stored as single string to a model where you keep the addresses broken down into parts, sort them and then concatenate all the bits together for display. This is further complicated by the fact there are 2 different formats depending on whether it is a PAF address or Local Auth address. |
Thanks @chris48s |
Just came across https://github.com/openvenues/libpostal (it has python bindings - https://github.com/openvenues/pypostal and a postgresql extension https://github.com/pramsey/pgsql-postal ) and thought back to this thread. I suspect it is imperfect, but I wonder if using that to:
might be a way to improve on my crude attempt to do that without eating the entire elephant of the "proper" solution. |
Addresses which aren't a simple [n] [street name] get pushed to the bottom of the list. This is bad for users, who expect 32A to come between 32 and 33.
The text was updated successfully, but these errors were encountered: