我的github

What are the best formats to store the CRS information?

In general, Well-Known Text (WKT) or Spatial Reference ID (SRID), such as EPSG codes, are the preferred formats to describe a CRS.

+init=<auth>:<auth_code> should be replaced with <auth>:<auth_code>

The +init=<auth>:<auth_code> syntax is deprecated and will be removed in future versions of PROJ. Also, if you use the +init syntax, you may have problems initializing projections when the other syntax works.

>>> from pyproj import CRS
>>> CRS("ESRI:54009")
<Projected CRS: ESRI:54009>
Name: World_Mollweide
Axis Info [cartesian]:
- E[east]: Easting (metre)
- N[north]: Northing (metre)
Area of Use:
- name: World
- bounds: (-180.0, -90.0, 180.0, 90.0)
Coordinate Operation:
- name: World_Mollweide
- method: Mollweide
Datum: World Geodetic System 1984
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich

>>> CRS("+init=ESRI:54009")
...
pyproj.exceptions.CRSError: Invalid projection: +init=ESRI:54009 +type=crs: (Internal Proj Error: proj_create: cannot expand +init=ESRI:54009 +type=crs)

参考:Gotchas/FAQ — pyproj 3.2.1 documentation (pyproj4.github.io)

参考2:https://blog.csdn.net/MTonj/article/details/116133580

进行坐标系的转换有很多工具,其中比较常用的又Proj.4相关库,如果我们使用Python进坐标转换的话,有高级的Pyproj第三方库可以使用。其文档地址如下:

http://jswhit.github.io/pyproj/

这个库非常简单,我们只需要掌握其中的一个主要函数就可以了:

transform(p1, p2, x, y, z=None, radians=False)

示例:x2, y2, z2 =transform(p1, p2, x1, y1, z1, radians=False)

这个函数表示在p1坐标系和p2坐标系之间进行坐标转换,x1,y1,z1是由p1坐标系定义的坐标,z为高度单位是米。X2,y2,z3是由p2坐标系定义的坐标,它是经过转换过后返回的,默认z1=none。Radians参数表示是否用弧度返回值。
参考:https://blog.csdn.net/sinat_28797501/article/details/75635439

posted on 2021-10-26 10:20  XiaoNiuFeiTian  阅读(716)  评论(0编辑  收藏  举报