ICurve Interface

Provides access to properties and methods of all 1 dimensional curves (polylines, segments, boundaries of polygons, etc.).

Description

A curve is an abstract one-dimensional geometry between specific From and To points. A curve can be composed of a single Segment, a Path of connected segments, or a Polycurve containing many paths of segments. The properties and methods of the curve allow the user to query information about the entire curve or points along the curve. The distance along the curve can be specified in a fixed unit of measure or as a ratio of the Length of the curve. The user can obtain information about Tangents, Normals, Subcurves, and Points along the curve.

Members

Name Description
Read-only property Dimension The topological dimension of this geometry.
Read-only property Envelope Creates a copy of this geometry's envelope and returns it.
Read/write property FromPoint The 'from' point of the curve.
Read-only property GeometryType The type of this geometry.
Method GeoNormalize Shifts longitudes, if need be, into a continuous range of 360 degrees.
Method GeoNormalizeFromLongitude Normalizes longitudes into a continuous range containing the longitude. This method is obsolete.
Method GetSubcurve Extracts a portion of this curve into a new curve.
Read-only property IsClosed Indicates if 'from' and 'to' points (of each part) are identical.
Read-only property IsEmpty Indicates whether this geometry contains any points.
Read-only property Length The length of the curve.
Method Project Projects this geometry into a new spatial reference.
Method QueryEnvelope Copies this geometry's envelope properties into the specified envelope.
Method QueryFromPoint Copies this curve's 'from' point to the input point.
Method QueryNormal Constructs a line normal to a curve from a point at a specified distance along the curve.
Method QueryPoint Copies to outPoint the properties of a point on the curve at a specified distance from the beginning of the curve.
Method QueryPointAndDistance Finds the point on the curve closest to inPoint, then copies that point to outPoint; optionally calculates related items.
Method QueryTangent Constructs a line tangent to a curve from a point at a specified distance along the curve.
Method QueryToPoint Copies the curve's 'to' point into the input point.
Method ReverseOrientation Reverses the parameterization of the curve ('from' point becomes 'to' point, first segment becomes last segment, etc).
Method SetEmpty Removes all points from this geometry.
Method SnapToSpatialReference Moves points of this geometry so that they can be represented in the precision of the geometry's associated spatial reference system.
Read/write property SpatialReference The spatial reference associated with this geometry.
Read/write property ToPoint The 'to' point of the curve.

ICurve.FromPoint Property

The 'from' point of the curve.

Public Property FromPoint As IPoint
public IPoint FromPoint {get; set;}

Description

Returns or Sets the FromPoint of the first segment of the first part of the curve. While the curve may be composed of many parts and segments each with their own FromPoint, each curve only has a single From Point.

Remarks

FromPoint Example

ICurve.GetSubcurve Method

Extracts a portion of this curve into a new curve.

Public Sub GetSubcurve ( _
    ByVal fromDistance As Double, _
    ByVal toDistance As Double, _
    ByVal asRatio As Boolean, _
    ByRef outSubcurve As ICurve _
)
public void GetSubcurve (
    double fromDistance,
    double toDistance,
    bool asRatio,
    ref ICurve outSubcurve
);

Description

Gets the subcurve between the specified points along the original curve and creates a new curve. The elements in the new subcurve are the same type and have the same properties as the elements of the original curve. Which means if:

Input Geometry Output Geometry
Polygon Polyline
Polyline Polyline
Ring Path
Path Path
Segment Segment

If the input geometry is a polygon, you may want to use IRing::GetSubCurveEx which has more capabilities.

Remarks

Subcurve Example

ICurve.IsClosed Property

Indicates if 'from' and 'to' points (of each part) are identical.

Public ReadOnly Property IsClosed As Boolean
public bool IsClosed {get;}

Description

A curve is closed if the From and To points of each part of the curve are equal.

Remarks

IsClosed may still return TRUE if the curve consists of improperly constructed geometries (ex. non-continuous paths). IsClosed only checks the location of the From and To points of each part, it does not check the internal parts for topological consistency.

ICurve IsClosed Example

ICurve.Length Property

The length of the curve.

Public ReadOnly Property Length As Double
public double Length {get;}

Description

Returns the length of the entire curve. The length of the curve is the sum of the lengths along each parameterized Segment between vertices along the curve.

ICurve.QueryFromPoint Method

Copies this curve's 'from' point to the input point.

Public Sub QueryFromPoint ( _
    ByVal from As IPoint _
)
public void QueryFromPoint (
    IPoint from
);

Description

Used to query the FromPoint of the first Segment of the first part of the curve.

Remarks

Note: The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.

QueryFromPoint Example

//The example shows how to query the from and to points of a curve.

public void ICurveQueryPoints(IFeature currentFeature)

