首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >v7接口缺少地区数据

v7接口缺少地区数据
EN

Stack Overflow用户
提问于 2020-09-23 01:34:11
回答 1查看 33关注 0票数 0

我注意到v7接口不会返回“地区”数据。至少对于我尝试过的revgeocodelookup端点不是这样的。如何获取此数据?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-09-23 17:29:41

获得一个点的“区”取决于行政区划在那个地方的工作方式。如果国家使用“区”作为行政区划,您将在响应中得到它。例如。

代码语言:javascript
复制
https://revgeocode.search.hereapi.com/v1/revgeocode?apikey={{apiKey}}&at=52.5,13.4

响应:

代码语言:javascript
复制
{
    "items": [
        {
            "title": "Neuenburger Straße 21, 10969 Berlin, Deutschland",
            "id": "here:af:streetsection:2wUtzSvdGL0dYtTkTD2UxB:CgcIBCCirOZQEAEaAjIx",
            "resultType": "houseNumber",
            "houseNumberType": "PA",
            "address": {
                "label": "Neuenburger Straße 21, 10969 Berlin, Deutschland",
                "countryCode": "DEU",
                "countryName": "Deutschland",
                "stateCode": "BE",
                "state": "Berlin",
                "countyCode": "B",
                "county": "Berlin",
                "city": "Berlin",
                "district": "Kreuzberg",
                "street": "Neuenburger Straße",
                "postalCode": "10969",
                "houseNumber": "21"
            },
            "position": {
                "lat": 52.49991,
                "lng": 13.39976
            },
            "access": [
                {
                    "lat": 52.50002,
                    "lng": 13.39988
                }
            ],
            "distance": 19,
            "mapView": {
                "west": 13.39545,
                "south": 52.49947,
                "east": 13.40042,
                "north": 52.5007
            }
        }
    ]
}

在县/公社为行政区划的地方,县名称将在地区对象中返回

代码语言:javascript
复制
https://revgeocode.search.hereapi.com/v1/revgeocode?apikey={{apiKey}}&at=-32.86558,-71.23689

响应:

代码语言:javascript
复制
{
    "items": [
        {
            "title": "Sport Club",
            "id": "here:pds:place:15266jm4-24c37d92509f4f1aa61a79c1c7979731",
            "resultType": "place",
            "address": {
                "label": "Sport Club, Calle Los Queltehues, 2260000 Quillota, Valparaíso, Chile",
                "countryCode": "CHL",
                "countryName": "Chile",
                "stateCode": "VS",
                "state": "Valparaíso",
                "county": "Quillota",
                "city": "Quillota",
                "district": "Quillota",
                "street": "Calle Los Queltehues",
                "postalCode": "2260000"
            },
            "position": {
                "lat": -32.86571,
                "lng": -71.23687
            },
            "access": [
                {
                    "lat": -32.86571,
                    "lng": -71.23687
                }
            ],
            "distance": 15,
            "categories": [
                {
                    "id": "100-1000-0000",
                    "name": "Restaurante",
                    "primary": true
                }
            ]
        }
    ]
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64014925

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档