|
POST
|
I'm surprised that this expression is shown as valid. Normally, this error should be shown in the validation. The normal way to solve that error is to check if the feature returned with First() is null (meaning an empty feature set) and returning a default value if so. var max_feature = First(OrderBy(p, "code_avis DESC"))
if(max_feature == null) {
return null
}
return max_feature.code_avis
... View more
09-01-2022
11:07 PM
|
0
|
0
|
823
|
|
POST
|
You're confusing Add Attachments and Generate Attachment Match Table. Your bullet point is from Add Attachments and is absolutely correct. This tool can add multiple attachments for the same feature. For that to happen, the feature's key has to occur in multiple records of the match table. This is what my second screenshot shows: ID 1 is there multiple times. What I was talking about is Generate Attachment Table, which... generates an attachment table. This tool is only able to perfectly match ID and file name. The only way you get multiple records with the same ID here is to have the same filenames, but different file extensions (1.jpg, 1.jpeg, 1.png, etc).
... View more
09-01-2022
10:56 PM
|
1
|
1
|
7453
|
|
POST
|
Ah right, you also said it's selectable... Is it something in the symbology? Try symbolising with "Single Symbol".
... View more
09-01-2022
01:37 AM
|
0
|
1
|
5000
|
|
POST
|
Caclulate x and y coordinates in the point fc Run the Summary Statistics tool with statistic type Count and the coordinate fields as Case fields.
... View more
09-01-2022
01:31 AM
|
1
|
1
|
1416
|
|
POST
|
For Field Calculation: // change the first line depending on field
var p = Geometry($feature).paths[0][0] // BegLocation
var p = Geometry($feature).paths[-1][-1] // EndLocation
var streets_at_point = Intersects($featureset, p)
var this_street = $feature.NAME_ALF
var other_streets = Filter(streets_at_point, "NAME_ALF<> @this_street")
var street_names = []
for(var os in other_streets) {
Push(street_names, os.NAME_ALF)
}
return Concatenate(Distinct(street_names), ", ") For Attribute Rule: // Calculation Attribute Rule
// triggers: Insert, Update,
// field: empty
var p_start = Geometry($feature).paths[0][0]
var p_end = Geometry($feature).paths[-1][-1]
var this_street = $feature.NAME_ALF
var streets_start = Intersects($featureset, p_start)
var other_streets = Filter(streets_start, "NAME_ALF<> @this_street")
var start_names = []
for(var os in other_streets) {
Push(start_names, os.NAME_ALF)
}
var streets_end = Intersects($featureset, p_end)
var other_streets = Filter(streets_end, "NAME_ALF<> @this_street")
var end_names = []
for(var os in other_streets) {
Push(end_names, os.NAME_ALF)
}
return {
result: {
attributes: {
BegLocation: Concatenate(Distinct(start_names), ", "),
EndLocation: Concatenate(Distinct(end_names), ", ")
}
}
}
... View more
09-01-2022
01:14 AM
|
1
|
5
|
3774
|
|
POST
|
Maybe you have a definition query on the layer? Filter features with definition queries—ArcGIS Pro | Documentation
... View more
09-01-2022
12:43 AM
|
0
|
3
|
5004
|
|
POST
|
in_table = r"N:\bla\bla\connection.sde\DataOwner.Table"
# get a dictionary of relevant domains values
from pathlib import Path
all_domains = {d.name: d for d in arcpy.da.ListDomains(Path(in_table).parent)}
encode_dict = {
f.name: {v: k for k, v in all_domains[f.domain].codedValues.items()}
for f in arcpy.ListFields(in_table) if f.domain}
# {DomainField1: {Desc1: Code1, Desc2: Code2}, DomainField2: ...}
# function to return "true" values
def get_true_value(field_name, value):
try:
return encode_dict[field_name][value]
except KeyError:
return value
fields = ["Field1", "Field2", "Field3"]
key_field_index = 0 #Field1
# read the imported csv
csv_rows = {row[key_field_index]: row for row in arcpy.da.SearchCursor("CsvTable", fields)}
# update the original table
with arcpy.da.UpdateCursor(in_table, fields) as cursor:
for row in cursor:
try:
key = row[key_field_index]
new_row = list(csv_rows[key])
for i, f in enumerate(fields):
new_row[i] = get_true_value(f, new_row[i])
cursor.updateRow(new_row)
except KeyError:
print(f"Key {key} not found in update table.")
... View more
09-01-2022
12:39 AM
|
2
|
0
|
1172
|
|
POST
|
The tool only generates a 1:1 table, the match field and file name have to be exactly the same. With this little script, you can do what you want: # same parameters as in the tool
in_table = "TestPoints"
in_folder = r"N:\ags1_daten\gewaesserkataster\Projekt\Bearbeitung\test"
out_match_table = r"memory\match2"
key_field = "OBJECTID"
input_data_filter = "*" # eg "*.jpg"
relative_path = True
from pathlib import Path
# create match table
p = Path(out_match_table)
match_table = arcpy.management.CreateTable(str(p.parent), str(p.name))
arcpy.management.AddField(match_table, "Filename", "TEXT")
arcpy.management.AddField(match_table, "MatchID", "LONG")
# get all files that match your filter
in_files = list(Path(in_folder).glob(input_data_filter))
# for each row in in_table, get all files that match the key field or start with key field followed by "_"
with arcpy.da.InsertCursor(match_table, ["MatchID", "Filename"]) as i_cur:
with arcpy.da.SearchCursor(in_table, [key_field]) as s_cur:
for row in s_cur:
key = str(row[0])
for f in in_files:
if f.stem == key or f.stem.startswith(key + "_"):
fn = f.name if relative_path else str(f)
i_cur.insertRow([row[0], fn])
... View more
08-31-2022
11:26 PM
|
2
|
10
|
7473
|
|
POST
|
Well, "they" are kinda wrong. There are multiple contexts in which you can use Arcade, so called "profiles". For example Labeling, Attribute Rules, Popups. Different profiles have different globals and functions they can access. This is often done for performance reasons. Eg its's OK to load a feature layer and intersect it with a feature if you are working with a popup. But you can't do that in the Labeling profile, because it would be too slow to do the same operation for all features in the map extent. You can find a list of the different profiles here: Profiles | ArcGIS Arcade | ArcGIS Developers If a function is only available to some profiles, it is explicitly stated in the Function Reference: Function Reference | ArcGIS Arcade | ArcGIS Developers
... View more
08-31-2022
10:27 PM
|
0
|
0
|
3914
|
|
POST
|
Hmmm, interesting. I'm still on 2.8, so I can't test it. @sofoo Assuming you use Pro 2.9 or later, Does this label expression work for feature classes? Expects($feature, "*")
var allFields = []
for (var j in $feature){
Push(allFields, j)
}
return allFields
... View more
08-31-2022
06:26 AM
|
0
|
2
|
3927
|
|
POST
|
First, the following script works fine on a hosted feature layer, but on a feature class in a file geodatabase, it only returns the first field (ObjectID). Confirmed. The expression works for Feature Services, but not for features from a FGDB or EGDB (Microsoft Server). You can access the fields by using $feature.Field, but only OBJECTID abd GlobalID are available in the attributes dictionary: This seems like a bug.
... View more
08-31-2022
03:27 AM
|
0
|
0
|
3973
|
|
POST
|
Field Calculator, Arcade: if($feature.Name == "Atlantic Croaker" && $feature.Percentage == 5050) {
return $feature.Value
}
return null
... View more
08-31-2022
02:58 AM
|
0
|
0
|
2667
|
|
POST
|
Create an appropriate symbol that shows both location and direction. Eg a point with some form of arrow Rotate the symbol based on the field values: How To: Rotate point marker symbols in ArcMap (esri.com) If you only send the shapefile, the receiving person will have to do that again themselves. Symbology is not saved withion the shapefile. You could send the shapefile and a layerfile with this configuration or upload the coinfigured layer to AGOL or Portal and share the web layer.
... View more
08-31-2022
02:15 AM
|
0
|
0
|
1056
|
|
POST
|
start the "Select Layer By Attribute" tool set the input rows to your layer, selection type to "new selection" create a new SQL expression BOTTOMSAND - TOPSAND >= 3.5 Apply
... View more
08-31-2022
01:47 AM
|
2
|
0
|
2849
|
| 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
|