Arcade/ArcGIS Pro 2.9:

I have an array of polyline vertices:


I want to convert the array to a polyline so that I can use Arcade geometry functions on it.

I've searched the docs, but I can't seem to find an Arcade function that converts an array to a polyline. I see there is a FromJSON() function, but I don't think my array is JSON. And I don't see a FromArray() function in the docs.

How can I convert the array to a polyline using Arcade?

  • Where is this array coming from? What mechanism is generating it? If it is being generated in a python environment you could use arcpy to create a polyline geometry.
    – Hornbydd
    Feb 28, 2022 at 17:18
  • 1
    What the paths property of the Polyline object is giving you is the same paths that is set in JSON to pass to the Polyline constructor. Take what you have and embed it into JSON structure and add a "spatialReference" property, and then pass it to Polyline constructor.
    – bixb0012
    Feb 28, 2022 at 20:54
  • 1
    @bixb0012 Thanks! For my notes, I think this is what you're referring to: i.stack.imgur.com/8KTZU.png Source: Arcade Polyline Function
    – User1974
    Feb 28, 2022 at 21:13
  • @User1974, I can a bit later today.
    – bixb0012
    Mar 1, 2022 at 17:19

1 Answer 1


From Polyline | Geometry Functions | ArcGIS Arcade:

Polyline(definition) -> Polyline

Constructs a Polyline object from a JSON string or an object literal. The JSON schema must follow the ArcGIS REST API format for Polyline geometries.

and looking at Geometry objects -- Common Data Types | ArcGIS Developers


A polyline (specified as esriGeometryPolyline) contains an array of paths or curvePaths and a spatialReference. ... Each path is represented as an array of points, and each point in the path is represented as an array of numbers.

Given an array of coordinates that is compatible/compliant with JSON formatting, one can directly embed the array into a larger JSON definition for the polyline object.

// array of coordinates that is compliant with JSON formatting
var paths = [

// embed existing array into large JSON definition for polyline
var polylineJSON = {
  "paths": paths,
  "spatialReference": { "wkid": 3857 }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.