Python 位置盒距离矩阵API

Python 位置盒距离矩阵API,python,matrix,location,distance,mapbox,Python,Matrix,Location,Distance,Mapbox,我想创建一个距离矩阵,这是我用GoogleMapAPI和下面的代码制作的 url = "http://maps.googleapis.com/maps/api/distancematrix/json?origins={0}&destinations={1}&mode=driving&language=en-EN&sensor=false".format(str(orig_coord),str(dest_coord)) result= simplejson.load

我想创建一个距离矩阵,这是我用GoogleMapAPI和下面的代码制作的

url = "http://maps.googleapis.com/maps/api/distancematrix/json?origins={0}&destinations={1}&mode=driving&language=en-EN&sensor=false".format(str(orig_coord),str(dest_coord))
result= simplejson.load(urllib.urlopen(url))
driving_time = result['rows'][0]['elements'][0]['distance']['value']
现在,我想使用LocationBox制作相同的矩阵。但我不知道如何将距离数据放入数组。以下是输出:

{u'status': 0, u'distances': [{u'topoint': {u'latitude': 40.984818, u'type': 0, u'name': u'POINTB', u'longitude': 29.083635}, u'distance': 12865, u'frompoint': {u'latitude': 41.1, u'type': 0, u'name': u'POINTA', u'longitude': 29.1}}, {u'topoint': {u'latitude': 40.948784, u'type': 0, u'name': u'POINTC', u'longitude': 29.170496}, u'distance': 17809, u'frompoint': {u'latitude': 41.1, u'type': 0, u'name': u'POINTA', u'longitude': 29.1}}, {u'topoint': {u'latitude': 40.948784, u'type': 0, u'name': u'POINTC', u'longitude': 29.170496}, u'distance': 8335, u'frompoint': {u'latitude': 40.984818, u'type': 0, u'name': u'POINTB', u'longitude': 29.083635}}], u'transactionid': u'LBS_98961306'}

如何从该输出中获取距离数据?

通过LocationBox,您是指Mapbox吗?不。LocationBox是另一个应用程序,如Mapbox和Google MapsOkay-您将希望使用
LocationBox
而不是
Mapbox
,来标记该数据。是的,但我无法标记它。为了添加新标签,我应至少拥有1500个声誉:(