Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python OpenStreetMapAPI支持两点数据吗?_Python_Openstreetmap - Fatal编程技术网

Python OpenStreetMapAPI支持两点数据吗?

Python OpenStreetMapAPI支持两点数据吗?,python,openstreetmap,Python,Openstreetmap,最近我想从openstreetmap获取信息。 我想知道两点之间的路线和距离 我可以通过以下操作获得一点数据: get('Osaka Castle') #result https://nominatim.openstreetmap.org/?route=Osaka+Castle&addressdetails=1&country=Japan&format=json&limit=1 {'address': {'country': '日本', 'country_cod

最近我想从openstreetmap获取信息。 我想知道两点之间的路线和距离

我可以通过以下操作获得一点数据:

get('Osaka Castle')

#result
https://nominatim.openstreetmap.org/?route=Osaka+Castle&addressdetails=1&country=Japan&format=json&limit=1
{'address': {'country': '日本', 'country_code': 'jp'},
 'boundingbox': ['20.2145811', '45.7112046', '122.7141754', '154.205541'],
 'class': 'boundary',
 'display_name': '日本',
 'icon': 'https://nominatim.openstreetmap.org/ui/mapicons//poi_boundary_administrative.p.20.png',
 'importance': 0.8710133265462459,
 'lat': '36.5748441',
 'licence': 'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright',
 'lon': '139.2394179',
 'osm_id': 382313,
 'osm_type': 'relation',
 'place_id': 235505229,
 'type': 'administrative'}
def get(地址,verbose=False):

因此,我可以通过以下方式获得信息:

get('Osaka Castle')

#result
https://nominatim.openstreetmap.org/?route=Osaka+Castle&addressdetails=1&country=Japan&format=json&limit=1
{'address': {'country': '日本', 'country_code': 'jp'},
 'boundingbox': ['20.2145811', '45.7112046', '122.7141754', '154.205541'],
 'class': 'boundary',
 'display_name': '日本',
 'icon': 'https://nominatim.openstreetmap.org/ui/mapicons//poi_boundary_administrative.p.20.png',
 'importance': 0.8710133265462459,
 'lat': '36.5748441',
 'licence': 'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright',
 'lon': '139.2394179',
 'osm_id': 382313,
 'osm_type': 'relation',
 'place_id': 235505229,
 'type': 'administrative'}
但是,如果我想找到两点之间的路线或距离。 如何断开url链接

例如,如何断开url链接并从该链接获取信息?

非常感谢