Esri / military-tools-geoprocessing-toolbox

military-tools-geoprocessing-toolbox is a collection of models, scripts, and tools for use in ArcGIS for Desktop and ArcGIS Pro. This toolbox is one component that is a part of Military Tools.
Apache License 2.0
33 stars 14 forks source link

Distance and Direction Range Rings are doubling the expected output #311

Closed llsjr2 closed 6 years ago

llsjr2 commented 6 years ago

Tasks to be done

Verify

Expected Behavior

When the tool is run, the rings should be the distance should be correct in the attribute table for labeling

Current Behavior

The tool's output is double the distance in the attribute table. Ran the tool twice with and without the Spatial Reference option. It did not change the result. Also ran it with the Map Frame in both GCS and UTM.

distanceanddirection_range_rings

Steps to Reproduce (for bugs)

  1. Load a point feature class in Input Center Features 2.Enter the distance of 350 meters
  2. Number of Rings of 4
  3. Support an output locations
  4. Run the tool.
  5. Check the results and the attribute table.

Your Environment

Platform: ArcMap 10.6.1 Projection: GCS WGS1984

BobBooth commented 6 years ago

@llsjr2 - I'm seeing the ring geometry being correct, but the distance reported in the table is the diameter of the ring, not the radius of the ring. image

llsjr2 commented 6 years ago

@BobBooth Yeah, that is the issue. When range rings are issued and labeled in a product. The distance from the target or area is typically used.

BobBooth commented 6 years ago

I have updated the script in this PR https://github.com/Esri/military-tools-geoprocessing-toolbox/pull/328 to do the field calculation after the final output is created. It was not working on the intermediate table.

BobBooth commented 6 years ago

Updated existing (non-cucumber) checklist test with a couple of lines to verify that the range field values are correct, in this PR: https://github.com/ArcGIS/solutions-defense-test-catalog/pull/148

BobBooth commented 6 years ago

My thoughts for the automated test are to add something like this around line 318 of the Range Rings from Interval test:

[This is failing at the moment, but, I think it is close]

    #get a list of values in the Range field
    outRingLyr = arcpy.management.MakeFeatureLayer("outRings")
    rangeList = [row[0] for row in arcpy.da.SearchCursor(outRingLyr, "Range")]
    rangeList.sort()
    self.assertTrue(rangeList == [200.0,400.0,600.0,800.0], "Range values not equal to expected values")
topowright-zz commented 6 years ago

@BobBooth updated comments in the pull request. The manual test needs to be written like a cucumber test.

BobBooth commented 6 years ago

@topowright - done @ACueva - please review and merge

BobBooth commented 6 years ago

Created update to automated test script to check that Range output values match the inputs given the tool. https://github.com/Esri/military-tools-geoprocessing-toolbox/pull/329

ACueva commented 6 years ago

Verified in Jenkins production the unit test passes successfully.

BobBooth commented 6 years ago

This should be working.
It is on my machine, and the PR got merged. image.png Is the GP toolbox not getting updated right in the Military Tools build process?

BobBooth commented 6 years ago

The Dev branch in GitHub has the correct code: https://github.com/Esri/military-tools-geoprocessing-toolbox/blob/dev/toolboxes/scripts/RangeRingUtils.py I think this is a problem with the Military Tools packaging process.

BobBooth commented 6 years ago

Impeded because I cannot test this from the latest Military Tools build, as the build process is still (as of the latest version, at \Solutions\DefenseSolutions\MilitaryToolsForArcGIS\3.0\27) not picking up the contents of the dev branch.

lfunkhouser commented 6 years ago

This is no longer impeded. The build has been updated to pull from dev.

ACueva commented 6 years ago

I tested directly from the MT build. I can confirm, the changes addressed in this issue show up in the current build. Build 31 2018-06-07_10-44-01