Select to view content in your preferred language

Can't modify geometries with m-Values in ArcGIS Pro 3.0 / 3.1 with calculation rules

740
3
Jump to solution
05-21-2023 11:00 PM
Zoggo
by
New Contributor III

I have couples of immediate calculation rules that worked fine in ArcGIS Pro 2.9. After upgrading to 3.0.5 they don't work anymore. I even tried with ArcGIS Pro 3.1.1 with the same result. I reduced my rules to find the line that produced the error. Finally it seems to be a problem with m-aware feature classes.

For my tests I used Arc GIS Pro 3.0.5 with branch versioned data published to our Enterprise Portal (version 11.0.0). The feature classes are stored in a enterprise geodatabase (SQL). 

I published two line feature classes. One with m-values and one without and added the same simple rule to them:

 

var feature_ = $feature;
var g  = Geometry(feature_);
var t = Text(g)
var p = Polyline(t)
return p

 

 

This rule works fine for the feature class without m-values. If I try to modify a geometry with the m-aware polyline I get this error:

Zoggo_0-1684734961789.png

So it seems to bee a problem with the m-values in ArcGIS Pro 3.0.5 and newer.

Is there any workaround for this problem?

 

1 Solution

Accepted Solutions
TedHoward2
Esri Contributor

Does your feature class have m-values and not z-values? 

The Text function incorrectly does not serialize hasM or hasZ when converting to text. This leaves the Polyline constructor in an ambiguous state when the paths have 3 values -- is it XYM or XYZ? Polyline defaults to XYZ  which is probably why you seeing the entity type error. This is a known issue but here is a possible workaround for now:

 

var feature_ = $feature;
var g  = Geometry(feature_);
var t = Text(g)
if (g.hasm) {
   var d = Dictionary(t)
   d["hasM"] = true
   t = Text(d)
}
var p = Polyline(t)
return p

 

 

View solution in original post

3 Replies
TedHoward2
Esri Contributor

Does your feature class have m-values and not z-values? 

The Text function incorrectly does not serialize hasM or hasZ when converting to text. This leaves the Polyline constructor in an ambiguous state when the paths have 3 values -- is it XYM or XYZ? Polyline defaults to XYZ  which is probably why you seeing the entity type error. This is a known issue but here is a possible workaround for now:

 

var feature_ = $feature;
var g  = Geometry(feature_);
var t = Text(g)
if (g.hasm) {
   var d = Dictionary(t)
   d["hasM"] = true
   t = Text(d)
}
var p = Polyline(t)
return p

 

 

Bud
by
Honored Contributor

FYI - I also have an attribute rule that edits M-values here: 
Arcade Code Review: Set polyline M-values to cumulative length of line
I haven't tested it in modern versions of Pro yet.

Related: GitHub - Create SetMValues

0 Kudos
Bud
by
Honored Contributor

@TedHoward2 

Regarding: "This is a known issue..."
Is there a bug number we can reference?

0 Kudos