OpenTripPlanner-for-Android
OpenTripPlanner-for-Android copied to clipboard
Organize and uniform geocoding results
Android Geocoder results are completely organized by fields and also MapQuest can be with the parameter addressDetails, for example http://open.mapquestapi.com/nominatim/v1/search?format=xml&q=Maria%20Pita&addressdetails=1.
The only provider which is not organized by fields afaik is Google Places, but results seem to be very consistent https://maps.googleapis.com/maps/api/place/textsearch/xml?query=Maria%20Pita&key=AIzaSyC8Vzn5Fi8IzqA_5B2ay_STGTUrhwlWnpw, so we can use all until the last comma (I think that is counterproductive for our app to display the country) and we will get a correct address.
The point is that with the actual process of retrieve the display_name field in a request for nominatim we can get the feature name which may be the name of a hotel and will be totally incorrect. Also zip code and that kind of data I think that should be discarded.
@barbeau at this point I'm not quite sure if will be best to supply a feature name or just addresses after the discussion in #357, I even think that is better to have the feature name.
Also with the detailed address parameter, addresses details don't seem very easy to parse, specifically to get the feature name, because there isn't such element, instead there are
@vreixo by feature name do you mean "street"? If so, can you get the OSM tagging for the way via OTP API?
I mean the type of facility that is on that address, for example "McDonals", "Tampa Hospital", "Library", etc. In Google Places you can see "McDonalds" as name and in another field the address "Independence street, 5, Michigan", in Nominatim name and address are together like "McDonalds, Independence street, 5, Michigan".
Ah, OK. Yes, not much we can do about that.