{

    if (currentFeature.Shape.GeometryType == esriGeometryType.esriGeometryPolyline ||

        currentFeature.Shape.GeometryType == esriGeometryType.esriGeometryLine)

    {

        ICurve curve = currentFeature.Shape as ICurve;

        IPoint fromPoint = new PointClass();

        IPoint toPoint = new PointClass();

        curve.QueryFromPoint(fromPoint);

        curve.QueryToPoint(toPoint);

        System.Windows.Forms.MessageBox.Show("ICurve properties..." + "\n" +

                        "Curve.QueryFromPoint (x,y) = " + fromPoint.X + "," + fromPoint.Y + "\n" +

                        "Curve.QueryToPoint (x,y) = " + toPoint.X + "," + toPoint.Y);

    }

}
' The example shows how to query the from and to points of a curve.

    Public Sub t_ICurve_QueryPoints(ByVal pFeature As IFeature)

        Dim pCurve As ICurve

        Dim pPointFrom As IPoint

        Dim pPointTo As IPoint

        pPointFrom = New Point

        pPointTo = New Point

        If pFeature.Shape.GeometryType = esriGeometryType.esriGeometryPolyline Or _

            esriGeometryType.esriGeometryPolyline Or esriGeometryType.esriGeometryLine Then

            pCurve = pFeature.Shape

            pCurve.QueryFromPoint(pPointFrom)

            pCurve.QueryToPoint(pPointTo)

            MsgBox("+++ICurve properties..." & vbCrLf _

              & "Curve.QueryFromPoint (x,y) = " & pPointFrom.X & "," & pPointFrom.Y & vbCrLf _

              & "Curve.QueryToPoint (x,y) = " & pPointTo.X & "," & pPointTo.Y & vbCrLf)

        End If

    End Sub

ICurve.QueryNormal Method

Constructs a line normal to a curve from a point at a specified distance along the curve.

Public Sub QueryNormal ( _
    ByVal extension As esriSegmentExtension, _
    ByVal DistanceAlongCurve As Double, _
    ByVal asRatio As Boolean, _
    ByVal Length As Double, _
    ByVal normal As ILine _
)
public void QueryNormal (
    esriSegmentExtension extension,
    double DistanceAlongCurve,
    bool asRatio,
    double Length,
    ILine normal
);

Description

Given a distance along the curve specified either as a ratio of the Length or as a specific fixed distance, QueryNormal returns the Line normal to the Point. The length and method of tangential extension of the normal line are given by the user. The method of tangential extension determines the direction of the normal line as though it were being extended at a From point or a To point.

Remarks

QueryNormal Example

ICurve.QueryPoint Method

Copies to outPoint the properties of a point on the curve at a specified distance from the beginning of the curve.

Public Sub QueryPoint ( _
    ByVal extension As esriSegmentExtension, _
    ByVal DistanceAlongCurve As Double, _
    ByVal asRatio As Boolean, _
    ByVal outPoint As IPoint _
)
public void QueryPoint (
    esriSegmentExtension extension,
    double DistanceAlongCurve,
    bool asRatio,
    IPoint outPoint
);

Description

Returns the Point at a given distance along the curve or extended curve. If the distance is less than the length of the curve, then the returned point is the point at that distance along the curve. If the distance is less than zero, or greater than the length of the curve, then the returned point is on the curve specified by the extension method. The distance may be specified as a fixed unit of measure or a ratio of the length of the curve.

Remarks

Note: The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.

ICurve QueryPoint Example

ICurve.QueryPointAndDistance Method

Finds the point on the curve closest to inPoint, then copies that point to outPoint; optionally calculates related items.

Public Sub QueryPointAndDistance ( _
    ByVal extension As esriSegmentExtension, _
    ByVal inPoint As IPoint, _
    ByVal asRatio As Boolean, _
    ByVal outPoint As IPoint, _
    ByRef DistanceAlongCurve As Double, _
    ByRef distanceFromCurve As Double, _
    ByRef bRightSide As Boolean _
)
public void QueryPointAndDistance (
    esriSegmentExtension extension,
    IPoint inPoint,
    bool asRatio,
    IPoint outPoint,
    ref double DistanceAlongCurve,
    ref double distanceFromCurve,
    ref bool bRightSide
);

Description

Finds the Point on the specified extended curve nearest to the input point and the distance between those points. Also returns information about the side of the curve the input point is on as well as the distance along the curve that the nearest point occurs.

Remarks

AsRatio is an input parameter that only affects the DistanceAlongCurve

_distanceFromCurve_is an output parameter that represents the minimum distance between the curve and the input point.

DistanceAlongCurve is an output parameter that represents the distance between the Frompoint of the input curve and the returned point on the curve.

bRightSide is an output parameter that tells if the input point is on the right side of the curve. The direction of the curve determines the right and left sides.

Note: The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.

QueryPointAndDistance Example

ICurve.QueryTangent Method

Constructs a line tangent to a curve from a point at a specified distance along the curve.

Public Sub QueryTangent ( _
    ByVal extension As esriSegmentExtension, _
    ByVal DistanceAlongCurve As Double, _
    ByVal asRatio As Boolean, _
    ByVal Length As Double, _
    ByVal tangent As ILine _
)
public void QueryTangent (
    esriSegmentExtension extension,
    double DistanceAlongCurve,
    bool asRatio,
    double Length,
    ILine tangent
);

Description

