refugerestrooms
refugerestrooms copied to clipboard
State/Province validation in submission form
Scope / difficulty
Add validation for state/province names, to ensure consistent naming of those locations.
I suspect this is something that could be implemented without very much difficult through the geocoder
gem already used in the project. This could be in the form of a drop-down list or a validation/suggesting system. Depending on what is available through geocoder
this could also include city validation, or city suggestions.
Impact
This could improve the accuracy of searches, particularly those covering a wider area. For example, there are restrooms listed in 12 provinces and territories in Canada, but 79 different province and territory names used. It might also make submission of new restrooms easier.
Rationale
Consistent naming of states, provinces, etc, would make some searches more comprehensive, and allow for data from the API to be used for mapping/research (e.g. calculating the number of accessible restrooms per 100,000 people in different American states).
Proposal
Implement a suggestion/autocorrect/drop-down list for state and province locations.
How to actually do this:
I assume it can be implemented through geocoder
but I'm not sure. It's more of a feature request as this time as I'm not sure of the best way to do this. If there is interest I can try to figure out an implementation and submit a PR.
Hi @evanodell, and thank you for the suggestion!
I think this would be solved if we can merge #529 (which is based on #518).
This approach involves sending the restroom's coordinates (which we get from a first round of geocoding) through a second round of "reverse-geocoding" to get the proper address for that location. This should be much more uniform, since we're getting the full text of the address directly from the Google Maps API.
If that sounds good to you, and you're comfortable with developing with Ruby/Rails etc. you could perhaps look over the pull request at #529 and leave any feedback you have.
Thanks again!
- DeeDeeG
Edit: I had two of the PR numbers wrong. Fixed them to point to the correct pull requests.