Closed lfunkhouser closed 6 years ago
From @csmoore on June 12, 2018 18:22
I ran this on Pro 2.2.12776(Beta2) and setting the symbology/labeling on the output layer using a lyrx file seems to be now working correctly for setting the labels. So this issue is dependent on Pro 2.2 final:
There is just a small code change needed (here) to check whether in Pro or ArcMap because a Pro .lyrx file is needed to make the GP output labeling work (a 10.X .lyr file doesn't work for this labeling scenario)
Moving/migrating NumberFeatures tool opened with issue: https://github.com/Esri/military-tools-geoprocessing-toolbox/issues/339
FYI @topowright @BobBooth @dfoll @ACueva
From @BobBooth on June 12, 2018 18:26
@csmoore - cool! So, an if product == ArcMap use lyr, if product == Pro use lyrx check here is all it would need?
From @csmoore on June 12, 2018 18:40
@BobBooth - that is correct. There is an existing method/utility for this - though its behavior is not consistent if run from arcpy outside of the Pro/ArcMap - since it returns: 1. Pro 2. ArcMap 3. Other (standalone arcpy but could be Pro or ArcMap python) - so we may need to add a method
Addressed/added/migrated from previous clearing ops toolbox in PR #342
This should work as well as it did in the previous clearing ops repo/toolbox - though more rigorous testing of this may reveal new issues - ex.
Symbology is missing from output in ArcMap and ArcGIS Pro
@topowright - can you provide some additional info/repro steps or step me through
The issue might be the one mentioned here: https://github.com/Esri/military-tools-geoprocessing-toolbox/issues/339#issuecomment-396974424 that the exact field names "Number" and "Purpose" must exist in the input+output feature class because the layer files are set to use those fields.
Also Pro should be version 2.2.12776(Beta2) or later.
Example: ArcMap no symbols or labels with missing fields:
Example: Labels with fields present:
I found another way to repro @topowright 's reported issue above - if you don't supply an "Output Numbered Features" parameter - the symbology will also not be applied.
This has to do with the peculiar design of this tool that allows the input parameter to sometimes be used as the output parameter if no ouput parameter is supplied. The ouput is empty in this case so GP does not apply the symbology.
I think we have had similar problems with this tool design before https://github.com/Esri/solutions-geoprocessing-toolbox/issues/607 - https://github.com/Esri/solutions-geoprocessing-toolbox/issues/607#issuecomment-331572977
Just to summarize when labeling should work
Setting Labeling / Layer Symbology on the output only works currently with the NumberFeatures tool when:
These limitations were present in the previous ClearingOps toolset/template - but we are likely finding them as a result of just doing more testing outside of the template
With the information above I am going to verify the statements of @csmoore
based on all the testing I have done I do not think that labels from gp tools work in ArcGIS Pro 2.2. I have tested this in
I would like to move this out of the sprint if someone else cannot get the labels to work correctly. @dfoll and @ACueva.
@topowright - I think we can include logic to test whether or not the Purpose field is present and populated and choose which LYRX file to apply. Although that won't help with the Number Features tool requiring an Advanced license.
On Pro 2.2 final the tool is not labeling for me, either upon immediate output or by trying to turn labeling off then back on. I confirmed the "Number" field is present in the input and a "Purpose" field is present in the input. I also tried making sure the purpose field had non-null text values in it. Also I made sure to use an output named differently than the input. I confirmed that the output which is not labeling does have values in the number field and the label class expression is {Number]. In the label expression I tried to switch between all four languages in the label expression as well, also no luck. I attempted to switch and label by some other field, such as "Purpose" which I also calculated values, and still no labels at all. Even .... $feature.SHAPE_AREA ...... as the expression when using Arcade would not display anything
@BobBooth will try and use the old layer file that only populates simple symbology (yellow boxes with labels). If that does not work we will move on and not tackle this issue during this release. This work needs to be done in the final build of ArcGIS Pro 2.2.
I think I've got it working correctly now. https://github.com/Esri/military-tools-geoprocessing-toolbox/pull/347
Had to add a feature class to the featuresetsWebMerc.gdb and point the symbology LYRX file to it in order for Pro to apply the symbology. @topowright - please test.
From @kgonzago on June 7, 2018 19:44
6/13: Tasks remaining
When creating a new feature layer (feature class) during the Number Feature tool process, the tool:
Expected Behavior
Features should be labeled in the newly created feature layer
Current Behavior
Run tool on: Get result: Features are not labeled.
Possible Solution
Update LYRX file to provide labels as well as symbology.
Steps to Reproduce (for bugs)
Context
Your Environment
Copied from original issue: Esri/solutions-geoprocessing-toolbox#677