You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
import re
# 隐藏坐标字符串
hidden_string = " x3f9a2c8d1e5b7f4c39d52f48n1a2f116d24f20e9b8c7d2e3f9a2c8d1e5b7f4cg9m5h6k2l0j7n8p4qv2wx3r4t5y6u7i8o9p0l1k2m3h4g5f6e7d8c9n4p3o2i1u0y5t4r3w2x1qvx9g8m7h6k5l4j3n2p1o0v9b8e7d6c5f4a3g2d1e0z39°52′ 48″N39d52f48n1a2f116d24f20e9b8c7d2e3f9a2c8d1e5b7f4cg9m5h6k2l0j7n8p4qv2wx3r4t5y6u7i8o9p0l1k2m3h4g5f6e7d8c9n4p3o2i1u0y5t4r3w2x1qvx9g8m7h6k5l4j3n2p1o0v9b8e7d6c5f4a3g2d1e0z116°24′ 20″E39d52f48n1a2f116d24f20e9b8c7d2e3f9a2c8d1e5b7f4cg9m5h6k2l0j7n8p4qv2wx3r4t5y6u7i8o9p0l1k2m3h4g5f6e7d8c9n4p3o2i1u0y5t4r3w2x1qvx9g8m7h6k5l4j3n2p1o0v9b8e7d6c5f4a3g2d1e0z "
# 使用正则表达式提取经纬度坐标
pattern = r ' ( \ d {2} ° \ d {2} ′ \ d {2} ″[NE]) '
matches = re . findall ( pattern , hidden_string )
# 打印解码后的经纬度坐标
if len ( matches ) > = 2 :
latitude = matches [ 0 ]
longitude = matches [ 1 ]
print ( f " 解码后的经纬度坐标是: { latitude } , { longitude } " )
else :
print ( " 未能解码出完整的经纬度坐标。 " )