Layer Selection for Data Validation (Selection not being honored?)

556
0
03-04-2023 09:43 AM
Labels (2)
Keith_Johnson
New Contributor

I am working on ArcGIS Pro 3.0.3 and Portal 10.x as well as AGOL.

What I am trying to accomplish:  I have a layer with a series of polygons, and I want users to be able to digitize a new layer associated with an old layer.  For example, the layer has building footprint, and I want users to be able to create a new layer from satellite imagery, but keep a link between the two layers.  We will call them OriginalFootprint and SketchFootprint.

In essence I want the users to be able to make a single selection on the OriginalFootprint and run a tool that grabs that feature's relevant information and uses it to create a new entry with no geometry in the SketchFootprint layer.  This allows the user to have the correct key information and other information and removes the potential for input/user error.  

This all runs fine in ArcGIS Pro.  When I share it to Portal and use the REST service in AGOL it runs, but not properly.  Whether I have a selection or not, whether I enable use selections or not it always attempts to use the same polygon from the OriginalFootprint (not the one selected). 

I have observed this polygon being chosen by the tool during debugging at the ArcGIS Pro level when it would attempt to run the tool against the dataset with no selection present.  This behavior is expected based on the way the tool is built, but should not occur if the selection is present (See The Tool below)

The Tool:
This is written in python and shared to the portal with upload capabilities and user defined inputs.
Basically I run a search cursor over the input layer (with its selection, so it should only have 1 polygon selected) and pull the first value off that selection list as the polygon in the OriginalFootprint to have its information copied to the SketchFootprint Layer.  It then uses that information to run 

search cursors to see if it exists in the SketchFootprint to determine a version number, and then uses an insert cursor to add the appropriate entry.

Things that I would love help with:
1: 
When I run the tool the Geoprocessing output only sits up for 1/2 a second before clearing making it very hard to read the debugging messages I added with acrpy.AddMessage.  Is there a way to have this stay up longer, or is it written out to a log somewhere? 
2: It looks like the selection on the layer being passed into the tool isn't being honored, but I do not know why.  The debug messages say it can see a selection, but then reports one different from what is selected. I am including a screen grab out the output messages generated by the script (these are the ones that last a 1/2 a second before being cleared), they show it recognizing a selection, choosing the wrong.

Any help would be appreciated.  I am pulling out my hair over here.

0 Kudos
0 Replies