从epsg官网下载wkt

2023-12-15 15:47:24

定义epsg 编码:

	cgcs2000_prj_code=set([
	4491,
	4492,
	4493,
	4494,
	4495,
	4496,
	4497,
	4498,
	4499,
	4500,
	4501,
	4502,
	4503,
	4504,
	4505,
	4506,
	4507,
	4508,
	4509,
	4510,
	4511,
	4512,
	4513,
	4514,
	4515,
	4516,
	4517,
	4518,
	4519,
	4520,
	4521,
	4522,
	4523,
	4524,
	4525,
	4526,
	4527,
	4528,
	4529,
	4530,
	4531,
	4532,
	4533,
	4534,
	4535,
	4536,
	4537,
	4538,
	4539,
	4540,
	4541,
	4542,
	4543,
	4544,
	4545,
	4546,
	4547,
	4548,
	4549,
	4550,
	4551,
	4552,
	4553,
	4554
	])

下载代码

def getEpsgFromCode( code ):
    print("---------------------------------------------")
    print("epsg:%d"%code)
    print("---------------------------------------------")
    crs = CRS.from_epsg(code)
    prj_name= crs.name;
    print(prj_name)
    #print(crs.to_wkt(pretty=True)) pyproj.enums.WktVersion.WKT2_2019
    prj_wkt =crs.to_wkt(version='WKT1_GDAL',pretty=False)
    print(prj_wkt)
    file_name = './projected/'+str(code) +'.prj'
    print(file_name)
    with open(file_name, 'w') as f:
        f.writelines(prj_wkt)
    return
   
for code in cgcs2000_prj_code:  
    getEpsgFromCode(code)

文章来源:https://blog.csdn.net/kasteluo/article/details/135016280
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。