Given a distance along the curve specified either as a ratio of the length or as a specific fixed distance, QueryTangent returns the Line tangent to the Point. The length and method of tangential extension of the tangent line are given by the user. The method of tangential extension determines the direction of the tangent line as though it were being extended at a From point or a To point.

Remarks

QueryTangent Example

ICurve.QueryToPoint Method

Copies the curve's 'to' point into the input point.

Public Sub QueryToPoint ( _
    ByVal to As IPoint _
)
public void QueryToPoint (
    IPoint to
);

Description

Used to query the ToPoint of the first Segment of the first part of the curve.

Remarks

Note: The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.

QueryToPoint Example

ICurve.ReverseOrientation Method

Reverses the parameterization of the curve ('from' point becomes 'to' point, first segment becomes last segment, etc).

Public Sub ReverseOrientation ( _
)
public void ReverseOrientation (
);

Description

ReverseOrientation changes the direction of the curve without changing the spatial position of the curve. The From Point and To Point of each Segment in each part of the curve are interchanged.

Remarks

The ReverseOrientationmethod works the same way as the Arcedit FLIP command. It reverses the order of the vertices in the Curve.

Caution should be taken in using ReverseOrientation on Polygons. Since ReverseOrientation changes the direction of each Ring within the Polygon, all Exterior Rings become Interior Rings and vice versa.

Reverse Orientation Example

public void ReverseOrientation(IFeatureClass featureClass, int oidToEdit)

    {

        IFeature feature = featureClass.GetFeature(oidToEdit);

        if (feature.Shape.GeometryType == esriGeometryType.esriGeometryPolygon)

        {

            IArea area = feature.Shape as IArea;

            double beforeReverse = area.Area;

            ICurve curve = feature.Shape as ICurve;

            curve.ReverseOrientation();

            double afterReverse = area.Area;

            System.Windows.Forms.MessageBox.Show(String.Format("The polygon area is originally {0}, after the orientation was reversed the area is {1}.",beforeReverse,afterReverse));

        }

    }

ICurve.ToPoint Property

The 'to' point of the curve.

Public Property ToPoint As IPoint
public IPoint ToPoint {get; set;}

Description

Returns or Sets the ToPoint of the first Segment of the first part of the curve. While the curve may be composed of many parts and segments each with their own ToPoint, each curve only has a single To Point.

Remarks

ToPoint Example

Inherited Interfaces

Interfaces Description
IGeometry Provides access to members that describe properties and behavior of all geometric objects.

Classes that implement ICurve

Classes Description
BezierCurve A cubic Bezier curve defined between two points; optionally has measure, height and ID attributes at each endpoint.
CircularArc A portion of a circle that connects two points optionally has measure, height and ID attributes at each endpoint.
EllipticArc A portion of the boundary of a 2D ellipse that connects two points; optionally has measure, height and ID attributes at each endpoint.
Line A 2D straight line between a pair of 2D endpoints; can optionally have height, measure and ID attributes at each endpoint.
Path A sequence of connected segments.
Polygon A collection of rings ordered by their containment relationship; optionally has measure, height and ID attributes.
Polyline An ordered collection of paths; optionally has measure, height and ID attributes.
Ring An area bounded by one, closed sequence of connected segments; optionally has measure, height and ID attributes at each vertex.
//The example shows how to get the ICurve properties of a polygon feature

public void GetCurveProperties(IFeature currentFeature)

{

    if (currentFeature.Shape.GeometryType == esriGeometryType.esriGeometryPolygon)

    {

        ICurve curve = currentFeature.Shape as ICurve;

        System.Windows.Forms.MessageBox.Show("Polygon::ICurve properties..." + "\n" +

        "Curve.Length = " + curve.Length + "\n" +

        "Curve.IsClosed = " + curve.IsClosed + "\n" +

        "Curve.FromPoint.X = " + curve.FromPoint.X + "\n" +

        "Curve.FromPoint.Y = " + curve.FromPoint.Y + "\n" +

        "Curve.ToPoint.X = " + curve.ToPoint.X + "\n" +

        "Curve.ToPoint.Y = " + curve.ToPoint.Y

        );

    }

}
' The example shows how to get the ICurve properties of a polygon feature

    Public Sub t_ICurve_polygon(ByVal pFeature As IFeature)

        Dim pCurve As ICurve

        If pFeature.Shape.GeometryType = esriGeometryType.esriGeometryPolygon Then

            pCurve = pFeature.Shape

            MsgBox("+++Polygon::ICurve properties..." & vbCrLf _

              & "Curve.Length = " & pCurve.Length & vbCrLf _

              & "Curve.IsClosed = " & pCurve.IsClosed _

              & "Curve.FromPoint.X = " & pCurve.FromPoint.X & vbCrLf _

              & "Curve.FromPoint.Y = " & pCurve.FromPoint.Y & vbCrLf _

              & "Curve.ToPoint.X = " & pCurve.ToPoint.X & vbCrLf _

              & "Curve.ToPoint.Y = " & pCurve.ToPoint.Y)

        End If

    End Sub

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.