本文整理汇总了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;
}
示例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;
}
示例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);
}
}