StarZhai

1.通过地图获取需要地点的经纬度

https://map.bmcx.com/

2.使用geopy计算距离

from geopy.distance import distance

tianjin_coord=(39.06160486473199,117.14604690190004)
others={
        \'gongda\':(39.06694512389212,117.11137719300893),
        \'tjz\':(39.13833650542176,117.21108287572864)
}

for other,coord in others.items():
    d=distance(tianjin_coord,coord).km    #km是单位
    print(other,d)

 

分类:

技术点:

相关文章:

  • 2021-11-27
  • 2021-11-27
  • 2022-01-07
  • 2021-12-03
  • 2021-10-17
猜你喜欢
  • 2021-12-14
  • 2021-12-07
  • 2021-11-27
  • 2021-11-11
  • 2021-11-27
  • 2021-08-28
  • 2021-11-27
相关资源
相似解决方案