我正在尝试处理一个文本文件,并使用python提取Lat/Lon的所有实例,但自从我使用它以来,已经有这么多年了,我甚至不知道谷歌需要什么帮助。在下面的示例中,我需要每个开始位置的位置&;结束_位置,然后将该数据放入一个单独的文件中
""start_address"" : ""Aberdeen, SD 57401, USA"",
""start_location"" : {
""lat"" : 45.4646954,
""lng"" : -98.48596610000001
},
""steps"" : [
{
""distance"" : {
""text"" : ""207 ft"",
""value"" : 63
},
""duration"" : {
""text"" : ""1 min"",
""value"" : 13
},
""end_location"" : {
""lat"" : 45.4641268,
""lng"" : -98.48597479999999
},
""html_instructions"" : ""Head \u003cb\u003esouth\u003c/b\u003e on \u003cb\u003eCourt St\u003c/b\u003e toward \u003cb\u003e1st Ave SE\u003c/b\u003e"",
""polyline"" : {
""points"" : ""kyntGhpbxQhA?f@?""
},
似乎这可以帮助您:http://fredgibbs.net/tutorials/extract-geocode-placenames-from-text-file.html
正如您在链接中看到的,此人获得了一些与您的格式类似的坐标,我将其粘贴到这里:
然后将其作为JSON处理,如下所示:
注意 此人要求谷歌提供坐标,但这可能会被复制以解决您的问题