|
POST
|
Many years ago, I took an Esri instructor-led class where I learned that things like geometric networks, trace networks, parcel fabrics, etc could be lumped together under an umbrella term called "behaviors". When I Google that term, however, I do not find it in any of the Esri documentation. Is there a collective noun that can be used for special functionality that requires the feature classes that participate in it to be in a feature dataset?
... View more
03-04-2025
01:27 PM
|
0
|
6
|
1647
|
|
POST
|
This is in ArcGIS Pro 3.3.0. When I am setting up a definition query in Pro on my address point layer, there doesn't appear to be a function that reduces the options in the pick list when you start to enter a value. For example, let's say I'm looking for 400 Main St. If I type in 400 and click the drop-down, shouldn't I see a filtered list of addresses that start with 400? I thought perhaps I needed to click the More button to load the full list of values, but even after doing that, my pick list gives me every possible option in the feature class. If that's not how the definition query menu is designed to work, I want to put in a suggestion on ArcGIS Ideas because this isn't user friendly.
... View more
02-03-2025
07:49 AM
|
0
|
4
|
999
|
|
POST
|
After further testing, I found that the User role cannot edit Utility Networks, but the Publisher role can. However, there is something going on with browser caching that complicates the testing. Here's what I mean: 1. I set my test user as a Publisher. It can edit the UN data in a web map. 2. I change the test user to the User role. The edit button is removed from the web map. 3. I change the test user back to the Publisher role. The edit button does not reappear. Clearing the browser cache does not resolve this issue. 4. If I open an identical copy of the original web map, the editing button reappears. Side note: we use IWA to authenticate. I don't know how this would change with built-in accounts. In general, I think it's odd that the Publisher role is allowed to edit utility networks, given that the additional privileges that come with the Publisher role are all related to publishing items to Portal. Nonetheless, there is something about the Publisher role that allows the users to edit UN services. I should also note that a Data Editor role can edit user-managed services that are pulling data from enterprise geodatabases as long as the Advanced Editing extension is activated. You would think that the same settings would work with a user-managed service that uses the UN, but it does not. This strikes me as a possible bug in 11.3.
... View more
12-26-2024
04:26 PM
|
1
|
0
|
1135
|
|
POST
|
I'm struggling to find a straightforward answer to this question: what privileges are required to edit data in a Utility Network in a web map in Enterprise Portal 11.3? The normal Data Editor role does not allow it (even if the Advanced Editing extension is enabled), nor does User or Publisher. However, I have a custom role called Sub Administrator, and everything with that role and higher is able to edit. That leads me to believe there is one or more specific privileges that are required for editing UNs. Anyone have any insight?
... View more
12-26-2024
03:49 PM
|
0
|
1
|
1143
|
|
POST
|
I'm a lot closer now after making quite a few changes. Now I'm getting the error message: A general error occurred: Circular reference detected
ERROR: A general error occurred: Circular reference detected I believe that the error is in line 42. I replaced some info with ... for security purposes. from arcgis.gis import GIS
gis = GIS("home")
# Import arcpy module
from arcgis.gis import GIS
from arcgis.features import FeatureLayer, GeoAccessor # might not need that last one?
import time, arcpy, os, datetime
# Variables
s123Layer = r'https://services.arcgis.com/.../FeatureServer/0'
report_copy_url = r'https://services.arcgis.com/.../FeatureServer/0'
try:
item = gis.content.get("...")
feature_layer = item.layers[0]
field_name = "ReportDate"
query_result = feature_layer.query(out_statistics=[{"statisticType": "max", "onStatisticField": field_name}])
milliseconds = query_result.features[0].attributes[f"MAX_{field_name}"]
date_time = datetime.datetime.utcfromtimestamp(milliseconds / 1000.0)
max_date = date_time.strftime('%Y-%m-%d %H:%M:%S')
print("Most recent report date in ...:", max_date)
feature_layer = FeatureLayer(s123Layer, gis=gis)
query = f"submission_date_and_time > timestamp '{max_date}'"
selected_features = feature_layer.query(where=query)
print(f"Number of new features to append to ...: {len(selected_features)}")
###### SCRIPT WORKS TO THIS POINT #######
if len(selected_features.features)>0:
fm = [{'ObservationDate':'ReportObservationDate',
'CampsiteDescription':'ReportCampsiteDescription',
'FollowUpRequest':'ReportFollowUpRequest',
'SubmitterName':'ReportSubmitterName',
'PreferredContact':'ReportSubmitterPreferredContact',
'EmailAddress':'ReportSubmitterEmailAddress',
'PhoneNumber':'ReportSubmitterPhoneNumber',
'submission_date_and_time':'ReportDate'
}]
targetLayer = FeatureLayer(report_copy_url,gis=gis)
targetLayer.append(selected_features.features, field_mappings = fm, return_messages = True)
else:
print("No new reports to load into ...")
except Exception as e:
print(e)
arcpy.AddError(str(e)) @JakeSkinner @Clubdebambos - do you see any issues?
... View more
12-04-2024
01:19 PM
|
0
|
0
|
1084
|
|
POST
|
Thank you! That worked for error trapping. I fixed the issue, but field mapping doesn't work. if len(selected_features.features)>0:
field_mapping = {'ObservationDate':'ReportObservationDate',
'CampsiteDescription':'ReportCampsiteDescription',
'FollowUpRequest':'ReportFollowUpRequest',
'SubmitterName':'ReportSubmitterName',
'PreferredContact':'ReportSubmitterPreferredContact',
'EmailAddress':'ReportSubmitterEmailAddress',
'PhoneNumber':'ReportSubmitterPhoneNumber',
'submission_date_and_time':'ReportDate'
}
sdf = feature_layer.query(where=query)
feature_layer.edit_features(adds = sdf, field_mapping=field_mapping) Line 12 generates the error: FeatureLayer.edit_features() got an unexpected keyword argument 'field_mapping'
ERROR: FeatureLayer.edit_features() got an unexpected keyword argument 'field_mapping' I tried using field_mappings (plural) since that's listed in the FeatureLayer append method as a keyword, but no luck. So then I thought I'd try the append method, but I'm getting Unknown Error (Error Code: 500) in response to this: if len(selected_features.features)>0:
field_mapping = [{'ObservationDate':'ReportObservationDate',
'CampsiteDescription':'ReportCampsiteDescription',
'FollowUpRequest':'ReportFollowUpRequest',
'SubmitterName':'ReportSubmitterName',
'PreferredContact':'ReportSubmitterPreferredContact',
'EmailAddress':'ReportSubmitterEmailAddress',
'PhoneNumber':'ReportSubmitterPhoneNumber',
'submission_date_and_time':'ReportDate'
}]
sdf = feature_layer.query(where=query)
feature_layer.append(sdf,
field_mappings = field_mapping,
return_messages = True) My guess is that the error code is the result of not specifying an item_id, since sdf is a selection of records and not an entire item. Any ideas on what to try next? I wish the ArcGIS API for Python documentation consistently provided sample code like the arcpy documentation does.
... View more
11-21-2024
08:25 AM
|
0
|
0
|
3059
|
|
POST
|
Just for clarification, I do have the variable feature_layer defined earlier in the script and it's working properly. item = gis.content.get("999999999") # actual item id has been removed for this chat
feature_layer = item.layers[0]
... View more
11-19-2024
02:28 PM
|
0
|
1
|
3072
|
|
POST
|
I still have something wrong, but I don't know how to print error messages because arcpy.GetMessages() doesn't return anything. Is there another way to get the error messages from failed functions? Here's the portion of code that is failing: field_mapping = {'ObservationDate':'ReportObservationDate',
'CampsiteDescription':'ReportCampsiteDescription',
'FollowUpRequest':'ReportFollowUpRequest',
'SubmitterName':'ReportSubmitterName',
'PreferredContact':'ReportSubmitterPreferredContact',
'EmailAddress':'ReportSubmitterEmailAddress',
'PhoneNumber':'ReportSubmitterPhoneNumber',
'submission_date_and_time':'ReportDate'
}
sdf = feature_layer.query(where=query).sdf
feature_layer.edit_features(adds = sdf.to_featureset(), field_mapping=field_mapping) I think line 10 is working because I added a print statement for the sdf variable and got this (confidential information blurred in the screenshot):
... View more
11-19-2024
02:26 PM
|
0
|
0
|
3072
|
|
IDEA
|
In Portal 11.3, we have a web map that is shared with four groups that limit access to people who are trained in editing. We added two web layers to this map that are shared with Organization. When we tried to save the web map, we were prevented from doing so because the layers were not explicitly shared with the same groups as the web map. My suggestion is that Portal should consider items shared with an entire organization as equivalent to being shared with groups. For clarity, we do not want to share these layers with Everyone (e.g. make them public).
... View more
11-19-2024
07:05 AM
|
3
|
1
|
617
|
|
POST
|
I don't have any attachments, @Clubdebambos. Is there a way to do field mapping with the edit_features function? Some of the field names in the input feature layer don't match the target layer.
... View more
11-13-2024
07:25 AM
|
0
|
2
|
3131
|
|
POST
|
I'm new to using the ArcGIS API for Python in an ArcGIS Online Notebook and am looking for help to identify the right function(s) for a data maintenance script I'm migrating from a scheduled task on a server. The start of the script works fine: I select a small number of records from a hosted feature layer. (If it matters, the hosted feature layer is part of a Survey123 survey). I'm struggling with finding the function(s) to: 1. Append those selected records to another hosted feature layer, and 2. On those newly appended records, update the value in the status field to 'Not Reviewed'. The status field does not exist in the source layer, but it does in the target layer. These two steps don't have to be in this order. I'm fine with exporting the records, adding a status field, calculating that 'Not Reviewed' value and then appending the updated records to my target layer. Appreciate any hints that the community can offer!
... View more
11-12-2024
08:39 AM
|
0
|
13
|
4278
|
|
IDEA
|
To add to this excellent idea, the workaround that GT_UTCO offers does not work for users who use IWA SAML to authenticate. I cannot use the SignInToPortal function to force a switch of portals because storing the username and password in the script does not work for IWA (using Active Directory credentials to log in). At this point, my only workaround is to use a Notebook for my all-ArcGIS Online script and leave my portal default on our Enterprise Portal for our other scripts. This breaks our organization's governance guidelines because we don't allow individuals to own maintenance scripts so that scripts stop working when a person leaves the company. Edited to add: I made a mistake in this original post. We use SAML authentication, not IWA.
... View more
11-05-2024
06:41 AM
|
0
|
0
|
1580
|
|
POST
|
@RhettZufelt - regarding "I have a scheduled task that opens/closes Pro every monday night just to keep my sign in active." Can you provide details on this? I've been digging through the arcpy documentation without luck to find a function that will do this because I'm having issues with my account logging out of its connection to our Portal, presumably due to inactivity.
... View more
11-04-2024
10:25 AM
|
0
|
1
|
4380
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a week ago | |
| 1 | a week ago | |
| 1 | 05-08-2024 01:17 PM | |
| 1 | 12-16-2021 07:17 AM | |
| 6 | 04-23-2026 08:57 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|