Show / Hide Table of Contents

Class Polyline

A multipart linear shape.

Inheritance
Object
Geometry
Multipart
Polyline
Multipart.Parts
Multipart.Extent
Multipart.IsEmpty
Multipart.HasZ
Multipart.HasM
Geometry.HasCurves
Geometry.IsNullOrEmpty(Geometry)
Geometry.SpatialReference
Geometry.ToJson()
Geometry.FromJson(String)
Geometry.FromJson(String, SpatialReference)
Geometry.Equals(Geometry, Double)
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Namespace: Esri.ArcGISRuntime.Geometry
Assembly: Esri.ArcGISRuntime.dll
Syntax
public class Polyline : Multipart
Remarks

Polyline geometries represent the shape and location of linear features such as a street in a road network, a contour line representing an elevation value, or a hiking trail. They can be used to define geometry for features and graphics, or as input or output for tasks or geoprocessing operations, such as the output of a network trace.

A polyline is composed of a series of connected segments, where each segment defines a continuous line between a start and an end map point. You can define a new polyline from a collection of MapPoint's to create a series of straight LineSegment connecting the map points you specified. You can use PolylineBuilder to build a polyline one map point at a time or to modify an existing polyline.

Additionally, polyline can have multiple parts. Each part is a series of connected segments, but the parts can be disjoint. For example, a polyline representing a street that ends and then starts again a block later. Parts can also intersect at one or more vertices. For example, in a polyline representing a river and its tributaries. The polyline class inherits from Multipart, which provides members for iterating the segments and map points of each part in a polyline.

Polylines are based upon the parent Geometry Class. The Geometry Class is immutable which means that you can not change its shape once it is created. If you need to modify a polyline once it has been created, use the PolylineBuilder Class instead. The ToGeometry() Method will provide you with the polyline object.

Constructors

Name Description
Polyline(IEnumerable<MapPoint>)

Initializes a new instance of the Polyline class.

Polyline(IEnumerable<MapPoint>, SpatialReference)

Initializes a new instance of the Polyline class.

Polyline(IEnumerable<Segment>)

Initializes a new instance of the Polyline class.

Polyline(IEnumerable<Segment>, SpatialReference)

Initializes a new instance of the Polyline class.

Polyline(IEnumerable<IEnumerable<MapPoint>>)

Initializes a new instance of the Polyline class.

Polyline(IEnumerable<IEnumerable<MapPoint>>, SpatialReference)

Initializes a new instance of the Polyline class.

Polyline(IEnumerable<IEnumerable<Segment>>)

Initializes a new instance of the Polyline class.

Polyline(IEnumerable<IEnumerable<Segment>>, SpatialReference)

Initializes a new instance of the Polyline class.

Properties

Name Description
Dimension

Gets the number of dimensions for the geometry.

GeometryType

Gets the geometry type.

Methods

Name Description
IsEqual(Geometry)

Compares two Polyline for equality. This will check for a matching SpatialReference and the content of Parts match. The order of parts must match too.

ToString()

Returns a String that represents the current Object.

Extension Methods

GeometryEngine.NormalizeCentralMeridian(Geometry)
GeometryEngine.NearestVertex(Geometry, MapPoint)
GeometryEngine.NearestCoordinate(Geometry, MapPoint)
GeometryEngine.NearestCoordinateGeodetic(Geometry, MapPoint, Double, LinearUnit)
GeometryEngine.Project(Geometry, SpatialReference)
GeometryEngine.Project(Geometry, SpatialReference, DatumTransformation)
GeometryEngine.Union(Geometry, Geometry)
GeometryEngine.Intersection(Geometry, Geometry)
GeometryEngine.Intersections(Geometry, Geometry)
GeometryEngine.Clip(Geometry, Envelope)
GeometryEngine.Simplify(Geometry)
GeometryEngine.Area(Geometry)
GeometryEngine.AreaGeodetic(Geometry, AreaUnit, GeodeticCurveType)
GeometryEngine.Cut(Geometry, Polyline)
GeometryEngine.Length(Geometry)
GeometryEngine.LengthGeodetic(Geometry, LinearUnit, GeodeticCurveType)
GeometryEngine.Buffer(Geometry, Double)
GeometryEngine.Distance(Geometry, Geometry)
GeometryEngine.Intersects(Geometry, Geometry)
GeometryEngine.Contains(Geometry, Geometry)
GeometryEngine.Overlaps(Geometry, Geometry)
GeometryEngine.Within(Geometry, Geometry)
GeometryEngine.Crosses(Geometry, Geometry)
GeometryEngine.Disjoint(Geometry, Geometry)
GeometryEngine.Touches(Geometry, Geometry)
GeometryEngine.Densify(Geometry, Double)
GeometryEngine.Offset(Geometry, Double, OffsetType, Double, Double)
GeometryEngine.Generalize(Geometry, Double, Boolean)
GeometryEngine.Difference(Geometry, Geometry)
GeometryEngine.SymmetricDifference(Geometry, Geometry)
GeometryEngine.DensifyGeodetic(Geometry, Double, LinearUnit, GeodeticCurveType)
GeometryEngine.ConvexHull(Geometry)
GeometryEngine.Relate(Geometry, Geometry, String)
GeometryEngine.BufferGeodetic(Geometry, Double, LinearUnit, Double, GeodeticCurveType)
GeometryEngine.Boundary(Geometry)
GeometryEngine.Reshape(Multipart, Polyline)
GeometryEngine.IsSimple(Geometry)
GeometryEngine.CombineExtents(Geometry, Geometry)
GeometryEngine.Extend(Polyline, Polyline, GeometryExtendOptions)
GeometryEngine.RemoveM(Geometry)
GeometryEngine.RemoveZ(Geometry)
GeometryEngine.RemoveZAndM(Geometry)
GeometryEngine.CreatePointAlong(Polyline, Double)
GeometryEngine.FractionAlong(Polyline, MapPoint, Double)
GeometryExtensions.WithZ<T>(T, Double)
GeometryExtensions.WithM<T>(T, Double)
GeometryExtensions.WithZAndM<T>(T, Double, Double)

Applies to

TargetVersions
.NET Standard 2.0100.3 - 200.0
.NET 6.0100.13 - 200.0
.NET 6.0 Windows100.13 - 200.0
.NET 6.0 Android200
.NET 6.0 iOS200
.NET Framework100.0 - 200.0
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Android100.0 - 100.15
iOS100.0 - 100.15
UWP100.0 - 200.0

Relevant samples

Add graphics with symbols: Use a symbol style to display a graphic on a graphics overlay.
In This Article
Back to top Copyright © 2022 Esri.