Jeremy Leys
asked on
How do I translate the Google maps v3 Geocode location_type to a Geocode score 0-9?
Hi,
I am going through the process of converting from Google v2 Maps API to v3 Maps API. A problem that I have encountered is that a Geocode score (0-9) is not used by the V3 API.
Instead the API uses (geometry.location_type) which will return either ROOFTOP, GEOMETRIC_CENTER, RANGE_INTERPOLATED or APPROXIMATE. I can also use (google.maps.GeocoderStatu s.OK) to see if an address can actually be Geocoded.
Our back office systems and IOS App are programmed to work off a (0-9) score I could go through and update them all but that would be rather time consuming. I am wondering if anyone has any idea as to how the string returned by (geometry.location_type) can be converted to a (0-9) score maybe by a case statement or something like that?
If anyone has any better ideas or I am over complicating this please let me know.
I guess what I am looking for is how to interpret the string returned by (geometry.location_type) as a number that resembles the v2 API Geocode score from 1 to 9 as closely as possible. The programming is not hard the interpretation of the string to a Geocode number score is the tricky part.
Thanks to anyone who can help.
I am going through the process of converting from Google v2 Maps API to v3 Maps API. A problem that I have encountered is that a Geocode score (0-9) is not used by the V3 API.
Instead the API uses (geometry.location_type) which will return either ROOFTOP, GEOMETRIC_CENTER, RANGE_INTERPOLATED or APPROXIMATE. I can also use (google.maps.GeocoderStatu
Our back office systems and IOS App are programmed to work off a (0-9) score I could go through and update them all but that would be rather time consuming. I am wondering if anyone has any idea as to how the string returned by (geometry.location_type) can be converted to a (0-9) score maybe by a case statement or something like that?
If anyone has any better ideas or I am over complicating this please let me know.
I guess what I am looking for is how to interpret the string returned by (geometry.location_type) as a number that resembles the v2 API Geocode score from 1 to 9 as closely as possible. The programming is not hard the interpretation of the string to a Geocode number score is the tricky part.
Thanks to anyone who can help.
ASKER
Reference V2 API method:
https://developers.google.com/maps/documentation/geocoding/v2/
0 = Unknown accuracy.
1 = Country level accuracy.
2 = Region (state, province, prefecture, etc.) level accuracy.
3 = Sub-region (county, municipality, etc.) level accuracy.
4 = Town (city, village) level accuracy.
5 = Post code (zip code) level accuracy.
6 = Street level accuracy.
7 = Intersection level accuracy.
8 = Address level accuracy.
9 = Premise (building name, property name, shopping center, etc.) level accuracy.
https://developers.google.com/maps/documentation/geocoding/v2/
0 = Unknown accuracy.
1 = Country level accuracy.
2 = Region (state, province, prefecture, etc.) level accuracy.
3 = Sub-region (county, municipality, etc.) level accuracy.
4 = Town (city, village) level accuracy.
5 = Post code (zip code) level accuracy.
6 = Street level accuracy.
7 = Intersection level accuracy.
8 = Address level accuracy.
9 = Premise (building name, property name, shopping center, etc.) level accuracy.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It's a hack but it works and seems to do the job just fine.
ASKER
https://developers.google.com/maps/documentation/javascript/geocoding
location_type stores additional data about the specified location. The following values are currently supported:
- google.maps.GeocoderLocati
- google.maps.GeocoderLocati
- google.maps.GeocoderLocati
- google.maps.GeocoderLocati