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

GRG from Area is producing incorrect output when given a Geographic (WGS84) feature class as input AOI #343

Closed BobBooth closed 6 years ago

BobBooth commented 6 years ago

I have an AOI defined that I want to create a GRG for. If I use feature set input and snap to the boundaries, I can define that polygon as my input area for the GRG from Area tool, and I get correct output. image

However, if I use that AOI feature (stored in a feature class or shapefile, with Geographic - WGS84 coordinate system) as my input to the tool, I get incorrect output (a giant polygon with one corner coincident with my AOI polygon). image image

If that input polygon is in a shapefile or feature class that has the Web Mercator coordinate system, the tool works as desired. image

If the input polygon is in UTM projection (WGS_1984_UTM_Zone_10N), the results are also incorrect. image

Expected Behavior

I would expect the tool to work like the range rings tools and project my input feature class into a suitable coordinate system for the calculation, and return expected results in my AOI.

Possible Solution

Check coordinate system of input feature class, reproject, the way Range Rings does.

Steps to Reproduce (for bugs)

  1. Create a polygon feature class and set the coordinate system to Geographic (WGS84)
  2. Digitize an AOI polygon for your AOI (in a map with Web Mercator coordinate system).
  3. Run GRG from Area, with the input area set from your AOI polygon, other parameters use defaults.
  4. Examine results.
  5. Re-run tool but digitize with the input feature set tool the AOI. Compare.

Your Environment

ArcGIS 10.3.1 ArcMap Latest dev branch (6/15/18) of military-tools-geoprocessing-toolbox GRG From Area tool in Military Tools.pyt

BobBooth commented 6 years ago

Note: This is not a new issue, the released version in ClearingOperationsTools.pyt in the Clearing Operations solution is behaving the same way.

BobBooth commented 6 years ago

When you give the tool a feature set input, the output features seem always to be in WGS_1984_Web_Mercator_Auxiliary_Sphere WKID: 3857 Authority: EPSG

BobBooth commented 6 years ago

This is an issue with all of the GRG tools. Running with an input point feature in a WGS84 feature class, I get "out of bounds" error message: "Executing: CreateGRGFromPoint RangeRingCenter 10 10 250 250 Meters Upper-Left Alpha-Numeric - 15 C:\Junk\JunkOut.gdb\Point_grg_from_WGS84_FC_point Start Time: Fri Jun 15 16:34:11 2018 Running script CreateGRGFromPoint... App environment: OTHER Non-map application... Creating Fishnet Grid Sorting the grid for labeling Executing: Sort in_memory\tempFishnetGrid in_memory\tempSort "Shape ASCENDING" UL Start Time: Fri Jun 15 16:34:12 2018 ERROR 999999: Error executing function. The coordinates or measures are out of bounds. Failed to execute (Sort). Failed at Fri Jun 15 16:34:12 2018 (Elapsed Time: 0.02 seconds) Completed script CreateGRGFromPoint... Failed to execute (CreateGRGFromPoint). Failed at Fri Jun 15 16:34:12 2018 (Elapsed Time: 0.68 seconds)"

ACueva commented 6 years ago

Adding Doc label since this issue is present in current released version. Per https://github.com/Esri/military-tools-geoprocessing-toolbox/issues/343#issuecomment-397707232

lfunkhouser commented 6 years ago

@ACueva Can you clarify the purpose of the Doc label? To log as a known issue or to add as an issue addressed when it is addressed? @kgonzago @topowright Are either one of you able to look at this issue and possibly fix?

kgonzago commented 6 years ago

I'll take a look at this.

BobBooth commented 6 years ago

Thanks, @kgonzago - while you're looking, note that there is also another issue with this tool: https://github.com/Esri/military-tools-geoprocessing-toolbox/issues/344 Maybe you can get them both.

topowright-zz commented 6 years ago

@kgonzago I am removing the dev labels on this issue being that you have submitted a PR.