{"id":1259,"date":"2012-03-08T17:50:14","date_gmt":"2012-03-08T17:50:14","guid":{"rendered":"http:\/\/galhano.com\/blog\/?p=1259"},"modified":"2012-03-08T17:50:14","modified_gmt":"2012-03-08T17:50:14","slug":"gmaps-geocoder-accuracy-and-zoom-level","status":"publish","type":"post","link":"http:\/\/galhano.com\/blog\/?p=1259","title":{"rendered":"GMaps Geocoder Accuracy and Zoom level"},"content":{"rendered":"<p>Geo Address Accuracy<\/p>\n<p>The Google Maps API development team released a small\u00a0 improvement to their Geocoding API: the ability to get the response\u2019s accuracy level for a given address.<\/p>\n<p>This feature enables applications to modify their zoom level according to the precision of the address that\u2019s being geocoded, for example, \u201cParis\u201d at the city zoom level, but \u201c1 rue Royale, 75008 Paris\u201d at the much more precise street address zoom level.<\/p>\n<p>What the Google geocoder actually outputs (see reference) is a value between 1 and 8. And the GMaps zoom level is an integer between 1 and 19. So the question is: given a geocoding accuracy, which zoom level should I use to display the place? I didn\u2019t find any answer to that question on the web so I decided to make up my own correspondence between the two scales.<\/p>\n<p>Any such correspondence is bound to be imperfect since two different cities can have very different sizes, however the method usually outputs a decent result.<\/p>\n<p><!--more--><\/p>\n<table summary=\"GGeoAddressAccuracy - Constants\">\n<tbody>\n<tr>\n<th scope=\"col\">Constant<\/th>\n<th scope=\"col\">Description<\/th>\n<\/tr>\n<tr id=\"GGeoAddressAccuracy.0\">\n<td style=\"text-align: center;\"><code title=\"Link to this\"> 0 <\/code><\/td>\n<td>Unknown location.(Since 2.59)<\/td>\n<\/tr>\n<tr id=\"GGeoAddressAccuracy.1\">\n<td style=\"text-align: center;\"><code title=\"Link to this\"> 1 <\/code><\/td>\n<td>Country level accuracy.(Since 2.59)<\/td>\n<\/tr>\n<tr id=\"GGeoAddressAccuracy.2\">\n<td style=\"text-align: center;\"><code title=\"Link to this\"> 2 <\/code><\/td>\n<td>Region (state, province, prefecture, etc.) level accuracy.(Since 2.59)<\/td>\n<\/tr>\n<tr id=\"GGeoAddressAccuracy.3\">\n<td style=\"text-align: center;\"><code title=\"Link to this\"> 3 <\/code><\/td>\n<td>Sub-region (county, municipality, etc.) level accuracy.(Since 2.59)<\/td>\n<\/tr>\n<tr id=\"GGeoAddressAccuracy.4\">\n<td style=\"text-align: center;\"><code title=\"Link to this\"> 4 <\/code><\/td>\n<td>Town (city, village) level accuracy.(Since 2.59)<\/td>\n<\/tr>\n<tr id=\"GGeoAddressAccuracy.5\">\n<td style=\"text-align: center;\"><code title=\"Link to this\"> 5 <\/code><\/td>\n<td>Post code (zip code) level accuracy.(Since 2.59)<\/td>\n<\/tr>\n<tr id=\"GGeoAddressAccuracy.6\">\n<td style=\"text-align: center;\"><code title=\"Link to this\"> 6 <\/code><\/td>\n<td>Street level accuracy.(Since 2.59)<\/td>\n<\/tr>\n<tr id=\"GGeoAddressAccuracy.7\">\n<td style=\"text-align: center;\"><code title=\"Link to this\"> 7 <\/code><\/td>\n<td>Intersection level accuracy.(Since 2.59)<\/td>\n<\/tr>\n<tr id=\"GGeoAddressAccuracy.8\">\n<td style=\"text-align: center;\"><code title=\"Link to this\"> 8 <\/code><\/td>\n<td>Address level accuracy.(Since 2.59)<\/td>\n<\/tr>\n<tr id=\"GGeoAddressAccuracy.9\">\n<td style=\"text-align: center;\"><code title=\"Link to this\"> 9 <\/code><\/td>\n<td>Premise (building name, property name, shopping center, etc.) level accuracy.(Since 2.105)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>more info at:<\/p>\n<p>http:\/\/code.google.com\/intl\/pt-PT\/apis\/maps\/documentation\/javascript\/v2\/reference.html#GGeoAddressAccuracy<\/p>\n<p>http:\/\/blog.mapmyglobe.com\/2007\/08\/29\/gmaps-geocoder-accuracy-and-zoom-level\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Geo Address Accuracy The Google Maps API development team released a small\u00a0 improvement to their Geocoding API: the ability to get the response\u2019s accuracy level for a given address. This feature enables applications to modify their zoom level according to the precision of the address that\u2019s being geocoded, for example, \u201cParis\u201d at the city zoom [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"close","ping_status":"close","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[127,107,126],"tags":[128,199],"class_list":["post-1259","post","type-post","status-publish","format-standard","hentry","category-apis","category-google","category-google-maps-api","tag-api","tag-google-maps-api","author-admin"],"_links":{"self":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1259"}],"version-history":[{"count":1,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1259\/revisions"}],"predecessor-version":[{"id":1260,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1259\/revisions\/1260"}],"wp:attachment":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1259"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}