坐标转换

近两天需要把平面坐标转换为标准的WGS84后使用百度逆地址编码
搜索出资料记录一下

  1. 类库 程序ProjNet4GeoAPI
    static void PtsToPts(ICoordinateSystem fromCS, ICoordinateSystem toCS,List<double[]> pts, out List<double[]> results)
   {
        CoordinateTransformationFactory ctfac = new CoordinateTransformationFactory();
        ICoordinateTransformation trans = ctfac.CreateFromCoordinateSystems(fromCS, toCS);
        results = trans.MathTransform.TransformList(pts);
   }
 static void Main(string[] args)
   {
        string bj1954Lcc= "……"; //见上文
        IProjectedCoordinateSystem fromCS = CoordinateSystemWktReader.Parse(bj1954Lcc) as IProjectedCoordinateSystem;
        GeographicCoordinateSystem toCS = GeographicCoordinateSystem.WGS84;

        double[] xPts = new double[4] { 20634500, 20635500, 20634500, 20635500 };
        double[] yPts = new double[4] { 4660000, 4660000, 4659000, 4659000 };

        List<double[]> pts = new List<double[]>();
        for (int i = 0; i < 4; i++)
        {
            double[] xy = new double[] { xPts[i], yPts[i] };
            pts.Add(xy);

        List<double[]> results = new List<double[]>();
        PtsToPts(fromCS, toCS, pts, out results);

        foreach (double[] result in results)
        {
            Console.WriteLine("{0},{1}", result[0], result[1]);
        }
   }
  1. 百度地图逆地址编码
    百度逆地理编码服务

  2. GDAL相关
    ...and...You can find the GDAL API documentation here
    There is an GDAL API tutorial here
    The OGR API documentation is here
    The OSR API documentation is here
    All the links you need for GDAL can be reached from http://www.gdal.org/
    All the links you need for OGR/OSR can be reached from http://www.gdal.org/ogr/
    下载编译后的GDAL地址
    参考资料:
    [类库地址,包含GeoAPI、proj4net、ProjNet4GeoAPI]
    (https://pan.baidu.com/s/1skMrbHF)
    DotSpatial.Projections Vs. ProjNET4GeoAPI
    星星分享

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的阅读 13,566评论 5 6
  • Pathname lookup in Linux. This write-up is based on three...
    朔飞阅读 706评论 0 0
  • 这是一篇关于火车的文章。 2017年,24周岁的我,看待很多事物都发生了本质性的变化!现以火车来说明: 从最初和爸...
    正伊儿阅读 741评论 2 2
  • 旧时的院里 梧桐总开的快 四季有悲喜 来往无纷争 人们提着酒壶和曲高歌 那时的雨很大 酒很烈 猫狗也怕人 后来岁...
    梓熙静妍阅读 567评论 0 2
  • 小和尚最近可失落可失落 说自己觉得好难过好难过 大和尚敲了敲他的头 傻孩子有什么好纠结 日子不过就是 吃完饭刷锅 ...
    整个宇宙我最帅阅读 259评论 0 1