Select to view content in your preferred language

Attribute rule using json curve not working

689
0
11-17-2020 10:18 AM
Labels (1)
DeanAnderson2
Frequent Contributor

I am testing attribute rules and geometry.  I am able to change line geometry using paths but curves do not appear to work. Both are "valid expressions".  (I am using ArcGIS Pro 2.6 Patch 3 on a geodatabase) 

Adds a vertex offset from the line  (works)
----------------------------------------------------
var paths = geometry($feature).paths
var first_point = paths[0][0]
var last_point = paths[0][Count(paths[0])-1]
var x1 = first_point.x
var y1 = first_point.y
var x2 = last_point.x
var y2 = last_point.y
var xc = (x1 + x2) / 2
var yc = y1

var newline = PolyLine({"paths": [ [[x1,y1],[xc,yc],[x2,y2]]],"spatialReference": Geometry($feature).spatialReference});
return newline;

------------------ Curve Not Working - same coordinate pairs as above ---------------------

var paths = geometry($feature).paths
var first_point = paths[0][0]
var last_point = paths[0][Count(paths[0])-1]
var x1 = first_point.x
var y1 = first_point.y
var x2 = last_point.x
var y2 = last_point.y
var xc = (x1 + x2) / 2
var yc = y1
var newline = polyline(Geometry({"curvePaths": [[[x1,y1], {"c": [[xc,yc],[x2,y2]]} ]],"spatialReference": Geometry($feature).spatialReference }))
return newline;

0 Kudos
0 Replies