【问题标题】:Converting coordinates to longitude and latitude using pyproj使用pyproj将坐标转换为经度和纬度
【发布时间】:2019-05-10 16:10:52
【问题描述】:

我正在尝试使用 Pyproj 将坐标转换为经度和纬度,但是我收到了一个我无法解决的错误:

b'初始化列表中没有参数'

from pyproj import Proj, transform

inProj = Proj(init='epsg:3942')
outProj = Proj(init='epsg:4326')
x1,y1 = 685833.3,6236964.799
x2,y2 = transform(inProj,outProj,x1,y1)
print(x2,y2)

知道如何解决这个问题吗?

非常感谢您的帮助!

【问题讨论】:

  • 错误信息会有所帮助
  • b'初始化列表中没有参数'
  • 你是如何安装模块的?你有什么操作系统?
  • 你检查我的解决方案了吗?

标签: python pyproj


【解决方案1】:

您激活环境,然后在其中安装除 Python 之外的所有内容。但是最新的 proj 构建集 PROJ_LIB 并且您需要在安装后激活环境。最简单的解决方法是在创建环境时请求所有需要的包,然后激活它。

确保你:

  • 您是在环境中安装,而不是在根目录中。
  • 安装 proj(或 pyproj)后激活。
  • 确保您已安装 Cython。

我用 virtualenv for python3.7 创建了一个简单的虚拟环境,你的脚本运行良好。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-02-23
    • 1970-01-01
    • 1970-01-01
    • 2011-02-11
    • 2010-10-11
    • 2013-09-21
    • 1970-01-01
    相关资源
    最近更新 更多