POST
|
This absolutely worked. I was able to upload the FGDB, modify the type Keyword through AGO Assistant, and the updated keyword was respected by the clone_items method when cloning maps and their feature services.
... View more
11-25-2022
09:00 AM
|
0
|
0
|
686
|
POST
|
Following the guidance at https://developers.arcgis.com/python/guide/cloning-content/ , I have been able to successfully clone items from one organization to another either individually or by identifying a map and cloning the content. When cloning simple feature services, this works fine. When cloning more complex feature collections that are relational databases with great-grandchildren tables, the clone function fails with an error: IndexError Traceback (most recent call last) c:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_clone.py in clone(self) 3697 ] -> 3698 self._add_features( 3699 new_layers, c:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_clone.py in _add_features(self, layers, relationships, layer_field_mapping, spatial_reference) 2535 object_id_field = layers[related_layer_id].properties["objectIdField"] -> 2536 object_id_mapping[related_layer_id] = { 2537 related_layer_features[i]["attributes"][ c:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_clone.py in <dictcomp>(.0) 2538 object_id_field -> 2539 ]: add_results[i]["objectId"] 2540 for i in range(0, len(related_layer_features)) IndexError: list index out of range During handling of the above exception, another exception occurred: _ItemCreateException Traceback (most recent call last) <ipython-input-52-033330901c43> in <module> 1 folder = 'Survey-FFRTD_1_4' ----> 2 FFRTD_1_4_hstdsrvc = target.content.clone_items(items = [FFRTD_1_4_hstdsrvc], folder=folder) ... -> 3767 raise _ItemCreateException( 3768 "Failed to create {0} {1}: {2}".format( 3769 original_item["type"], original_item["title"], str(ex) _ItemCreateException: ('Failed to create Feature Service FFRTD_1_4: list index out of range', <Item title:"FFRTD_1_4" type:Feature Layer Collection owner:<Ownername) I am not a skilled programmer, but have looked through the clone class and wonder if the search for related objects does not walk the full path of possible related objects iteratively. Could this be resolved? If not, perhaps there could be a method for updating the typeKeyword? As I could not clone the deep relational databases, I downloaded them using the create replica (with attachments) function off of he REST endpoint. I then uploaded to the destination organization. While this works well, it does not update the typekeyword as the clone function might. This means that attempting to clone objects that rely on the database fail. I would like to be able to update the typeKeyword of the uploaded database, so that parameterizations of maps and apps can be cloned without attempting to clone the (already cloned) relational database. While I can list the typeKeywords from the item after retrieving it with the GIS.get().items for a Feature Service that has been successfully cloned, I cannot find a way to update the typekweyword for an existing layer uploaded as a FGDB. Is it possible to update the typeKeyword attribute of a feature collection through the ArcGIS API?
... View more
11-22-2022
01:21 PM
|
0
|
2
|
805
|
POST
|
Well, I got a bit closer today, grokked some of the documentation a little better, but it still feels a bit like throwing spaghetti... I think a clear explanation of the behavior of ${# within and outside of the summary section and in combination with different functions, primarily stats and getValue would be helpful. Progress: ${#Planting_Unit | stats: “sum,Acres_Planting_Unit, PU_Acres”}${PU_Acres | round:2} ${/} in the summary section will sum a numeric field and round to two decimals. I have this placed in a single cell in the above tables. ${#MonitoringEvent_PlantingUnit | stats: “first, Date_Unit_Monitored_PUME, MostRecent_PUME” | orderByFields:"Date_Unit_Monitored_PUME DESC”}${MostRecent_PUME | format:"DD/MM/YYYY”} ${/} Will give the most recent date formatted as a date placed in a single cell of a table in the summary section. Still stuck: ${#Invasive_Vegetation_Unit} ${Invasive_Veg_Unit_polygon | getValue: “area”:”acres”:”geodesic”} ${/} The syntax checker will accept this, but no value is returned. I was hoping for a comma delimited list of the acres of the polygons as a step towards a solution. I'd love the ability to create a variable from the getValue function that could be passed into the stats function, or access to sum(), or something, please. Otherwise, best practice might be to maintain a user-defined acres field and sum on that (as I did in the first row in the original post). As there is no trigger function in table management for auto-populating this on creation of the record, it is less satisfying as the acres field would rely on manual or scheduled updates. Regress with progress: ${#Planting_Unit | orderByFields: “Planting_Unit_ID ASC”} ${Planting_Unit_ID} In the first cell of a table will list the rows sorted on Unit id (an alpha id). HOWEVER, the statement ${Planting_Unit_polygon | getValue:"area":"acres":"geodesic”} ${/} In the last cell of the row no longer produces the acres value, while it will with an unsorted table--I double checked by removing the sort and the acres appeared again. I would like to be able to sort the table based on one field while still having the getValue function return acres. TIA for any help. Any thoughts @IsmaelChivite ? @DougBrowning
... View more
06-16-2022
05:38 PM
|
1
|
0
|
411
|
POST
|
So, I’m finally getting the hang of some aspects of generating Survey 123 reports, but there are a couple of items still eluding me. Any help appreciated. Summarizing repeat areas or lengths based on geometry If I have a field that I calculate area or length into, I can summarize on that field with a stats function. If I am listing the number of rows in a repeat, I can calculate the area from a getValue function. But I cannot figure out the syntax to summarize the area or length for all repeats based on geometry. Rounding values or formatting dates derived from the stats function I’d like help on how to format the output of the stats function to get date formatting and round to a decimal place. Sorting repeats If I am generating a listing of all rows in a repeat, how do I control the order in which it is displayed? Desired output: Current template: $<$summary> Revegetation and Monitoring Site Report Site Features Summary Feature Count Total Acres Planting Units Get value count: ${Planting_Unit | getValue:"count"} Stats count: ${Planting_Unit | stats: “count, objectid”} ${Planting_Unit | stats: “sum,Acres_Planting_Unit”} Invasive Vegetation Units ${Invasive_Vegetation_Unit | stats: “count, objectid”} Sum the area in acres based on geometry. Observation Units ${Observation_Unit | stats: “count, objectid”} Sum the area in acres based on geometry. Monitoring Events Summary Event Count Most Recent Event Planting Unit Monitoring Event ${MonitoringEvent_PlantingUnit | stats: “count, objectid”} ${MonitoringEvent_PlantingUnit | stats: “first, Date_Unit_Monitored_PUME” | orderByFields:"Date_Unit_Monitored_PUME DESC”} Invasive Veg Monitoring Events ${MonitoringEvent_Invasive_Veg | stats: “count, objectid”} Show the most recent monitoring event date. $</> Planting Units IV Unit ID Note Acres ${#Planting_Unit} ${Planting_Unit_ID} ${Planting_Unit_Note} ${Planting_Unit_polygon | getValue:"area":"acres":"geodesic"} ${/} Invasive Vegetation Units IV Unit ID Cover Ratio Acres ${#Invasive_Vegetation_Unit} ${objectid} ${Invasive_Veg_CoverRatio_IVU_ | getValue:""} ${Invasive_Veg_Unit_polygon | getValue:"area":"acres":"geodesic"} ${/} Planting Unit Monitoring Event Planting Unit Monitoring Event ID Survival Rate Acres ${#MonitoringEvent_PlantingUnit} ${Planting_Unit_ME_ID} ${Survival_Rate_PUME | getValue:""} ${Date_Unit_Monitored_PUME} ${/}
... View more
06-15-2022
06:45 PM
|
0
|
2
|
732
|
POST
|
The solution to this issue was that I had created a custom field for the assignments, and made it required. Only the base Workfoce fields should be required.
... View more
04-05-2022
02:30 PM
|
1
|
0
|
668
|
POST
|
@CraigGillgrass thanks for your reply. I have not created any pre-planned work areas for the worker map. I have removed the asset layer in trying to restore the worker map. The one I believe I had in there indeed did not have the correct permissions set (oi!), but, removing it does not seem to have restored functionality to the map. I have a case started with ESRI technical support. Your question prompted me to discover another potential cause having to do with workers and permissions. I'll send these ideas on to the support tech I'm working with. Thanks for your helpful response.
... View more
02-14-2022
09:56 AM
|
0
|
0
|
755
|
POST
|
Hi @CraigGillgrass , I'm having a worker map show up as black when reloaded. No errors are being thrown and the map displays fine in the administrative console. I have added assets to the map, but have not removed any of the default layers. The permissions have not been changed nor have feature service settings on the assets or the assignments or workers. Any thoughts on what to check? Thanks for any suggestions!
... View more
02-11-2022
01:33 PM
|
0
|
0
|
762
|
POST
|
Taking off on the thread found at: https://community.esri.com/t5/arcgis-online-questions/append-data-tool-failing-to-maintain-attachments/m-p/1116106 in regard to appending to feature services while maintaining attachment and relationships. Here are the steps I am using to accomplish this. I understand that modifying a local full version of the database and overwriting it to accomplish updates may be offered as a work around. This is less than desirable as a work around because of the potentially large upload sizes, and the inherent risk involved in replacing that many records in bulk. What I detail here is a method for updating parent and child feature service layers in ArcGIS Online through a detailed append operation. Needed is a destination feature service with at least one parent-child relationship and attachments enabled on both layers. Each layer will also need an additional GUID type field for storing temporary global id's as part of the append process. The source features an be local FGDB layers or feature services with attachments. While the parent layer can be successfully appended from either a local or another feature service source with attachments intact, none of the child layers will successfully append with attachments intact. In order to make the append with attachments and relationships I follow these steps: Identify by selection in a feature service the source features to append. Calculate the feature global id into the temporary GUID field to preserve the value. Export to a local FGDB with maintain global ids enabled (maintain global id's should work for this step and this step only). Be sure to have maintain attachments enabled. Append the parent layer from the feature service selection or the local FGDB. Do not check maintain Global ID's, as this will cause failure. Do check maintain attachments. Use the field map option if field names do not match between source and target. For the child layers, the append occurs in two passes, one for features, another for attachments. Append the selected child features without the maintain attachments or maintain global id's enabled as these cause failure. The values in the parentglobalid field of the child layer will be preserved, and will match the values in the temporary GUID field on the parent layer. Join the child layer to the parent layer by matching the temporary GUID field on the parent layer to the parentglobalid field on the child layer and validate the join to ensure you get a reasonable number of matches. Calculate the new parent global id value into the temporary GUID field on the child layer. Calculating into the parentglobalid field will cause error as the join is based on that field. Remove the join. Calculate the GUID values in the temporary field on the child layer into the parentglobalid field. These values will now match to a parent feature. Remove the attachments from the child layer (recall parent attachments should have transferred with that append). To do this, I modified the code found in this technical article: https://support.esri.com/en/technical-article/000011912 import arcpy from arcpy import da import os import csv inTable = arcpy.GetParameterAsText(0) inTable_RelField = arcpy.GetParameterAsText(1) fileLocation = arcpy.GetParameterAsText(2) out_csv = arcpy.GetParameterAsText(3) out_csv_full = os.path.join(fileLocation, out_csv) with open(out_csv_full, 'w', newline='') as csvfile: csv_writer = csv.writer(csvfile) csv_writer.writerow(["ATT_NAME", "ATTACHMENTID", "Feature_ID", "Image_Path"]) with da.SearchCursor(inTable, ['DATA', 'ATT_NAME', 'ATTACHMENTID', inTable_RelField]) as cursor: for item in cursor: attachment = item[0] filenum = "ATT" + str(item[2]) + "_" filename = filenum + str(item[1]) arcpy.AddMessage("Filename: {} \n Filenum: {}".format(filename, filenum)) image_Path = fileLocation + os.sep + filename csv_writer.writerow([str(item[1]), str(item[2]), str(item[3]), image_Path]) open(fileLocation + os.sep + filename, 'wb').write(attachment.tobytes()) del item del filenum del filename del attachment Which could absolutely be improved upon but does have the helpful feature of creating the file needed to use the Add Attachments tool. Add the attachments using the add attachments tool. Note that the tool requires a local copy of the layer and attachments table. Note too that the attachment table relates to the child layer via the REL_GLOBALID field. This value will now have changed in the feature service with the append of the selected child features. To update the global id's in the REL_GLOBALID field, calculate the new global id values for the child features into the temporary GUID field. Use Feature to Point tool and Intersect the points by the child features (or use spatial join). Use the resultant feature to join onto the attachments export table and the appended feature service child features (using ORIG_FID and the local child layer ObjectID, for instance), and update the REL_GLOBALID field to match the values in the global id field of the desired target feature service child features. Use the Add attachments tool, referencing the updated table and the attachments folder. I've experienced parallel behavior trying to use the Update Data on the feature service details overview page where the parent layer will update, but related child layers will fail to append properly. The above method, while doable, is pretty heroic in level of effort compared to the idea of just using the append tool with maintaining attachments, and, ideally, some more automated method for updating the appended relationship keys. Is that something that is in the development pipeline? Thanks for reading this far!
... View more
12-14-2021
03:41 PM
|
2
|
0
|
619
|
POST
|
Hi @MJBiazar , thanks for this confirmation. Did this work at one point? Memory tells me it did... In ay case, do when the bug will be addressed? It would be great to have the edit hot link on the popup to edit attributes giving the user fewer clicks just to get to the attributes.
... View more
12-07-2021
02:41 PM
|
0
|
0
|
1447
|
POST
|
Try switching the map back to the classic map viewer (open in, save as), and you should find the edit capabilities are available. You will loose some functionality (like filters on labels 😞 ). I just discovered this this morning after spending several hours configuring new views, only to find them un-editable as I included them in maps and apps. Very discouraging, especially with a training session coming up this very morning. I have avoided using the Standard Map Viewer for field applications as I've found it to be too problematic. I noticed that the views were editable in the classic map versions I use for the field. Just a little further on this as more than an inconvenience: other agencies are relying on this layer and have included it in their maps and apps. Republishing the feature service in this case does not just affect me and the many places the layers appear in, but would require others to change sources across multiple implementations with associated reconfigurations. Will this get fixed? Standard map viewer still seems pretty Beta.
... View more
12-06-2021
08:09 AM
|
1
|
0
|
582
|
POST
|
@MJBiazar Thanks for that. Sorry to be dense, but I'm then not sure how to overwrite just that one child layer of the parent dataset. Or, would I need to overwrite the entire feature service with the geodatabase with the appended featureclass (and without the now merged child fc)? If I do that, Do I then need to recreate any dependent view layers, or would those update in response to the change in the source?
... View more
11-08-2021
11:48 AM
|
0
|
5
|
911
|
POST
|
I guess I will wait. I tried from both the feature service layer and from a downloaded FGDB version with the same result. Thanks for the word on the release, @MJBiazar .
... View more
11-08-2021
11:35 AM
|
0
|
1
|
922
|
Title | Kudos | Posted |
---|---|---|
1 | 03-11-2021 12:45 PM | |
1 | 06-16-2022 05:38 PM | |
1 | 04-05-2022 02:30 PM | |
2 | 12-14-2021 03:41 PM | |
1 | 12-06-2021 08:09 AM |
Online Status |
Offline
|
Date Last Visited |
12-19-2022
05:04 PM
|