1

I'm a customer at another paid geocoding service and evaluate Google's Geocoding API currently. I know there has been many questions already, but I have not found an answer.

Please run this query yourself to understand the problem.

The correct street is "semptstr." runnig the query with a small typo "semstr" will give confusing results.

https://maps.googleapis.com/maps/api/geocode/json?address=semstr. 21 85457 woerth Germany&key={{YOUR KEY}}

If you geocode the address above it does print location_type "ROOFTOP", which I consider to be a direct match.

The address geocodes into following

{
"results" : [
  {
     "address_components" : [
        {
           "long_name" : "21",
           "short_name" : "21",
           "types" : [ "street_number" ]
        },
        {
           "long_name" : "Seestraße",
           "short_name" : "Seestraße",
           "types" : [ "route" ]
        },
        {
           "long_name" : "Rettenbach",
           "short_name" : "Rettenbach",
           "types" : [ "locality", "political" ]
        },
        {
           "long_name" : "Oberpfalz",
           "short_name" : "Oberpfalz",
           "types" : [ "administrative_area_level_2", "political" ]
        },
        {
           "long_name" : "Bayern",
           "short_name" : "BY",
           "types" : [ "administrative_area_level_1", "political" ]
        },
        {
           "long_name" : "Deutschland",
           "short_name" : "DE",
           "types" : [ "country", "political" ]
        },
        {
           "long_name" : "93191",
           "short_name" : "93191",
           "types" : [ "postal_code" ]
        }
     ],
     "formatted_address" : "Seestraße 21, 93191 Rettenbach, Deutschland",
     "geometry" : {
        "location" : {
           "lat" : 49.07218,
           "lng" : 12.45707
        },
        "location_type" : "ROOFTOP",
        "viewport" : {
           "northeast" : {
              "lat" : 49.07352898029149,
              "lng" : 12.4584189802915
           },
           "southwest" : {
              "lat" : 49.07083101970849,
              "lng" : 12.4557210197085
           }
        }
     },
     "partial_match" : true,
     "place_id" : "ChIJHdXdJbnhn0cRgImKyuFq2UM",
     "types" : [ "street_address" ]
  }
],
 "status" : "OK"
}

If you look at the result it says ROOFTOP and there are no fields about the accuracy. I consider ROOFTOP to be an exact match.

Actually it's not even close the location from the query. The postal code 93191 is in a different city, which is around 150 kilometers away.

I'm looking for a relevance parameter. I know APPROXIMATE, INTERPOLATED exists, but in this case it is not displayed in the result.

Such results are not usable for serious production or commercial applications in my case, unless I missed an additional query parameter.

Bounding boxes are not possible either, because I do not have the coordinates of the city. It would make me run the query twice which would result into double costs and double usage.

Comparing the postal codes will just result into very strict behaviour of the function.

So, how can we find out based on the query that the address was not an exact match? Are there any parameters which I missed?

user3606329
  • 2,405
  • 1
  • 16
  • 28
  • You could use components filtering with your query like &components=country:Germany etc. By the way when I try your address in google geocode api I am getting approximate as a result. Are you sure you are passing this address ? – Hakunamatata Jun 23 '16 at 22:56
  • Thanks for your fast reply. Please see: http://i.imgur.com/3AtZ9gT.png - It does show for me "ROOFTOP". I agree with you "APPROXIMATE" should be correct here. – user3606329 Jun 23 '16 at 23:09
  • For me it shows "APPROXIMATE" – Avantika Saini Jun 24 '16 at 11:36
  • Did you really use the same link (see screenshot above)? For you it shows APPROIXIMATE? This is weird, but I think APPROXIMATE would be the correct attribute here since the address does not match too close. For me it displays ROOFTOP. [link](https://maps.googleapis.com/maps/api/geocode/xml?address=semstr. 21 85457 woerth Germany&key={{ YOUR KEY }}) – user3606329 Jun 24 '16 at 12:54

3 Answers3

0

I could not find any official documentation for this but going through some of the answers on this community i found that ROOFTOP means the most accurate result.

According to the answer posted here and here-

The API will return either ROOFTOP, GEOMETRIC_CENTER, RANGE_INTERPOLATED or APPROXIMATE. Rooftop is essentially "dead on" -- the API resolved the address to a building. Other than that, you get varying degrees of "close".

"ROOFTOP" -> 9 [Everything else] -> 4 to 8 (aka the text string might as well read "GARBAGE")

Community
  • 1
  • 1
Avantika Saini
  • 792
  • 4
  • 9
  • That's quite right, it resolves the address to a building in a complete different city without telling so in the return parameters. If I want to check addresses for their existence, the API may just return ROOFTOP of an address in another city. Using components=postal_code:85457, will just limit the result to this postal code. Small mistakes 85455, will result into ZERO_RESULTS. This can't be used for serious commerical apps? Here maps has a relevance parameter (0.00-1) whereas close to 1 is an accurate match with slight modifications. – user3606329 Jun 24 '16 at 13:03
0

A great way to find out if the address was an exact match is to use address verification. There are many services that offer this such as MelissaData, Everything Location, and SmartyStreets.

Here's an example of how the outputs will look from SmartyStreets

A. semstr. 21 85457 woerth Germany

B. semptstr. 21 85457 woerth Germany

Notice how B shows that the address was fully verified and is therefore more correct than A. (Look in the analysis section).

The information on whether or not an address is verified will tell you if the address is an exact match.

Disclaimer: I work for SmartyStreets.

camiblanch
  • 3,866
  • 2
  • 19
  • 31
0

When using the api you can restrict the results to a bound box. That calculation will result in approximate result type. If not found inside the box, no results will be returned. You can also restrict to region :"&region=zyx" You can also restrict it using component. a component can be anything like zip code, postal code. The trick is that when no results are found the api will return the results from the component itself. And i think that is what is happening here. I see your status codes returns "OK" and that tells that the system thinks you are getting the correct results. It could be that you need to change the filtering component to make sure administrative vs political boundaries are distinct.

hering
  • 1,956
  • 4
  • 28
  • 43