HERE API 是否提供 GSM 小区信息的三角测量?

Does the HERE API provide triangulation of GSM cell info?

目前正在测试 HERE API 在 GSM 定位应用程序中的使用。似乎没有发生小区三角测量,但为什么可以将多个 GSM 数据点传递到 API?

我尝试传递最多 7 个 GSM 小区位置,但估计的位置总是以其中一个小区结束,而不接近设备的实际位置。

###############################################################################
# cell tower info for HERE API
###############################################################################
here_cell_0 = {"cid": 17078,
          "lac": 314,
          "mcc": 234,
          "mnc": 15,
          "rxlevel": -52,
          "nmr": [{"bsic": 18, "bcch": 25, "rxlevel": -52}]}

here_cell_1 = {"cid": 13491,
          "lac": 165,
          "mcc": 234,
          "mnc": 15,
          "rxlevel": -61,
          "nmr": [{"bsic": 27, "bcch": 33, "rxlevel": -61}]}

here_cell_2 = {"cid": 16191,
          "lac": 316,
          "mcc": 234,
          "mnc": 15,
          "rxlevel": -62,
          "nmr": [{"bsic": 38, "bcch": 26, "rxlevel": -62}]}

here_cell_3 = {"cid": 13492,
          "lac": 165,
          "mcc": 234,
          "mnc": 15,
          "rxlevel": -65,
          "nmr": [{"bsic": 8, "bcch": 30, "rxlevel": -65}]}

here_cell_4 = {"cid": 18119,
          "lac": 316,
          "mcc": 234,
          "mnc": 15,
          "rxlevel": -65,
          "nmr": [{"bsic": 35, "bcch": 36, "rxlevel": -65}]}

here_cell_5 = {"cid": 13564,

          "lac": 165,
          "mcc": 234,
          "mnc": 15,
          "rxlevel": -66,
          "nmr": [{"bsic": 37, "bcch": 29, "rxlevel": -66}]}

here_cell_6 = {"cid": 17079,
          "lac": 314,
          "mcc": 234,
          "mnc": 15,
          "rxlevel": -69,
          "nmr": [{"bsic": 41, "bcch": 37, "rxlevel": -69}]}

ALL_CELLS_HERE = [here_cell_0,here_cell_1,here_cell_2,here_cell_3,here_cell_4,here_cell_5,here_cell_6]

###############################################################################
# HERE API data
###############################################################################
# API KEY
APP_ID = ""
APP_CODE = ""
APP_ID_RESOURCE = "app_id=" + APP_ID
APP_CODE_RESOURCE = "app_code=" + APP_CODE

# position API
POS_BASE_URL = "https://pos.api.here.com/positioning/v1/locate"
POS_URL = POS_BASE_URL + "?" + APP_ID_RESOURCE + "&" + APP_CODE_RESOURCE

###############################################################################
# get positions of cells and estimated position
###############################################################################
CELL_COORDINATES = []

# get cell tower postions
for CELL in ALL_CELLS_HERE:
    POST_BODY = {"gsm": [CELL]}
    headers = {'Content-type': 'application/json'}
    r = requests.post(url = POS_URL, json = POST_BODY, headers=headers)
    if( r.status_code == 200):
        data = r.json()
        print(data)
        CELL_COORDINATES.append(data)
    else:
        print("Request failed, status code: " + str(r.status_code) )

# get estimated position HERE API
POST_BODY = {"gsm": ALL_CELLS_HERE}
headers = {'Content-type': 'application/json'}
r = requests.post(url = POS_URL, json = POST_BODY, headers=headers)
if( r.status_code == 200):
    ESTIMATED_COORDINATE_HERE_API = r.json()
    print(ESTIMATED_COORDINATE_HERE_API)
else:
    print("Request failed, status code: " + str(r.status_code) )

目前我是这样称呼API的。

我认为您列出的相邻单元格有误。它们应该在 "nmr" 内的主单元格之后。如果您的服务(主)单元格为 17078,格式应如下:

{
  "gsm": [{
  "mcc": 234,
  "mnc": 15,
  "lac": 314,
  "cid": 17078,
  "rxlevel": -52,
  "nmr": [
    {"bsic": 27, "bcch": 33, "rxlevel": -61,"lac":165,"cid":13491},
    {"bsic": 38, "bcch": 26, "rxlevel": -62,"lac":316,"cid":16191},
    {"bsic": 8, "bcch": 30, "rxlevel": -65,"lac":165,"cid":13492},
    {"bsic": 35, "bcch": 36, "rxlevel": -65,"lac":316,"cid":18119},
    {"bsic": 37, "bcch": 29, "rxlevel": -66,"lac":165,"cid":13564},
    {"bsic": 41, "bcch": 37, "rxlevel": -69,"lac":314,"cid":17079}
  ]
  }]
}

列出格式here