欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

解决python gdal投影坐标系转换的问题

程序员文章站 2022-06-20 14:38:28
要将xian80地理坐标系转换成投影坐标系: xian1980 = """ geogcs["gcs_xian_1980", datum["xian_1980",...

要将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库里只能支持高斯-克吕格投影吧。**

以上这篇解决python gdal投影坐标系转换的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。