POST
|
We're running into an issue at our organization where Python tools built with ArcGIS Pro 2.9.7 will run for a user in ArcGIS Pro 3.1.3, but it takes several attempts to actually get the entered parameters to stick. Clicking run or even clicking another text box for another parameter will make prior entered values clear/drop. All the parameters for the particular tool are text input. After selecting run or sometimes selecting another input text box for another parameter: Has anyone else run into this issue in ArcGIS Pro 3.1+, or was there a change to tbx files in ArcGIS Pro 3.1 that might explain this? We haven't tested in toolboxes created in ArcGIS Pro 3.1+ continue to have the issue- it may be a slight compatibility problem.
... View more
12-27-2023
02:22 PM
|
0
|
0
|
364
|
POST
|
Update: One of the fields was an integer type in the hosted feature service, and the input value from Knack was a string. I changed the field type, but it's still not working. New errors have arisen- one feature's error code is 1003: Operation rolled back and the other is 1000: String or binary data would be truncated. The statement has been terminated. Original post: I am working on updating a hosted feature service from a spatial data frame extracted from the Knack API. I used the Python API documentation example posted here. Script snippet: svc_lyr = svc_url + "/0"
ft_lyr = FeatureLayer(svc_lyr)
print(ft_lyr)
ft_set = ft_lyr.query(where="1=1")
if len(ft_set) > 0:
print(ft_set.features[0])
template_ = deepcopy(ft_set.features[0])
print(template_)
input_features = []
add_ft = deepcopy(template_)
# records is a list of json records extracted from Knack API with
# attributes, similar to feature set features.
for r in records:
add_ft.attributes['ProjectKey'] = r['ProjectKey']
add_ft.attributes['ProjectName'] = r['ProjectName']
latitude = r['Latitude']
longitude = r['Longitude']
add_ft.geometry = geometry.Geometry({"x" : longitude, "y" : latitude, "spatialReference" : {"wkid" : 4326}})
input_features.append(add_ft)
ft_lyr = FeatureLayer(svc_lyr)
add_result = ft_lyr.edit_features(adds=input_features)
print(add_result) When I run the script, no data is added and I get the error: {'addResults': [{'objectId': 7, 'uniqueId': 7, 'globalId': None, 'success': False, 'error': {'code': 1000, 'description': 'No mapping exists from object type System.Object[] to a known managed provider native type.'}}], 'updateResults': [], 'deleteResults': []} I'm not finding much about this error related to this edit_features function... but given that I'm taking a deepcopy() to create the feature template, I'm unsure how the mapping could be off... Any insights would be much appreciated!
... View more
09-08-2023
11:54 AM
|
0
|
1
|
575
|
POST
|
I have an Arcade script combining features from multiple feature classes between two Portals (which is what the Prod vs. QA refers to) to chart summaries of the data. All last week, the Dashboards were loading for me, but not for the end-user, who is the ended audience for this solution. This week, her issue has been passed onto me as well, which is great since I can now reproduce the issue, but not great because my troubleshooting is leading to a dead-end. Last week, the data expression was successfully combining the feature classes and returning a Feature Set that I could chart in one place as pictured: This morning, when I loaded the app, all charts that have an expression pulling from the external Portal site returns data source errors:
var portal = Portal("https://org.maps.arcgis.com")
var fcLst = [
"Major Structures",
"Buried Structures",
"Utilities",
"Culvert",
"Drainage Line",
"Drainage Point",
"Drainage Polygon",
"Earthworks",
"Fence",
"Gate",
"Pavement",
"Wall"
]
var fcDict = {
"0": "Major Structures Point",
"2": "Buried Structures",
"3": "Utilities",
"4": "Culvert",
"5": "Drainage Line",
"6": "Drainage Point",
"7": "Drainage Polygon",
"8": "Earthworks",
"9": "Fence",
"10": "Gate",
"11": "Pavement",
"12": "Wall"
};
var idx = 0
var fsId = "<item_id>";
var prodfsId = "<item_id_for_external_portal_item_added_to_the_same_organization_portal>";
var features = [];
var feat;
var count_lst = [];
for (var fc in fcLst) {
//There used to be a feature layer with ID 1 that was retired & no longer exists. Skip feature layer id = 1
if (idx != 1) {
var fcName = fcDict[Text(idx)];
var lyr = FeatureSetByPortalItem(portal, fsId, idx);
var prodLyr = FeatureSetByPortalItem(portal, prodfsId, idx);
var empty = IsEmpty(lyr);
if (empty != false){
return null
}
else{
var ftSetGrouped = GroupBy(lyr,
[
{name: 'CP', expression: 'CP'},
//{name: 'Asset_ClassPath', expression: 'Asset_ClassPath'}
],
[
{ name: 'TotalCount', expression:"1", statistic: "COUNT"}
]
);
var prdSetGrouped = GroupBy(prodLyr,
[
{name: 'CP', expression: 'CP'},
],
[
{ name: 'TotalCount', expression:"1", statistic: "COUNT"}
]
);
for (var f in ftSetGrouped){
//return f
feat = {
'attributes':{
'CP': f['CP'],
'environment': "QA",
'Feature_Class': fcName,
'count': f['TotalCount']
},
};
Push(features, feat);
}
for (var f in prdSetGrouped){
//return f
feat = {
'attributes':{
'CP': f['CP'],
'environment': "Prod",
'Feature_Class': fcName,
'count': f['TotalCount']
},
};
Push(features, feat);
}
}
idx++
};
var combinedFts = {
fields: [
{ name: 'CP', type: "esriFieldTypeString"},
{ name: 'environment', type: "esriFieldTypeString"},
{ name: 'Feature_Class', type: "esriFieldTypeString"},
{ name: 'count', type: "esriFieldTypeInteger"}
],
geometryType: "",
features: features
};
return FeatureSet(Text(combinedFts)) What's even more curious is that the web map that displays both feature services in the same dashboard is loading all of the data just fine. The outage appears to only apply to the data expression. Does anyone have ideas about potential issues? One maybe problem is that last week, the Dashboard would prompt the user to sign into the external portal site, which makes sense to ensure the user accessing the dashboard has the correct permissions for the external data, but that isn't happening this week.
... View more
07-24-2023
09:54 AM
|
0
|
1
|
669
|
POST
|
I realized that if you embed the map in the upper part of the side panel (within the side panel area, but at the opposite side of the panel area that will contain the collapsible part) it's not perfect, but better. Not obvious behavior though!
... View more
06-21-2023
05:45 PM
|
0
|
0
|
493
|
POST
|
@JakeSkinner @Kepa this was the original method I attempted for this process, but it is not available in Enterprise 10.8.1, only in ArcGIS Online. When I attempted the ArcGIS API for Python append method, I got the error Exception('Append only available on ArcGIS Online.')ERROR:root:Append only available on ArcGIS Online. When using the arcpy.management.Append() method, the process works if ArcGIS Pro is manually signed into at run time- it even works if ArcGIS Pro is closed out then the script is run shortly after. But this needs to be a scheduled process, and when it's run as a service after hours, it fails on the arcpy append step saying that the target feature service is unavailable or unsupported (even though a truncate step using the ArcGIS API for Python truncate successfully runs on that same service prior to that failure). So does this mean that both append and edit_features are unavailable options in Portal? The edit_features() method I used in the code posted above works great and is super efficient in ArcGIS Online (it consistently took about 2 minutes to append 100,000 points). I'd love to use it in Portal, too if possible...
... View more
03-03-2023
08:18 AM
|
0
|
0
|
866
|
POST
|
Hello, I am trying to automate updates of a hosted feature service in Portal 10.8.1. I have a method to convert the feature class to a feature set, then pass the array of features from that feature set to the arcgis.features.FeatureLayer.edit_features(adds=[ftSet_array]). This function when run using a Portal feature service doesn't append any data. When I print the edit result, I see the following message: {'addResults': [{'objectId': None, 'success': False, 'error': {'code': 10500, 'description': 'class org.json.JSONObject cannot be cast to class com.esri.core.geometry.Geometry (org.json.JSONObject and com.esri.core.geometry.Geometry are in unnamed module of loader java.net.URLClassLoader @614ddd49)'}}], 'updateResults': [], 'deleteResults': [], 'attachments': {'addResults': [], 'updateResults': [], 'deleteResults': []}} The exact same script/code works and appends the data as expected and incredibly fast/efficiently on a copy of the hosted feature service in ArcGIS Online. In the snippet below, I converted a feature class to a feature set called add_features. adds_array = []
for a in add_features:
adds_array.append(a)
total_adds = len(adds_array)
if total_adds > 10000:
print_to_stdout("Incrementally appending new data...")
n = 10000
inc_adds_array = [adds_array[i * n:(i + 1) * n] for i in range((len(adds_array) + n - 1) // n )]
for lst in inc_adds_array:
#print(lst)
edit_result = target_ftlyr.edit_features(adds=lst)
print("Edits summary: {0}".format(edit_result))
print("{0} total features successfully added to the feature service!".format(total_adds))
else:
edit_result = target_ftlyr.edit_features(adds=adds_array)
print({0} total features successfully added to the feature service!".format(str(len(adds_array)))) Is the FeatureLayer.edit_features() only available in ArcGIS Online?
... View more
03-02-2023
04:50 PM
|
0
|
3
|
1189
|
POST
|
Hello, I am working with Web AppBuilder Developer Edition version 2.26. I wrote a simple function that is supposed to build a FeatureLayer object using the supplied service URL, then supply an array of edits. When debugging with a breakpoint, the svcUrl variable in the code below is populated with the correct service URL, but I am getting the following error: TypeError: Cannot read properties of null (reading 'path') I included 'esri/layers/FeatureLayer' in the define list and declared as a function called FeatureLayer. _applyFtEdits: function (svcUrl, edits) {
var ftLyr = new FeatureLayer({
url: svcUrl
});
ftLyr.applyEdits(edits);
console.log("APPLY FEATURE EDITS CALLED.");
}, I am working with a secure feature service published in an organization Portal, but the app is being tested in ArcGIS Online. Is this error potentially the result of not supplying a token to authenticate? The app prompts a sign-in to the Portal hosting the service on load. I was hoping that would cover authentication...
... View more
02-12-2023
10:08 AM
|
0
|
0
|
695
|
POST
|
Hello, Is there an easy way to find license levels required for ArcGIS Python modules (whether the API or arcpy)? In some module documentation on the ArcGIS site, there is license requirements information available at the bottom of the page (e.g. Append), but not for all (e.g. Data Cursors). I need to be able to identify if existing python scripts will run on a newly purchased license if it's only Basic level. All of the other organization licenses are Advanced. I'm finding many of the modules used lack any licensing information in ArcGIS documentation.
... View more
01-17-2023
10:58 AM
|
0
|
1
|
591
|
POST
|
We have some WebApp Builder applications created with Developer edition. We'd like to use a curated group so that users that are part of that Portal group (and not other users) can add that secure data on-the-fly in the map. If you are not signed in as a user with access to the curated group, we would expect a blank layer list in the Add Data widget given the way the permissions are granted at the layer and group level. If you are signed into the Portal as a user with access to the group, then the layer list would be populated with the group content. At this time, the widget is granting access to viewing layers in that secure group to all users regardless of group membership, yet when Details is clicked to view the item page when signed out, it prompts a login. At that level to access the item page, the group and item sharing settings behave as expected, yet at the same time, the data is viewable in the map while it shouldn't be. Is this a bug?
... View more
11-17-2022
08:07 AM
|
0
|
0
|
334
|
POST
|
Hello, My team is looking for a way to configure a map service (published from ArcGIS Pro 2.9.4, Portal version is 10.7.1) so that for all attributes with domains, the coded values display across the board in tables and pop-ups instead of the domain descriptions. We are using the map service in a third party map application in addition to our ArcGIS Portal apps, so we're looking for something that can be controlled at that service level so the change applies there as well. It appears that unchecking the option in the attribute table in ArcGIS Pro to change how domain values are displayed doesn't translate to the service level post-publishing. Thanks in advance!
... View more
11-15-2022
05:02 PM
|
0
|
0
|
591
|
POST
|
Hi @Anonymous User does this mean that for 10.6 to 10.8, a registered Field Maps mobile app will operate similarly to Collector, where the form is based on the pop-up configuration in the web map and has the same capabilities as Collector? I just registered Field Maps on an app in Enterprise 10.7 and curious about next steps to configure and if I should expect much difference between past experience configuring Collector on this version. It's unclear at this point if there's opportunity to upgrade to 10.8.1 and beyond, and ArcGIS Online isn't an option at this time.
... View more
08-24-2022
09:23 AM
|
0
|
0
|
858
|
POST
|
I am also struggling with this issue. At the moment, my solution is after new features are added, use an update cursor on the date fields to convert them using pytz, tzinfo. You can also use the datetime package timedelta module in the update cursor. Not ideal, since it requires editing to be enabled on the Portal item, but so it is...
... View more
07-29-2022
03:53 PM
|
0
|
0
|
295
|
POST
|
Hello @sxw_eaglegis and @MatthewObuck, I'm running into the same problem. I'm trying to run arcgis.features.append on hosted feature services in Portal. The ArcGIS Enterprise version is 10.8.1, and the upload format I am working with is a filegdb. The error is the same as Matthew described, that this append method is only available to ArcGIS Online. Any info would be greatly appreciated!
... View more
07-28-2022
12:19 PM
|
0
|
0
|
299
|
POST
|
Hi @TonghuiMing and @DavidMartinez, this was a big improvement, but is there any chance that adding multiple link actions will be possible? In the same example above, I'd ideally like to both jump to the block and open a view by clicking the 'More Info' button. The way my app is configured, because the primary data users interact with are fisheries sites, and that is the view below that map that's opened by default, I have the link set to jump to the block, which provides expected results. But if they are using the Access Site lists to browse boat launches/trails/harbor data, I have it set to open the view below as that isn't the view that's open by default, so jumping to the block could be confusing as the info shown won't match the site information they selected. Further, because it doesn't also jump to the block in addition to opening the view, the button only makes some semblance of sense if the user's screen is large enough to see that something at the bottom of the screen changed. Let me know any thoughts on that, or if configuring multiple link types is on the horizon for a later release.
... View more
05-18-2022
04:55 PM
|
0
|
1
|
2792
|
POST
|
That did it! Thank you for the guidance. Would be great if similar to other symbology defaults, scales matched distribution of data. That's great to know that Map Viewer cluster symbology doesn't do that automatically.
... View more
02-28-2022
05:26 PM
|
0
|
0
|
551
|
Title | Kudos | Posted |
---|---|---|
1 | 01-07-2021 09:44 AM | |
1 | 08-27-2021 09:29 AM | |
1 | 06-09-2021 09:49 AM | |
1 | 08-24-2021 10:44 AM | |
1 | 06-09-2021 09:41 AM |
Online Status |
Offline
|
Date Last Visited |
02-13-2024
02:29 PM
|