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

Create GRG From Point fails with Grid Rotation #366

Closed mfunk closed 6 years ago

mfunk commented 6 years ago

I'm working on UC demos with the final version of Military Tools 3.0 with Create GRG From Point using a Grid Rotation. When I use a non-zero Grid Rotation value the tool runs successfully (no errors or warnings) but produces no output: the output features are not created, and not added to the map (of course).

Expected Behavior

Output grid should be rotated around the input point by the specified amount (degrees) in a clockwise direction.

Current Behavior

No output is created. The feature class is not created, so no features, and no grid added to map...

This does NOT work:

Messages
Start Time: Monday, July 2, 2018 8:53:27 AM
Running script CreateGRGFromPoint...
App environment: ARCGIS_PRO
Creating Fishnet Grid
Sorting the grid for labeling
Adding field for labeling the grid
Numbering the grids
Rotating the grid
Do not apply symbology it will be done in the next task step
Completed script Create GRG From Point...
Succeeded at Monday, July 2, 2018 8:53:30 AM (Elapsed Time: 2.97 seconds)

This does work:

Messages
Start Time: Monday, July 2, 2018 8:54:55 AM
Running script CreateGRGFromPoint...
App environment: ARCGIS_PRO
Creating Fishnet Grid
Sorting the grid for labeling
Adding field for labeling the grid
Numbering the grids
Do not apply symbology it will be done in the next task step
Completed script Create GRG From Point...
Succeeded at Monday, July 2, 2018 8:54:57 AM (Elapsed Time: 1.44 seconds)

Possible Solution

Steps to Reproduce (for bugs)

  1. In current project, open Geoprocessing pane and search "GRG"
  2. Open Create GRG From Point
  3. Select Input Start Location pencil tool, Select Points, using point feature select single location on the map.
  4. Esc key to stop adding new points.
  5. Number of Rows/Columns: 5
  6. Cell Width/Height: 100
  7. Cell Units: Meters
  8. Grid Rotation: 45 (also tried 1, 10, 5, 88)
  9. Output GRG Features: \search5x5
  10. Select Run .... tool runs, no errors, nothing happens.
  11. Change Grid Rotation: 0
  12. Select Run ... tool runs, but now the output grid is created, features exist, and its added to the map.
  13. Change Grid Rotation: 45
  14. Select Run ... tool runs, output feature class deleted, features removed from map, and nothing to replace them.

Context

Working on UC demo showing Military Tools, and can't show GRG with rotation. Not a huge problem for the demo but for people using the tool this could be a bad one.

Your Environment

dfoll commented 6 years ago

confirmed this is an issue. Cross-checked against what we did for the last release. We had an issue that #343 GRG From Area was producing bad outputs with WGS84. This new issue is not an issue we fixed from the June2018 release. @kgonzago is this something you can look at when you finish with what you are currently working on?

BobBooth commented 6 years ago

I'm trying to repro this, but not seeing it. Create GRG From Point is working with both 0 and non-zero rotations for me. (Pro 2.2, Military Tools 3.0.0.76)

mfunk commented 6 years ago

Coordinate system dependent? I was using UTM Zone 10N WGS1984.

BobBooth commented 6 years ago

Working in UTM Zone 10N for me: image

BobBooth commented 6 years ago

@mfunk - how did you install the tools? Via the conda package, or just using what's in the PYT file?

mfunk commented 6 years ago

Conda package. That shouldn't matter though. Does the Conda package use the PYT or TBX?

BobBooth commented 6 years ago

If I run from the version installed by the conda package, it seems to run fine: image If I run the tool from the PYT in the GitHub repo, it fails: image

Also, I see that the symbology for the input points is different (blue pushpin vs yellow dot).

BobBooth commented 6 years ago

@mfunk - conda package should be using the PYT - after it has been packaged/extracted. There are some folder structure differences as a result of that cycle, compared to in the repo.

kgonzago commented 6 years ago

@BobBooth I was able to reproduce the error you got returned NULL without setting an error. Looking into it now.

BobBooth commented 6 years ago

After uninstalling my python conda environments in Pro and creating a new one, reinstalling the MT conda package, and searching for GRG, I am still successfully running the tool with a rotation using UTM Zone 10N. image

BobBooth commented 6 years ago

@mfunk - could it be your license level?

BobBooth commented 6 years ago

With WGS84 coordinate system, using the tool from the conda package, I am seeing this issue. With non-zero rotation, the tool runs & reports success, but no features are generated. With a 0 rotation value the tool is running and producing output, but instead of meters, the units seem to be degrees. A 5x5 grid of 100 meter cells is covering the planet. image @kgonzago - note that it seems coordinate system dependent. Tool worked fine in Web Mercator.
This reminds me of https://github.com/Esri/military-tools-geoprocessing-toolbox/issues/343 Is it possible that we lost the fix to that at some point in the last week?

kgonzago commented 6 years ago

Fix is in this PR

kgonzago commented 6 years ago

Please see this comment

Scenarios I tested with:

  1. Map in PCS and input layer in PCS - Success
  2. Map in PCS and input layer in GCS - Success
  3. Map in GCS and input layer in GCS - Failed
  4. Map in GCS and input layer in PCS - Failed
topowright-zz commented 6 years ago

@kgonzago from the comment above I am placing the dev label back on the issue. When the PR has been updated to allow a user to use a GCS map I will review the PR. Let me know if there is any input needed on my part.

lfunkhouser commented 6 years ago

@topowright is currently working on the development task

topowright-zz commented 6 years ago

I have figured out a way that the tool will work with a PCS and a GCS. The approach I am taking has to do with projecting the input point to a standard PCS

''' create a spatial reference object for the output coordinate system out_coordinate_system = arcpy.SpatialReference(54032)

        # run the Project management tool
        arcpy.Project_management(input_features, output_feature_class, out_coordinate_system)
        targetPointOrigin = output_feature_class

'''

topowright-zz commented 6 years ago

I will have the fix in in the morning.

topowright-zz commented 6 years ago

This is only an issue in ArcGIS Pro not ArcMap.

topowright-zz commented 6 years ago

CMS has been updated in both GRG and Military Tools.

topowright-zz commented 6 years ago

Taking off the label for checklist test being that there is already a checklist that has a grid rotation.

dfoll commented 6 years ago

reviewed doc changes and re-published, updated versions here ...\DesktopHelp\10.6\review_pdf\grg_pdf http://solutionsdev.arcgis.com/defense/help/gridded-reference-graphic/resources/august-2018-gridded-reference-graphic.htm

...\DesktopHelp\10.6\review_pdf\military_tools_release_notes http://solutionsdev.arcgis.com/defense/help/military-tools/resources/august-2018-military-tools-for-arcgis.htm

dfoll commented 6 years ago

verified this is issue is working. The issue for running GRG From Point in a projection other than WGS 1984 Web Mercator Auxilary Sphere is still open. 373