MGRS错误:字符串错误

问题描述 投票:0回答:1

亲爱的朋友们!

我应该使用MGRS-library,但我坚持这个问题:

import mgrs
m = mgrs.MGRS()
d = m.toLatLon('15TWG0000049776')
print(d)

控制台说:mgrs.core.RTreeError:“Convert_MGRS_To_Geodetic”中出错:MGRS错误:字符串错误

python string
1个回答
0
投票

MGRS库需要字节文字而不是字符串。所以:

d = m.toLatLon('15TWG0000049776'.encode())

© www.soinside.com 2019 - 2024. All rights reserved.