import pandas as pd
import utm
from tqdm import tqdm
import os
import re
f_n = 'BSD'#文件最终目录波士顿(BSD)地理信息文件
f_path = r'.\DATA\{}'.format(f_n)
f_filelist = os.listdir(f_path)
f_file_n = []
print("开始进行os文件夹遍历=====>>")
for f_filename in f_filelist:
f_filepath = os.path.join(f_path, f_filename)
f_file_n += [f_filepath]
# 定义正则表达式模式
pattern = r"\\([^\\]+)\.csv"
# 遍历f_file_n列表中的每个元素
f_file_nls=[]
for file_path in f_file_n:
# 使用re.search()查找匹配项
match = re.search(pattern, file_path)
# 如果找到匹配项,输出结果
if match:
result = match.group(1)
f_file_nls+=[result]
else:
print("No match found!!")
print("找到文件:", f_file_nls)
print("os路径导入完成=====>>开始批量对地理数据进行投影")
#------------
for f_i in range(len(f_file_nls)):
file_name="{}".format(f_f
UTM地理经纬度向通用平面直角坐标系的投影
于 2023-05-18 10:00:32 首次发布