Proj4使用學習記錄

摘一段維基百科介紹
PROJ (formerly PROJ.4) is a library for performing conversions between cartographic projections. The library also ships with executables for performing these transformations from the command line.
Proj4是用於製圖投影之間轉換的庫。該庫可以直接在命令行完成不同轉換。

我的理解是不同座標系之間轉換的一個庫。
使用過的有C++版本,python版本;應該還有很多其他版本

一、python 版本安裝
pip install pyproj

二、Python 版本使用

from pyproj import Proj
proj_param = "+proj=utm +ellps=WGS84 +lon_0=116 +lat_0=0.0n +x_0=0 +y_0=0 +units=m +k=1.0"
p = Proj(proj_param)
x,y = p(116,40)
print "%.3f,%.3f"%(x,y)

WGS84座標系下,該經緯度對應的(x,y)
再用兩點間距離計算公式即可

需要注意的是lon_0的取值影響計算結果,一般是取自己所需計算經緯度附近的經度(應該是影響WSG的展開)

參考鏈接:

python版本Proj4 : http://awen300.blog.sohu.com/151691308.html

c++ proj4使用 : https://www.jianshu.com/p/44b1c98e99d3

Proj4通用參數 : https://www.cnblogs.com/oloroso/p/5826829.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章