解决python gdal投影坐标系转换的问题
作者:ShawDa 时间:2021-11-02 12:14:55
要将xian80地理坐标系转换成投影坐标系:
xian1980 = """
GEOGCS["GCS_Xian_1980",
DATUM["Xian_1980",
SPHEROID["Xian_1980",6378140.0,298.257]],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]]"""
prjreference = 'PROJCS["Xian_1980_3_Degree_GK_Zone_37",GEOGCS["GCS_Xian_1980",DATUM["D_Xian_1980",SPHEROID["Xian_1980",6378140.0,298.257]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Gauss_Kruger"],PARAMETER["False_Easting",37500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",111.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]'
转换后会报错:
latlong = transform.TransformPoint(x,y)
File "/usr/lib/python3/dist-packages/osgeo/osr.py", line 711, in TransformPoint
return _osr.CoordinateTransformation_TransformPoint(self, *args)
NotImplementedError: Wrong number or type of arguments for overloaded function 'CoordinateTransformation_TransformPoint'.
Possible C/C++ prototypes are:
OSRCoordinateTransformationShadow::TransformPoint(double [3])
OSRCoordinateTransformationShadow::TransformPoint(double [3],double,double,double)
**想想之前也没发现过这个问题呀,最后发现之前投影坐标系:**
'PROJCS["Xian_1980_3_Degree_GK_Zone_37",GEOGCS["GCS_Xian_1980",DATUM["D_Xian_1980",SPHEROID["Xian_1980",6378140.0,298.257]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",37500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",111.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]'
**不是高斯-克吕格投影而是横轴墨卡托,我想原因可能是gdal库里只能支持高斯-克吕格投影吧。**
来源:https://blog.csdn.net/sinat_36811967/article/details/79126529
标签:python,gdal,投影,坐标
0
投稿
猜你喜欢
Ubuntu下使用python读取doc和docx文档的内容方法
2021-04-09 03:42:30
win2003上安装SQL2000时CD-KEY(序列号)无法验证解决方法
2024-01-15 16:36:19
asp简单可逆运算字符串加密解密函数
2010-05-04 16:42:00
用SQL建立索引的方法步骤
2024-01-21 20:43:43
一篇文章搞懂Python Unittest测试方法的执行顺序
2023-11-01 09:38:01
python中验证码连通域分割的方法详解
2022-09-30 11:04:00
利用python数据分析处理进行炒股实战行情
2022-01-30 10:28:29
python3.3教程之模拟百度登陆代码分享
2023-08-02 23:08:23
python函数不定长参数使用方法解析
2022-07-05 23:47:20
python代码 输入数字使其反向输出的方法
2023-12-15 00:01:22
初探TensorFLow从文件读取图片的四种方式
2021-08-06 06:04:34
python 动态调用函数实例解析
2021-03-11 09:31:41
打包python 加icon 去掉cmd黑窗口方法
2021-12-01 15:26:38
深入理解Python分布式爬虫原理
2023-02-06 14:33:30
ASP连接MySQL数据库的方法
2010-03-14 11:25:00
JavaScript实现网页跨年倒计时
2024-06-14 18:24:43
MySQL命令无法输入中文问题的解决方式
2024-01-15 19:29:54
SQL 截取字符串应用代码
2024-01-21 08:53:14
python中@property的作用和getter setter的解释
2022-08-14 21:12:39
python结合shell查询google关键词排名的实现代码
2023-10-11 21:28:47