|
POST
|
Oops, you're right. I think I misremembered my tests with Count(). Thanks for the correction!
... View more
01-25-2023
10:37 AM
|
1
|
1
|
4239
|
|
IDEA
|
Using ArcGIS Pro 3.0.3 I have defined Validation Attribute Rules on feature classes and non-spatial tables in my Enterprise gdb and published those datasets as feature service to our Portal. After evaluating the Validation Rules, I can select an error feature in the error inspector and select the feature that caused the error with the "Features" button. However, this does not work if the error is caused in a non-spatial table: I can get to the table row by using the ObjectID, but that takes a lot of time and is a very bad user experience. Please make the "Features" button also select rows in non-spatial tables.
... View more
01-25-2023
08:49 AM
|
1
|
5
|
1944
|
|
POST
|
It really doesn't matter what data you use. This behavior can be seen on default popups with just the attribute table, on intermediate popups with some Arcade expressions, and on complicated popups with a lot of stuff going on in the Arcade expressions. For example, here is a map which just has the "USA Structures" layer from the Living Atlas. The popup uses some Arcade expressions, but only really simple ones. MapViewer MapViewer Classic In Map Viewer Classic, the popup opens almost instantaneously, good user experience. In Map Viewer, the click on a feature doesn't seem to register for 0.5 to 1 seconds. Then the spinning wheel comes out for 0.1 to 2 seconds (yes, 2 whole seconds on some occasions...), before the popup finally appears. Not so good user experience.
... View more
01-25-2023
08:20 AM
|
0
|
0
|
2869
|
|
POST
|
I don't really understand, and it probably doesn't help that we're both not native speakers... At this moment the feature class is 'A1.1_Leggercode Origineel', [...] Looking at your screenshot, "Leggercode" and "Leggercode Origineel" are columns, not feature classes. Is that correct? both H09916_A and H09916_B get the same replaced sentence because they share the same value 'A1.1_Leggercode Origineel' No. They get the same replaced sentence, because they have the same value in the column "BAGGERBEHANDELING" (op de kant). If you want to have different sentences for these features, you have to change one of the BAGGERBEHANDELING values first. Maybe it would be easier to create the field Uitvoering in the Waterlopen table (the same table that has the BAGGERBEHANDELING column). Then you can do the calculation in there and then join the new field to Vooronderzoek.
... View more
01-25-2023
07:21 AM
|
0
|
1
|
3434
|
|
POST
|
Count() uses a simple for loop internally, so depending on the featureset, it can be really slow. You don't actually need the count here, you just need to check if the featrueset is empty or not. Another way to do that is to call First() on the fs. If the fs is empty, First() will return null. So, in your code above, delete lines 17 & 18, and replace line 27 with this: if(First(Intersects(poly, filtAreas)) != null) { Keep Josh's changes, too. They might not bring a huge speed difference (my change probably won't, either), but they are considered best practice.
... View more
01-25-2023
07:02 AM
|
1
|
3
|
4251
|
|
POST
|
As far as I know, no. You can try running this script in the Python window of each project. It will tell you which layers have time enabled. aprx = arcpy.mp.ArcGISProject("current")
for m in aprx.listMaps():
for layer in m.listLayers():
if layer.supports("isTimeEnabled") and layer.isTimeEnabled:
print(f"Time is enabled for Map {m.name}, Layer {layer.name}")
... View more
01-25-2023
06:32 AM
|
0
|
2
|
2699
|
|
POST
|
Well, the ValueError is absolutely expected. int(some_text) only works if some_text contains only digits, like int("404"). [...] looping through the rows of X [...] Just to be clear: The Field Calculation tool takes your function, loops through the rows of the feature class, and applies the function to each row. You don't need to do the looping yourself. Or do you mean that your text field can have multiple lines? If your table looks like this, use the expression below: TextField links op de kant rechts op de kant niet op de kant def func(x):
replace_dict = {
"links op de kant": "Enkelzijdige belemmering",
"rechts op de kant": "Enkelzijdige belemmering",
}
return replace_dict.get(x, x) If your table looks like this, use this expression instead: TextField links op de kant rechts op de kant op de kant links op de kant niet op de kant op de kant None def func(x):
replace_dict = {
"links op de kant": "Enkelzijdige belemmering",
"rechts op de kant": "Enkelzijdige belemmering",
}
lines = x.split("\n")
new_lines = [replace_dict.get(line, line) for line in lines)
return "\n".join(new_lines) Else post a screenshot of your table.
... View more
01-25-2023
05:23 AM
|
0
|
0
|
3456
|
|
POST
|
I believe that you can't accomplish this with a Constraint rule. The problem is that you have to know the old and new positions not only of the $feature, but of the intersecting features as well. AFAIK, there's no way to get the old geomtries of the intersecting features. I would do this with a Calculation Rule instead. In Calculation rules, you can leave the field empty and return a dictionary. With this dictionary, you can declare edits to be made to other tables. For a documentation of this dictionary, see here: Attribute rule dictionary keywords—ArcGIS Pro | Documentation Other things: If the geometry isn't changed, there is no need to load all those featuresets. Abort early. Instead of writing the same code for multiple featuresets, use a for loop. // Calculation Attribute Rule on the poylgon FC
// field: empty!
// triggers: Update
// Exclude from Application Evaluation
var old_geo = Geometry($originalfeature)
var new_geo = Geometry($feature)
// if the geometry didn't change, we don't need to update the points
if(Equals(old_geo, new_geo)) { return }
// if the geometry changed, but it wasn't a simple move (eg you edited some vertices), we can't update the points
if(Area(old_geo) - Area(new_geo) > 0.0001) { return }
// calculate the coordinate change
var old_centroid = Centroid(old_geo)
var new_centroid = Centroid(new_geo)
var dx = new_centroid.x - old_centroid.x
var dy = new_centroid.y - old_centroid.y
// load and filter the associated point fcs
// the dictionary keys have to be the classnames!
var fcs = {
"TestPoints": Filter(FeaturesetByName($datastore, "TestPoints", ["ObjectID"], true), "IntegerField IN (1, 2, 3)"),
"Stations": Filter(FeaturesetByName($datastore, "Stations", ["ObjectID"], true), "TextField IN ('a', 'b', 'c')"),
}
// loop over the associated fcs
var edits = []
for(var fc_name in fcs) {
var fc = fcs[fc_name]
// create the update array
Push(edits, {className: fc_name, updates: []})
// get the points that intersected the $originalfeature
var i_fc = Intersects(fc, old_geo)
// loop over those points
for(var f in i_fc) {
// calculate the new point geometry
var f_geo = Geometry(f)
var new_x = f_geo.x + dx
var new_y = f_geo.y + dy
var new_f_geo = Point({x: new_x, y: new_y, spatialReference: f_geo.spatialReference})
// append that new geometry to the update array
Push(edits[-1].updates, {objectID: f.ObjectID, geometry: new_f_geo})
}
}
// return the edits
return {edit: edits} All you have to do is move the polygon, the rule will move the associated points for you.
... View more
01-25-2023
02:33 AM
|
0
|
0
|
2121
|
|
POST
|
Maybe you subscribed to Community Basics or Community Blog?
... View more
01-25-2023
12:17 AM
|
0
|
0
|
1401
|
|
POST
|
Oh, also, your second question got cut short: Another question is whether using SHAPE@ token to read the geometry for each of the
... View more
01-24-2023
12:31 PM
|
0
|
1
|
1723
|
|
POST
|
The error is telling you that it can't open ON1996_DissolveOnName, probably because it can't find it. So: are you running this in the Python window, a toolbox or as standalone script? ArcGIS Pro or ArcMap? If you're running this in the Python Window, does the current map actually have a layer called "ON1996_DissolveOnName"? How do you declare the variable layer? The full script could be helpful. To post code:
... View more
01-24-2023
12:30 PM
|
1
|
2
|
1723
|
|
POST
|
To post code: You probably have empty attachments. Try replacing the SearchCursor line with this: with da.SearchCursor(inTable, ['DATA', 'ATT_NAME', 'ATTACHMENTID'], 'DATA IS NOT NULL') as cursor:
... View more
01-24-2023
11:52 AM
|
1
|
2
|
3806
|
|
POST
|
It works for me, so I'm just spitballing here... Does it work if you use another, really simple expression? Let it calculate an integer field to 1 or a text field to Text(Now(), "Y-MM-DD HH:mm:ss")
... View more
01-24-2023
09:07 AM
|
0
|
0
|
1838
|
|
POST
|
Hmm. Is your model still colored, or is it all grey now? Have you tried rebuilding it?
... View more
01-24-2023
08:12 AM
|
0
|
0
|
1854
|
|
POST
|
You have a table selected in the Calculate Field tool. Try using the variable Input Table:
... View more
01-24-2023
07:59 AM
|
0
|
0
|
1864
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-30-2023 09:57 AM | |
| 1 | 05-18-2023 12:51 AM | |
| 1 | 03-05-2023 12:46 PM | |
| 1 | 12-07-2022 07:01 AM | |
| 1 | 06-21-2022 08:27 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-03-2024
06:14 PM
|