我正在使用numpy meshgrIDs,但有时切换坐标系很有用.
由于我不想重新发明轮子,是否有任何库处理:
>转换(笛卡儿,球形,极地,……)
>翻译
>轮换?
http://toblerity.org/shapely/manual.html
仿射变换:http://toblerity.org/shapely/manual.html#affine-transformations
协调转换:http://toblerity.org/shapely/manual.html#other-transformations
示例代码:
from shapely.geometry import Pointfrom functools import partialimport pyprojfrom shapely.ops import transformpoint1 = Point(9.0,50.0)print (point1)project = partial( pyproj.transform,pyproj.Proj(init='epsg:4326'),pyproj.Proj(init='epsg:32632'))point2 = transform(project,point1)print (point2)
您也可以使用ogr库.即
from osgeo import ogrfrom osgeo import osrsource = osr.SpatialReference()source.importFromepsg(2927)target = osr.SpatialReference()target.importFromepsg(4326)transform = osr.Coordinatetransformation(source,target)point = ogr.CreateGeometryFromWkt("POINT (1120351.57 741921.42)")point.transform(transform)print (point.ExportToWkt())
(自http://pcjericks.github.io/py-gdalogr-cookbook/projection.html起)
总结以上是内存溢出为你收集整理的python – 执行坐标系转换的库?全部内容,希望文章能够帮你解决python – 执行坐标系转换的库?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)