0911
This commit is contained in:
parent
788b4df64d
commit
f6b75d4f8a
@ -15,6 +15,8 @@ DB_CONFIG = {
|
|||||||
# 高德地图API配置
|
# 高德地图API配置
|
||||||
AMAP_KEY = "ed2d6b26be983e04db8248adfe01ad24"
|
AMAP_KEY = "ed2d6b26be983e04db8248adfe01ad24"
|
||||||
|
|
||||||
|
jumpnum = 0
|
||||||
|
|
||||||
def get_location(address):
|
def get_location(address):
|
||||||
"""通过高德地图API获取地址的经纬度"""
|
"""通过高德地图API获取地址的经纬度"""
|
||||||
try:
|
try:
|
||||||
@ -52,12 +54,18 @@ def update_coordinates():
|
|||||||
records = cursor.fetchall()
|
records = cursor.fetchall()
|
||||||
|
|
||||||
# 修改获取地址的代码
|
# 修改获取地址的代码
|
||||||
|
recordindex = 0
|
||||||
for record in records:
|
for record in records:
|
||||||
address = record.get('站点地址') # 将 '地址' 改为 '站点地址'
|
address = record.get('站点地址') # 将 '地址' 改为 '站点地址'
|
||||||
if not address:
|
if not address:
|
||||||
print(f"记录中没有地址信息:{record}")
|
print(f"记录中没有地址信息:{record}")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if recordindex < jumpnum:
|
||||||
|
print(f"跳过地址: {address}")
|
||||||
|
recordindex += 1
|
||||||
|
continue
|
||||||
|
|
||||||
print(f"正在处理地址: {address}")
|
print(f"正在处理地址: {address}")
|
||||||
lng, lat = get_location(address)
|
lng, lat = get_location(address)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user