我想获得汽车跑道上各个点的速度限制。但是我得到的不是一个值,而是两个:FROM_REF_SPEED_LIMIT和TO_REF_SPEED_LIMIT。这些是什么意思?没有关于这些属性的文档。如何使用它们来获取速度限制?实际上,这个地方的速度限制是40公里/小时。
import requests
t = [(55.662026, 37.773537),
(55.661813, 37.774049)]
s = ""
for x in t:
s += ' <trkpt lat="' + str(x[0]) + '" lon="' + str(x[1]) + '"/> '
s1 = '<?xml version="1.0"?> <gpx version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/0" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd"> <trk> <trkseg> ' + s +'</trkseg></trk></gpx>'
resp = requests.post('http://rme.cit.api.here.com/2/matchroute.json?routemode=carHOV&attributes=SPEED_LIMITS_FCn%28FROM_REF_SPEED_LIMIT,TO_REF_SPEED_LIMIT%29&app_id=iqZ08RnLQHOCQUYqwZ&app_code=oWWPJv9pVx9Y2DdIBBOA', data=s1)
print(resp.text)
响应:
{
"MapVersion": "LATEST",
"RouteLinks": [
{
"attributes": {
"SPEED_LIMITS_FCN": [
{
"FROM_REF_SPEED_LIMIT": "20",
"TO_REF_SPEED_LIMIT": "60"
}
]
},
"confidence": 0.94,
"functionalClass": 3,
"linkId": -1154810237,
"linkLength": 50.75,
"mSecToReachLinkFromStart": 3501,
"offset": 0.42156,
"shape": "55.66226 37.77328 55.66212 37.77352 55.66195 37.77387"
},
{
"attributes": {
"SPEED_LIMITS_FCN": [
{
"FROM_REF_SPEED_LIMIT": "20",
"TO_REF_SPEED_LIMIT": "60"
}
]
},
"confidence": 0.95,
"functionalClass": 3,
"linkId": -1154810236,
"linkLength": 58.13,
"mSecToReachLinkFromStart": 6403,
"offset": 0.69481,
"shape": "55.66195 37.77387 55.66179 37.77431 55.66168 37.77466"
}
],
"TracePoints": [
{
"confidenceValue": 0.5,
"elevation": 0.0,
"headingDegreeNorthClockwise": 10000.0,
"headingMatched": 131.0,
"lat": 55.662026,
"latMatched": 55.66208,
"linkIdMatched": -1154810237,
"lon": 37.773537,
"lonMatched": 37.77361,
"matchDistance": 10.0,
"matchOffsetOnLink": 0.42156269739402924,
"minError": 7.0,
"routeLinkSeqNrMatched": 0,
"speedMps": 0.0,
"timestamp": 0
},
{
"confidenceValue": 0.58,
"elevation": 0.0,
"headingDegreeNorthClockwise": 10000.0,
"headingMatched": 123.0,
"lat": 55.661813,
"latMatched": 55.66186,
"linkIdMatched": -1154810236,
"lon": 37.774049,
"lonMatched": 37.77411,
"matchDistance": 8.59,
"matchOffsetOnLink": 0.69481133508979,
"minError": 7.0,
"routeLinkSeqNrMatched": 1,
"speedMps": 0.0,
"timestamp": 0
}
],
"Warnings": []
}
答案 0 :(得分:0)
该链接在其地图数据中的每个方向都有两个不同的速度限制。 如果发布的速度限制有误,可以将其报告给https://mapcreator.here.com。现在,我们来看看它。 请检查所附图片。 谢谢!