首页 > 解决方案 > Here-API:反向地理编码中的负距离

问题描述

我正在使用来自 HERE-API 的(多请求)反向地理编码并请求地标(最后我想知道某个位置是否在水面之上)。一切都很好,但我经常得到与地标的负距离(特别是当地标是河流时):

{'Distance': -86.3,
 'Location': {'Address': {'AdditionalData': [{'key': 'CountryName',
                                              'value': 'United States'},
                                             {'key': 'StateName',
                                              'value': 'New York'}],
                          'Country': 'USA',
                          'Label': 'NY, United States',
                          'State': 'NY'},
              'DisplayPosition': {'Latitude': 40.75038, 'Longitude': -73.95749},
              'LocationId': 'NT_AkVytIiMG.HuEjq23NLorC',
              'LocationType': 'river',
              'MapReference': {'CountryId': '21000001',
                               'PlaceId': '35543547',
                               'StateId': '21010819'},
              'MapView': {'BottomRight': {'Latitude': 40.68625,
                                          'Longitude': -73.79247},
                          'TopLeft': {'Latitude': 40.8145,
                                      'Longitude': -74.01498}},
              'Name': 'East River'},
 'MatchLevel': 'landmark',
 'MatchQuality': {'Country': 1.0, 'Name': 1.0, 'State': 1.0},
 'Relevance': 1.0}

有人能告诉我应该如何解释这个距离吗?

标签: here-api

解决方案


反向地理编码器管理区域结果的距离是从提供的点到多边形边界计算的。因此,当指定点在区域内时,距离为负数。这与具有里程碑意义的结果一致。当 gen<6 时,管理区域结果的距离为从指定点到区域中心的距离。


推荐阅读