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

Create GRG From Point alpha-numeric labels just include the alpha part #657

Closed BobBooth closed 6 years ago

BobBooth commented 6 years ago

While testing https://github.com/Esri/solutions-geoprocessing-toolbox/issues/585 I encountered a new issue with the labeling of GRG from Point. If a rotation is applied to the grid, the labels are only getting the Alpha component of the Alpha-Numeric labeling system. image

Steps to Reproduce (for bugs)

  1. Get latest version of tool from the repo.
  2. Run the Create GRG from Point tool.
  3. Drop a point on the map.
  4. Accept all defaults, except add a rotation value.
  5. Run the tool. Cells are labeled with A, B, C, D... for rows, but not with 1,2,3,4... for columns. If you do not add a rotation factor the cells are labeled correctly.

Context

Your Environment

BobBooth commented 6 years ago

It is possible that is is fixed in the unmerged PR here: https://github.com/Esri/solutions-geoprocessing-toolbox/pull/654 @adgiles

BobBooth commented 6 years ago

image.png

BobBooth commented 6 years ago

This also affects the Alpha-Alpha label style. The Numeric style labels from 1 to 9, then the rest of the cells seem to get 1 values. image.png

adgiles commented 6 years ago

No the unmerged PR has nothing to do with this. I have had a visual look at the code and can’t see anything obvious to why this would be happening. I will dig a bit deeper tomorrow.

Out of interest is the label getting truncated for alpha-alpha and numeric, and is it also happening in ArcMap?

adgiles commented 6 years ago

What is the length of the Grid field?

BobBooth commented 6 years ago

@adgiles - it does not seem to happen in ArcMap. In ArcMap, it is a string of 255. In Pro it is text of length 255.

adgiles commented 6 years ago

Strange maybe something going on with joins in Pro

adgiles commented 6 years ago

The script was reusing a rotate feature class function that was generic so that it could be used against any feature class. As part of this it used the arcpy.AddJoin_management to map over the existing feature class attributes. This process seemed to cause an issue in Pro.

As we know that there is only one attrribute field to map over (Grid) I have change script to do this in the search cursor and removed the join.

In PR https://github.com/Esri/solutions-geoprocessing-toolbox/pull/658

topowright-zz commented 6 years ago

This would work as I would expect it to: image