|
POST
|
See also the notes in this link: Introduction to attribute rules—ArcGIS Pro | Documentation
... View more
08-24-2022
06:44 AM
|
1
|
0
|
2203
|
|
POST
|
If by Desktop you mean ArcMap, then yes. This is expected behavior, Tables with Attribute Rules can not be opened in ArcMap.
... View more
08-24-2022
06:42 AM
|
1
|
3
|
2204
|
|
POST
|
It will alter your schema, yes. But you can define an Attribute Rule on the related table to update the count field when the data in the related table changes. See this comment for an example. At the moment (and probably for the forseeable future), that's the closest you will come to what you want.
... View more
08-24-2022
01:31 AM
|
0
|
0
|
1279
|
|
POST
|
Open the attribute table, click on Add Field Enter your field info Save your changes
... View more
08-24-2022
01:19 AM
|
1
|
5
|
31567
|
|
POST
|
That sounds like the base map, which is chosen by your portal's administrator. If your admin made multiple base maps, you can switch between them: You can also switch it off:
... View more
08-24-2022
01:11 AM
|
0
|
0
|
844
|
|
POST
|
Also, a lot of the slowness of Attribute Rules comes from the loading of FeatureSets. To make it quicker: Load only the fields you need. Don't load the geometries if you don't want to work with them. You can do an Intersects() without loading the geometry!
... View more
08-24-2022
01:01 AM
|
0
|
1
|
1775
|
|
POST
|
Basically, instead of choosing a field for the Attribute Rule and returning a value, you leave the field empty and return a dictionary. The possible keys of this dictionary are described here: https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/attribute-rule-dictionary-keywords.htm var attribute_1 = null
var attribute_2 = null
var attribute_3 = "Nothing here"
var layer_1 = FeatureSetByName($datastore, "FC_1")
var id = $feature.SomeID
var polygon_1 = First(Filter(layer_1, "SomeID = @ID"))
if(polygon_1 != null) { attribute_1 = polygon_1.Attribute }
var layer_2 = FeatureSetByRelationshipName($feature, "Relationship")
var polygon_2 = First(layer_2)
if(polygon_2 != null) { attribute_2 = polygon_2.Attribute }
var layer_3 = FeatureSetByName($datastore, "FC_3")
var polygon_3 = First(Intersects($feature, layer_3))
if(polygon_3 != null) { attribute_3 = polygon_3.Attribute }
return {
result: {
attributes: {
Attribute1: attribute_1,
Attribute2: attribute_2,
Attribute3: attribute_3,
}
}
}
... View more
08-24-2022
12:54 AM
|
0
|
0
|
1777
|
|
POST
|
This Python script will create 2 layers (named "20%" and "80%") in your ArcGIS Pro map. These show the input features, but with a definition query. If you want to save those subsets, right-click on the layers and export data. Copy/paste the script into the Python window, edit the in_features variable, run it. in_features = "EZG" # path to the featureclass or name of the layer
import random
# get all objectids
oids = [row[0] for row in arcpy.da.SearchCursor(in_features, ["OBJECTID"])]
# get a random sample
oids_80 = random.sample(oids, int(0.8 * len(oids)))
# create the layers
arcpy.management.MakeFeatureLayer(in_features, "80%", f"OBJECTID IN {tuple(oids_80)}")
arcpy.management.MakeFeatureLayer(in_features, "20%", f"OBJECTID NOT IN {tuple(oids_80)}")
... View more
08-23-2022
07:30 AM
|
1
|
1
|
1659
|
|
POST
|
# if filename isn't equal to "Parcels.shp", go to next file
for dirpath, dirnames, filenames in walk:
for file in filenames:
if file != "Parcels.shp":
continue
infc = os.path.join(dirpath, file)
#...
# if filename doesn't start with "Parcels", go to next file
for dirpath, dirnames, filenames in walk:
for file in filenames:
if not file.startswith("Parcels"):
continue
infc = os.path.join(dirpath, file)
#...
# if filename doesn't contain "Parcels", go to next file
for dirpath, dirnames, filenames in walk:
for file in filenames:
if not "Parcels" in file:
continue
infc = os.path.join(dirpath, file)
#...
... View more
08-23-2022
05:14 AM
|
1
|
1
|
2947
|
|
POST
|
Hey! This expression returns a dictionary. Are you sure you need a dictionary and not a string or something else? What do you want to do with this expression? Is it for an Attribute Rule?
... View more
08-23-2022
04:25 AM
|
0
|
5
|
2393
|
|
POST
|
With the os.path module: walk = arcpy.da.Walk(workspace, datatype = "FeatureClass")
for dirpath, dirnames, filenames in walk:
for file in filenames:
infc = os.path.join(dirpath, file)
outfcname = os.path.basename(file).split(".")[0] + "_" + os.path.basename(dirpath)
outfc = os.path.join(outgdb, outfcname)
arcpy.management.CopyFeatures(infc, outfc) With the newer pathlib module: from pathlib import Path
walk = arcpy.da.Walk(workspace, datatype = "FeatureClass")
for dirpath, dirnames, filenames in walk:
for file in filenames:
infc = Path(dirpath, file)
outfcname = Path(file).stem + "_" + Path(dirpath).stem
print(outfcname)
outfc = Path(outgdb, outfcname)
arcpy.management.CopyFeatures(str(infc), str(outfc)) # arcpy is old and doesn't know about Path
... View more
08-23-2022
12:39 AM
|
0
|
3
|
2970
|
|
POST
|
Also, not sure if that applies to FIeldMaps, but in an Enterprise GDB, you can create a database sequence and then call NextSequenceValue in Arcade instead of loading and ordering the whole featureset.
... View more
08-22-2022
12:56 PM
|
0
|
0
|
1620
|
|
POST
|
Check if there is already a LeakID. If so, just return that, essentially changing nothing. if($feature.LeakID != null) {
return $feature.LeakID
}
var AllLeaks = FeatureSetByName($map,"Gas Leak")
var LeakCount = Count(AllLeaks);
var NewestLeak = First(OrderBy(AllLeaks,"LeakID DESC"));
if(LeakCount == 0){
return 1
}
return sum(NewestLeak.LeakID, 1);
... View more
08-22-2022
12:52 PM
|
0
|
1
|
1622
|
|
POST
|
var fips = $feature["parent_id"]
var dd = FeatureSetByName($map, "Survey v2", ['age', 'gender', 'race'], false)
var fillterSur = "survey_id = @fips"
var cou = First(Filter(dd, fillterSur))
if(cou == null) { return "no survey found" }
var attributes = Dictionary(Text(cou))["attributes"]
var popup_lines = []
for(var a in attributes) {
var line = `${a}: ${attributes[a]}`
Push(popup_lines, line)
}
return Concatenate(popup_lines, TextFormatting.NewLine)
... View more
08-22-2022
10:55 AM
|
0
|
2
|
1907
|
|
POST
|
Something like this? var attributes = Dictionary(Text($feature))["attributes"]
var popup_lines = []
for(var a in attributes) {
var line = `${a}: ${attributes[a]}`
Push(popup_lines, line)
}
return Concatenate(popup_lines, TextFormatting.NewLine)
... View more
08-22-2022
07:47 AM
|
2
|
4
|
1933
|
| 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
|