我的github
posts - 3243,  comments - 42,  views - 158万

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   XiaoNiuFeiTian  阅读(756)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
历史上的今天:
2020-10-26 ArcObjects
2020-10-26 Dojo是什么?
2020-10-26 百度地图是什么坐标系?
2020-10-26 高德地图API
2020-10-26 地理POI数据爬取-以百度地图为例
2016-10-26 TurtleBot教程
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示