Class Polyline

  • All Implemented Interfaces:
    JsonSerializable

    public final class Polyline
    extends Multipart
    Represents a linear shape defined by a collection of parts, and a SpatialReference. Each Part is a continuous line represented by a collection of Segments. If there is more than one part, each part may either branch or be discontinuous from other parts. Point-based helper methods allow the polyline to be treated as a series of connected Points.

    Polyline is immutable. Instead of changing the properties of an existing Polyline, create new Polyline instances, or use PolylineBuilder.

    A Polyline can be used as the geometry of a Feature or Graphic.

    Since:
    100.0.0
    See Also:
    PolylineBuilder
    • Constructor Detail

      • Polyline

        public Polyline​(PointCollection points)
        Creates a new immutable Polyline containing a copy of the Points in the given PointCollection. The SpatialReference of the new Polyline will match that of the given PointCollection.
        Parameters:
        points - the PointCollection used to initialise the new Polyline
        Since:
        100.0.0
      • Polyline

        public Polyline​(PointCollection points,
                        SpatialReference spatialReference)
        Creates a new Polyline containing a copy of the Points in the given PointCollection, and with the given SpatialReference.

        This overload can be used to create a new Polyline with a specific SpatialReference from an existing PointCollection that has a null SpatialReference (the points are assigned the given SpatialReference-they are not projected).

        Parameters:
        points - the PointCollection containing points copied to the new Polyline
        spatialReference - the SpatialReference of the new Polyline
        Throws:
        ArcGISRuntimeException - if the SpatialReference of points does not match the match the spatialReference argument.
        Since:
        100.0.0
      • Polyline

        public Polyline​(Part part)
        Creates a new immutable Polyline containing a copy of the given Part. The SpatialReference of the new Polyline will match that of the given Part.
        Parameters:
        part - the Part used to initialise the new Polyline
        Since:
        100.0.0
      • Polyline

        public Polyline​(Part part,
                        SpatialReference spatialReference)
        Creates a new Polyline containing a copy of the given Part, and with the given SpatialReference.
        Parameters:
        part - the Part to copy to the new Polyline
        spatialReference - the SpatialReference of the new Polyline
        Throws:
        ArcGISRuntimeException - if the SpatialReference of part does not match the match the spatialReference argument.
        Since:
        100.0.0
      • Polyline

        public Polyline​(PartCollection parts)
        Creates a new immutable Polyline containing a copy of the given PartCollection. The SpatialReference of the new Polyline will match that of the given PartCollection.
        Parameters:
        parts - the PartCollection used to initialise the new Polyline
        Since:
        100.0.0
      • Polyline

        public Polyline​(PartCollection parts,
                        SpatialReference spatialReference)
        Creates a new Polyline containing a copy of the given PartCollection, and with the given SpatialReference.
        Parameters:
        parts - the PartCollection to be copied to the new Polyline
        spatialReference - the SpatialReference of the new Polyline
        Throws:
        ArcGISRuntimeException - if the SpatialReference of parts does not match the match the spatialReference argument.
        Since:
        100.0.0