Google Maps API - geocoding accuracy chart?

后端 未结 3 2267
逝去的感伤
逝去的感伤 2021-02-20 06:22

Where in the Google Maps API docs can I find a table explaining the accuracy values of Geocode lookups?

Has the range of values changed in between V2 and V3

3条回答
  •  时光取名叫无心
    2021-02-20 07:00

    @Pekka

    I don't know if you saw, but V3 does not include accuracy anymore. It seems that there is a different way though. If you add the results of the address_component elements you get a similar result. Disclaimer: I am not 100% sure about this but it looks like that they included the accuracy this way. I am currently doing some testing is this the way to go.

    Here an example:

    I searched for: 555 Pearl Street, Boulder

    Here the result with Address Level accuracy (8 levels deep).

            [address_component] => Array
                (
                    [0] => SimpleXMLElement Object
                        (
                            [long_name] => 555
                            [short_name] => 555
                            [type] => street_number
                        )
    
                    [1] => SimpleXMLElement Object
                        (
                            [long_name] => Pearl St
                            [short_name] => Pearl St
                            [type] => route
                        )
    
                    [2] => SimpleXMLElement Object
                        (
                            [long_name] => Boulder
                            [short_name] => Boulder
                            [type] => Array
                                (
                                    [0] => locality
                                    [1] => political
                                )
    
                        )
    
                    [3] => SimpleXMLElement Object
                        (
                            [long_name] => Boulder
                            [short_name] => Boulder
                            [type] => Array
                                (
                                    [0] => administrative_area_level_3
                                    [1] => political
                                )
    
                        )
    
                    [4] => SimpleXMLElement Object
                        (
                            [long_name] => Boulder
                            [short_name] => Boulder
                            [type] => Array
                                (
                                    [0] => administrative_area_level_2
                                    [1] => political
                                )
    
                        )
    
                    [5] => SimpleXMLElement Object
                        (
                            [long_name] => Colorado
                            [short_name] => CO
                            [type] => Array
                                (
                                    [0] => administrative_area_level_1
                                    [1] => political
                                )
    
                        )
    
                    [6] => SimpleXMLElement Object
                        (
                            [long_name] => United States
                            [short_name] => US
                            [type] => Array
                                (
                                    [0] => country
                                    [1] => political
                                )
    
                        )
    
                    [7] => SimpleXMLElement Object
                        (
                            [long_name] => 80302
                            [short_name] => 80302
                            [type] => postal_code
                        )
    
                )
    

提交回复
热议问题