首页 > 其他 > 详细

原始线要素类为地理坐标系,如何获取以米为单位的距离?

时间:2016-02-23 11:12:56      阅读:341      评论:0      收藏:0      [点我收藏+]

可以使用IPolycurveGeodetic.get_LengthGeodetic();方法,将要量测的IPolyline转为IPolycurveGeodetic即可。
测试代码如下:

            IPolyline polyline = feature.Shape as IPolyline;
         
            IPolycurveGeodetic polycurve = polyline as IPolycurveGeodetic;
            ILinearUnitEdit linearUnitEdit = new LinearUnitClass();

            //Define the properties for the linear unit 
            object name = Meter;
            object alias = Meter;
            object abbreviation = M;
            object remarks = Meter is the linear unit;
            object metersPerUnit = 1;
            linearUnitEdit.Define(ref name, ref alias, ref abbreviation, ref remarks, ref metersPerUnit);
            ILinearUnit pLU = linearUnitEdit as ILinearUnit;

            double distance = polycurve.get_LengthGeodetic(esrType.esriGeodeticTypeGeodesic,pLU);

 

原始线要素类为地理坐标系,如何获取以米为单位的距离?

原文:http://www.cnblogs.com/gisoracle/p/5209141.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!