Esri / solutions-geoprocessing-toolbox

Models, scripts, and tools for use in ArcGIS Desktop and Server to support defense and intelligence workflows.
Apache License 2.0
133 stars 67 forks source link

NumberFeatures tool does not label feature correctly when new feature class is created #677

Closed kgonzago closed 6 years ago

kgonzago commented 6 years ago

6/13: Tasks remaining

When creating a new feature layer (feature class) during the Number Feature tool process, the tool:

  1. Creates a new feature class in the project GDB
  2. Adds it as a feature layer to the TOC
  3. Applies the appropriate layer file for symbology But, the features are not labeled at all. Somehow the layer file is preventing it from labeling.

Expected Behavior

Features should be labeled in the newly created feature layer

Current Behavior

Run tool on: image Get result: image Features are not labeled.

Possible Solution

Update LYRX file to provide labels as well as symbology.

Steps to Reproduce (for bugs)

  1. Open the Clearing Operations solution
  2. Open the Number features tool
  3. Choose to number the NewLocations feature layer
  4. Specify a new output feature class
  5. Run the tool.
  6. The new layer is added to the map. It has the correct symbology, but the features are not labeled.
  7. Turn on labels - for some reason, even when you turn on labels they don't display (though sometimes they do. @kgonzago and @ACueva saw it not working, then I (BB) tried again on my own ArcGIS Pro 2.1.0 machine and I could manually apply labels and have them display).

Context

Your Environment

csmoore commented 6 years ago

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:

image

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

BobBooth commented 6 years ago

@csmoore - cool! So, an if product == ArcMap use lyr, if product == Pro use lyrx check here is all it would need?

csmoore commented 6 years ago

@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

lfunkhouser commented 6 years ago

This issue was moved to Esri/military-tools-geoprocessing-toolbox#341