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y@OeCSUGg@WSOa@e@W]MK_@i@CMMWIEMWa@m@[QEIICK@QHUTe@n@ELKFa@l@u@t@WNYLYXO?IBGHc@Tc@Ja@@{@Q{@]s@a@kBq@YOcAYs@IU?_@NU@GAu@^a@LSPg@X]^YJc@h@]PKHI@w@n@]h@AXEJMTCZc@|AS`@OVg@j@_Av@{@bA"
解码工作正常:
decoded_pl1 <- decode_pl(pl1)
decoded_pl2 <- decode_pl(pl2)
但是当我尝试获取高程时,我在第二条折线上遇到错误,我无法真正理解它:
# This one works fine
google_elevation(decode_pl(pl1), key=gmap_key)
# This one gives HTTP error 400
google_elevation(decode_pl(pl2), key=gmap_key)
我检查了 lat/lon 数据decode_pl
,它们看起来很好。我实在想不通...
我对一整套坐标进行了完全相同的调用,这是唯一出错的调用。