Вопрос

Currently when I would like to retrieve address for coordinates I make following request as an example:

GET http://api.tiles.mapbox.com/v3/examples.map-zr0njcqy/geocode/-114.0701,51.0495.json

I get address information up to the street level but NO house number. Is there way to retrieve it as well? I think it's such an obvious need and cannot think of any problems extracting this date when you already extracted the rest.

{
    "attribution": {
        "mapbox-places": "<a href='https://www.mapbox.com/about/maps/' target='_blank'>&copy; Mapbox &copy; OpenStreetMap</a> <a class='mapbox-improve-map' href='https://www.mapbox.com/map-feedback/' target='_blank'>Improve this map</a>"
    },
    "query": [
        -114.0701,
        51.0495
    ],
    "results": [
        [
            {
                "id": "street.31973701",
                "lat": 51.0476559,
                "lon": -114.0703042,
                "name": "3 St SW",
                "type": "street"
            },
            {
                "bounds": [
                    -114.36183200000002,
                    50.84361600000001,
                    -113.87432100000002,
                    51.217528999999985
                ],
                "id": "mapbox-places.10008775",
                "lat": 51.03095,
                "lon": -114.108491,
                "name": "Calgary",
                "type": "city"
            },
            {
                "bounds": [
                    -120.00138351899996,
                    48.99667665000002,
                    -110.004763853,
                    60.00042158400004
                ],
                "id": "province.2553712403",
                "lat": 54.872006,
                "lon": -115.003552,
                "name": "Alberta",
                "type": "province"
            },
            {
                "bounds": [
                    -141.00275000000013,
                    40.043430830999895,
                    -47.69751888999983,
                    86.45371111000011
                ],
                "id": "country.1833980151",
                "lat": 76.304456,
                "lon": -105.801333,
                "name": "Canada",
                "type": "country"
            }
        ]
    ]
}
Это было полезно?

Решение

@rbrundritt is correct.

Most mapping applications (Google, Bing, etc) merely interpolate the location when given a street address. They are aware of the starting and ending address on a given block and then make an educated guess as to where the address you are search for is located on that block based on that. They don't actually store the outlines and the addresses of each property.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top