当前位置: 首页>>代码示例>>C#>>正文


C# Polyline.ConstructGeodeticLineFromPoints方法代码示例

本文整理汇总了C#中Polyline.ConstructGeodeticLineFromPoints方法的典型用法代码示例。如果您正苦于以下问题:C# Polyline.ConstructGeodeticLineFromPoints方法的具体用法?C# Polyline.ConstructGeodeticLineFromPoints怎么用?C# Polyline.ConstructGeodeticLineFromPoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Polyline的用法示例。


在下文中一共展示了Polyline.ConstructGeodeticLineFromPoints方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateGeodeticLine

        private IPolyline CreateGeodeticLine(IPoint fromPoint, IPoint toPoint, double distance = 0.0)
        {
            var construct = new Polyline() as IConstructGeodetic;
            if (construct == null)
            {
                return null;
            }
            try
            {
                if (distance == 0)
                {
                    construct.ConstructGeodeticLineFromPoints(GetEsriGeodeticType(), fromPoint, toPoint, GetLinearUnit(), esriCurveDensifyMethod.esriCurveDensifyByDeviation, -1.0);
                }
                else
                {
                    var minorPolyline = new Polyline() as IPolyline;
                    minorPolyline.SpatialReference = Point1.SpatialReference;
                    minorPolyline.FromPoint = Point1;
                    minorPolyline.ToPoint = Point3;
                    construct.ConstructGeodeticLineFromDistance(GetEsriGeodeticType(), fromPoint, GetLinearUnit(), distance, GetAzimuth(minorPolyline as IGeometry),
                        esriCurveDensifyMethod.esriCurveDensifyByDeviation, -1.0);
                }
            }
            catch { }

            return construct as IPolyline;
        }        
开发者ID:Esri,项目名称:distance-direction-addin-dotnet,代码行数:27,代码来源:EllipseViewModel.cs

示例2: GetGeoPolylineFromPoints

        /// <summary>
        /// Gets a geodetic polyline from two points
        /// startPoint is where it will restart from
        /// endPoint is where you want it to end for the return of the polyline
        /// </summary>
        /// <param name="startPoint">startPoint is where it will restart from</param>
        /// <param name="endPoint">endPoint is where you want it to end for the return of the polyline</param>
        /// <returns>IPolyline</returns>
        internal IPolyline GetGeoPolylineFromPoints(IPoint startPoint, IPoint endPoint)
        {
            var construct = new Polyline() as IConstructGeodetic;
            if (construct == null)
                return null;

            construct.ConstructGeodeticLineFromPoints(GetEsriGeodeticType(), startPoint, endPoint, GetLinearUnit(), esriCurveDensifyMethod.esriCurveDensifyByDeviation, -1.0);

            return construct as IPolyline;
        }
开发者ID:Esri,项目名称:distance-direction-addin-dotnet,代码行数:18,代码来源:TabBaseViewModel.cs

示例3: CreatePolyline

        private void CreatePolyline()
        {
            try
            {
                if (Point1 == null || Point2 == null)
                    return;

                var construct = new Polyline() as IConstructGeodetic;

                if (construct == null)
                    return;

                if (srf3 == null)
                {
                    // if you don't use the activator, you will get exceptions
                    Type srType = Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment");
                    srf3 = Activator.CreateInstance(srType) as ISpatialReferenceFactory3;
                }

                var linearUnit = srf3.CreateUnit((int)esriSRUnitType.esriSRUnit_Meter) as ILinearUnit;

                construct.ConstructGeodeticLineFromPoints(GetEsriGeodeticType(), Point1, Point2, linearUnit, esriCurveDensifyMethod.esriCurveDensifyByDeviation, -1.0);

                var mxdoc = ArcMap.Application.Document as IMxDocument;
                var av = mxdoc.FocusMap as IActiveView;

                UpdateDistance(construct as IGeometry);
                UpdateAzimuth(construct as IGeometry);

                //var color = new RgbColorClass() { Red = 255 } as IColor;
                AddGraphicToMap(construct as IGeometry);
                ResetPoints();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
开发者ID:Esri,项目名称:distance-direction-addin-dotnet,代码行数:38,代码来源:LinesViewModel.cs


注:本文中的Polyline.ConstructGeodeticLineFromPoints方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。