from hk80 import LatLon, HK80
import os
import pandas as pd
os.chdir('D:\\workspace\\')
hk80file='CoorTrans.csv'
hk80f=pd.read_csv(hk80file)
output=[]
for i in range(len(hk80f)):
filename=hk80f['CoordinateID'][i]
northing=float(hk80f.iloc[i,1])
easting=float(hk80f.iloc[i,2])
hku=HK80(northing, easting).to_wgs84()
wgs84x=hku.x
wgs84y=hku.y
output.append([filename, wgs84x, wgs84y])
outputdf=pd.DataFrame(output, columns=['CoordinateID', 'WGS84X', 'WGS84Y'])
outputdf.to_csv('transformed.csv')
HK80坐标转为WGS84坐标python
最新推荐文章于 2022-11-09 09:58:42 发布