Select to view content in your preferred language

How to convert Polygon to Polyline and Push geometry using Arcade?

319
2
Jump to solution
05-02-2025 08:04 AM
Yogesh_Chavan
Frequent Contributor

On INSERT of a new polygon feature in Polygon FC, the arcade attribute rule should push that to the Polyline FC?

How can we achieve this using Arcade Attribute Rules in ArcGIS Pro?

I am working on a rule to consider rings to polyline, but need to know how to push the geometry, and if I am on right track?

var geom = Geometry($feature)
var rings = geom.rings
var spatialRef = geom.spatialReference
var polyline = Polyline({
'paths':rings,
'spatialReference':spatialref
})
return polyline

https://community.esri.com/t5/arcgis-api-for-flex-questions/convert-a-polygon-to-polyline-for-cut/m-...

0 Kudos
1 Solution

Accepted Solutions
Yogesh_Chavan
Frequent Contributor

Thank you so much @Jake_S,

This is what is expected, a single output:)

View solution in original post

0 Kudos
2 Replies
Jake_S
by Esri Contributor
Esri Contributor

@Yogesh_Chavan 

What you need is Attribute rule dictionary keywords , specifically the edit with adds.

Now if you are looking for a single line to represent you poly gone the code below should work; just replace your feature class name in line 11. 

If you need a line for each of your polygons side, i.e. 4 sided polygon nets 4 lines, that's a bit more work.

var geom = Geometry($feature)
var rings = geom.rings
var spatialRef = geom.spatialReference
var polyline = Polyline({
'paths':rings,
'spatialReference':spatialref
})

return {
    'edit': [{
        'className': 'Line',
        'adds': [{ 
            'geometry': polyline,
                }]
        }]
    }

 

Yogesh_Chavan
Frequent Contributor

Thank you so much @Jake_S,

This is what is expected, a single output:)

0 Kudos