Interface ILine

Namespace
ESRI.ArcGIS.Geometry
Assembly
ESRI.Server.Geometry.dll

Provides access to members that identify a straight line segment and defines its properties.

[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("FEA4C71C-C5AE-11D0-8307-0000F8034032")]
public interface ILine : ICurve, IGeometry

Remarks


The PutCoords method requires 2 Point objects to construct the line segment.

Line Example

[C#]

    // This example creates a simple line and gets the angle
    // and the start and endpoint.
    public void ShowLineAngle()
    {
        IPoint fromPoint = new PointClass();
        fromPoint.PutCoords(100, 100);




        IPoint toPoint = new PointClass();
        toPoint.PutCoords(150, 150);

        ILine line = new LineClass();

line.PutCoords(fromPoint, toPoint);
double angle = line.Angle;

        //query Coordinats
        IPoint outFromPoint = new PointClass();
        IPoint outToPoint = new PointClass();

line.QueryCoords(outFromPoint, outToPoint);


System.Windows.Forms.MessageBox.Show("From X = " + outFromPoint.X +

", From Y = " + outFromPoint.Y + "\n" +

"To X = " + outToPoint.X +

", To Y = " + outToPoint.Y + "\n" +

"Angle = " + angle);
}




Properties

Angle

The angle between this line and the positive x-axis.

double Angle { get; }

Property Value

double

Remarks


The following Visual Basic example gets the angle of a line and converts it to degrees :

dAngleDegree = (180 * pLine.Angle) / Pi

Where Pi = 4 * Atn(1)

Line Angle Example

Dimension

esriGeometryDimension Dimension { get; }

Property Value

esriGeometryDimension

Envelope

IEnvelope Envelope { get; }

Property Value

IEnvelope

FromPoint

IPoint FromPoint { get; set; }

Property Value

IPoint

GeometryType

esriGeometryType GeometryType { get; }

Property Value

esriGeometryType

IsClosed

bool IsClosed { get; }

Property Value

bool

IsEmpty

bool IsEmpty { get; }

Property Value

bool

Length

double Length { get; }

Property Value

double

SpatialReference

ISpatialReference SpatialReference { get; set; }

Property Value

ISpatialReference

ToPoint

IPoint ToPoint { get; set; }

Property Value

IPoint

Methods

GeoNormalize()

void GeoNormalize()

GeoNormalizeFromLongitude(double)

void GeoNormalizeFromLongitude(double Longitude)

Parameters

Longitude double

GetSubcurve(double, double, bool, out ICurve)

void GetSubcurve(double fromDistance, double toDistance, bool asRatio, out ICurve outSubcurve)

Parameters

fromDistance double
toDistance double
asRatio bool
outSubcurve ICurve

Project(ISpatialReference)

void Project(ISpatialReference newReferenceSystem)

Parameters

newReferenceSystem ISpatialReference

PutCoords(IPoint, IPoint)

Sets this line's endpoints to be 'from' and 'to'.

void PutCoords(IPoint from, IPoint to)

Parameters

from IPoint
to IPoint

Remarks

 

Line PutCoords Example

QueryCoords(IPoint, IPoint)

Copies the endpoints of this line to 'from' and 'to'.

void QueryCoords(IPoint from, IPoint to)

Parameters

from IPoint
to IPoint

Remarks

 

Line QueryCoords Example

QueryEnvelope(IEnvelope)

void QueryEnvelope(IEnvelope outEnvelope)

Parameters

outEnvelope IEnvelope

QueryFromPoint(IPoint)

void QueryFromPoint(IPoint from)

Parameters

from IPoint

QueryNormal(esriSegmentExtension, double, bool, double, ILine)

void QueryNormal(esriSegmentExtension extension, double DistanceAlongCurve, bool asRatio, double Length, ILine normal)

Parameters

extension esriSegmentExtension
DistanceAlongCurve double
asRatio bool
Length double
normal ILine

QueryPoint(esriSegmentExtension, double, bool, IPoint)

void QueryPoint(esriSegmentExtension extension, double DistanceAlongCurve, bool asRatio, IPoint outPoint)

Parameters

extension esriSegmentExtension
DistanceAlongCurve double
asRatio bool
outPoint IPoint

QueryPointAndDistance(esriSegmentExtension, IPoint, bool, IPoint, ref double, ref double, ref bool)

void QueryPointAndDistance(esriSegmentExtension extension, IPoint inPoint, bool asRatio, IPoint outPoint, ref double DistanceAlongCurve, ref double distanceFromCurve, ref bool bRightSide)

Parameters

extension esriSegmentExtension
inPoint IPoint
asRatio bool
outPoint IPoint
DistanceAlongCurve double
distanceFromCurve double
bRightSide bool

QueryTangent(esriSegmentExtension, double, bool, double, ILine)

void QueryTangent(esriSegmentExtension extension, double DistanceAlongCurve, bool asRatio, double Length, ILine tangent)

Parameters

extension esriSegmentExtension
DistanceAlongCurve double
asRatio bool
Length double
tangent ILine

QueryToPoint(IPoint)

void QueryToPoint(IPoint to)

Parameters

to IPoint

ReverseOrientation()

void ReverseOrientation()

SetEmpty()

void SetEmpty()

SnapToSpatialReference()

void SnapToSpatialReference()