|
POST
|
Is there a way to subscribe to a specific tag in a community? For example, I want to get weekly or daily email notifications regarding posts about Arcade. Similar to what we can do with GIS.StackExchange. How can I do that? Thanks.
... View more
03-15-2022
07:54 PM
|
0
|
5
|
2468
|
|
IDEA
|
As far as I can tell, the Equals() function doesn’t consider M-values when comparing geometries. See: Arcade: Editing M-values not treated as change to geometry If that’s the case, then could a blurb be added to the Arcade docs that explains this? I know the docs hint at it with the “geographically equivalent” wording, but I think it could be clearer. It might also help to explain whether Z-values get considered or not, too.
... View more
03-15-2022
06:44 PM
|
1
|
1
|
1237
|
|
POST
|
I wonder if the Equals() function is the culprit. After some testing, I found the following works (I removed the Equals() function and added the Text() function): if ( Text(Geometry($feature)) == Text(Geometry($originalfeature)) ) { I also tried doing it without the Text() function: if ( Geometry($feature) == Geometry($originalfeature) ) { But that failed in a different way. It flagged all edits, even if the edit was just a change to an attribute (not a change to the geometry). That's not what we want. Follow-up question: If the Equals() function is the problem, I wonder what the root cause is? Is it only comparing the X/Y of the geometries, not the M-values? Is that a bug?
... View more
03-15-2022
01:45 AM
|
1
|
0
|
2598
|
|
POST
|
ArcGIS Pro 2.9: I have a Arcade calculation attribute rule that checks if the geometry of a feature was changed during an edit: if (Equals(Geometry($feature), Geometry($originalfeature))) {
console("geometry changed = no");
return {"result": {"attributes": {"geometry_changed": 'no' }}}
} else {
console("geometry changed = yes")
return {"result": {"attributes": {"geometry_changed": 'yes' }}}
} The intent is: If the geometry was changed, then it sets a geometry_changed field to "yes". If not, it sets the field to "no". The attribute rule works as expected in most cases. For example, in the Edit Vertices window, if I manually change an X or Y coordinate using the keyboard, the field will be flagged as "yes", as expected. However, if I manually change the M-value in the Edit Vertices window using the keyboard, the field will be flagged as "no", which is not expected. The same thing happens when I use the Drop Measures tool: Question: Why don't M-value edits get flagged as a change to the geometry? Thanks.
... View more
03-15-2022
12:48 AM
|
1
|
4
|
2647
|
|
IDEA
|
In the Fields tab in ArcGIS Pro: Currently, if we rename a field, the field alias stays the same as it was before we renamed the field: We often don't think to update the alias when renaming a field. The old name doesn't apply anymore, and is often downright misleading. Especially since the alias is used as the field header in the attribute table, not the field name. Intuitively, when renaming a field, we'd expect the alias to be reset to the field’s new name. Could Esri consider changing that behavior? ArcGIS Pro 2.6.8
... View more
03-14-2022
11:57 PM
|
2
|
5
|
2382
|
|
POST
|
I thought this was interesting: "Luckily, arcpy can be accessed inside field calculator, so it's a simple call to arcpy.Array():" def plineM(shp):
for part in arcpy.Array(shp.getPart(0)):
for p in part:
return None if p is None else p.X
plineM(!Shape!) Script (ArcPy) vs field calculator (Python Parser) behaviour of getPart in ArcGIS for Desktop?
... View more
03-12-2022
07:00 PM
|
1
|
0
|
1895
|
|
POST
|
Using a calculation attribute rule: Is there a way to insert a new row into the same table? For example, in a non-spatial table, I want to split a linear referencing record into two separate records (the original record and a new record). Is there a way to do that? Thanks.
... View more
03-12-2022
05:01 PM
|
0
|
0
|
565
|
|
POST
|
By the way, the keyboard shortcut for auto-formatting code in VS Code is: Shift + Alt + F. How do you format code in Visual Studio Code (VSCode)?
... View more
03-12-2022
10:05 AM
|
0
|
0
|
1914
|
|
POST
|
I have an Arcade calculation attribute rule that sets polyline M-values to the cumulative length of the line. The script works as expected. But I'm still a novice, so I thought I'd ask: Can the script be improved? Notes about the script: - It works for both singlepart and multipart features. - It densifies true curves (unavoidable, since Arcade pre-densifies true curves). - The code below is out-of-date. I've posted an updated version in a reply...further down in this post. //var paths = [[[0, 5, null], [10, 10, null], [30, 0, null], [50, 10, null], [60, 10, null]]]; //JS
//Only do the calculation if the geometry was changed/edited.
if (!Equals(Geometry($feature), Geometry($originalfeature))) {
var geom = Dictionary(Text(Geometry($feature)));
var paths = geom['paths'];
//Alternatively, this could be done with the Arcade distance() function. I chose to do the math manually so that the script can be used elsewhere, such as VSCode (for debugging).
function pythagoras(x1, y1, x2, y2) {
return sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
}
for (var path_idx in paths) {
var oldX = paths[0][0][0], oldY = paths[0][0][1], length = 0;
for (var point_idx in paths[path_idx]) {
var newX = paths[path_idx][point_idx][0], newY = paths[path_idx][point_idx][1];
length += pythagoras(oldX, oldY, newX, newY);
paths[path_idx][point_idx][2] = length;
oldX = newX;
oldY = newY;
}
}
console(paths);
return { "result": { "geometry": Polyline(geom) } };
//Output: [[[0,5,0],[10,10,11.180339887498949],[30,0,33.54101966249685],[50,10,55.90169943749475],[60,10,65.90169943749476]]]
} (The script was adapted from this GitHub sample: Set Ms to Index.) Thanks!
... View more
03-11-2022
10:19 AM
|
0
|
14
|
7369
|
|
POST
|
What are some tips/tricks for debugging Arcade scripts in VS Code/Node.js? (assuming that the Arcade script is fairly vanilla -- as in, it doesn't use many Arcade-specific functions that need to be stripped-out) For example, Arcade uses console(), whereas VS Code/Node.js uses console.log(). Solution: In VS Code, put this line at the top of the script: console = Object.assign(console.log, console); That will assign console.log() to console(). Which means I can use the console() script in both programs -- without constantly doing "find and replace" on .log. Note: Only use that line in VS Code; it won't work in Arcade (and isn't needed in Arcade). Any other ideas? (I'm a novice, so it's possible the console.log() thing is wonky...I'm just trying to learn, and not get too frustrated while I'm at it 🙂 Related: Idea: Arcade Extension for Visual Studio Code
... View more
03-11-2022
05:41 AM
|
0
|
2
|
1975
|
|
POST
|
Related: if ($feature.structureheight >= 65)
{
If (DomainName($feature, 'Material') == 'Steel')
{ return true; }
else
{ return false; }
}
Else
{ return true; } Validation attribute rule examples
... View more
03-10-2022
10:28 AM
|
0
|
0
|
3949
|
|
POST
|
Regarding this code sample from the attribute rule docs: (Mark another feature as requiring evaluation) //Updating the substation name marks its transformers as requiring calculation and updates the yearName to the new name and year.
//To recalculate the facility id on all transformers, mark all associated transformers as requiring calculation.
var fsDevice = FeatureSetByName($datastore, "Transformer", ["globalid"], false)
var fsDeviceIntersects = Intersects (fsDevice, Geometry($feature))
var transformers = [];
var count = 0;
for (var i in fsDeviceIntersects)
transformers[count++] = i.globalid;
var newName = $feature.name + " " + Year(Now())
return {
'result': newName,
'calculationRequired':
[
{
'className':"Transformer",
'globalIDs': transformers
}
]
} How does this line work? transformers[count++] = i.globalid; Is it populating a "count" element in the transformers array with a list of global IDs? And then returning the entire transformers array in the result? If so, I don't think I realized ++ could be used that way. Thanks.
... View more
03-10-2022
01:41 AM
|
1
|
9
|
4663
|
|
POST
|
In an Oracle 18c Enterprise GDB; St_Geometry: If I add a calculation attribute rule to a FC via ArcGIS Pro 2.4, what will that mean for ArcMap 10.7.1 users? A. ArcMap can’t read the FC B. ArcMap can’t write to the FC C. ArcMap can’t read anything in the GDB D. ArcMap can’t write anything in the GDB F. Using ArcMap to write to the GDB would corrupt the FC. G. Using ArcMap to write to the GDB would corrupt the entire GDB. I. Attribute rules wouldn’t be honoured/invoked when edits are made to the FC in ArcMap. J. Something else? I’m Just trying to get a handle on what would happen at a practical level. I know the general sentiment is that attribute rules are incompatible with ArcMap. But if it ends up working the way I described in B) or I) above, then that might mean that certain departments could switch to Pro/Attribute Rules now (like me), even though other departments haven’t switched to Pro yet (outside of my control). I could add attribute rules to my FCs, since I’m the only one who edits them, without breaking the whole GDB. What would happen in the scenario mentioned above? Thanks.
... View more
03-09-2022
11:54 PM
|
1
|
1
|
1314
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-30-2026 11:08 AM | |
| 1 | 05-11-2026 11:23 AM | |
| 2 | 05-07-2026 04:19 AM | |
| 1 | 05-06-2026 09:03 AM | |
| 1 | 03-19-2026 09:29 AM |