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

Table to Point single string field coordinate formats fail unless default Spatial Reference input is cleared #413

Open BobBooth opened 5 years ago

BobBooth commented 5 years ago

When you run the Table to Point tool using one of the single string field input coordinate formats (MGRS, GARS, GEOREF, USNG, UTMBANDS, UTMZONES) the tool fails with a "Failed to execute. Parameters are not valid. Error 000308: Invalid field type" message unless you delete the input Spatial Reference field contents (GCS_WGS_1984) before running the tool. image

Expected Behavior

If you use one of the single field coordinate formats, the tool should run correctly without needing to manually remove the input default Spatial Reference

Current Behavior

Get error message: "Failed to execute. Parameters are not valid. Error 000308: Invalid field type" and tool does not execute if you fail to clear the default Spatial Reference string value.

Possible Solution

Update tool logic so the input Spatial Reference is correct to process each of the single string field coordinate formats.

Steps to Reproduce (for bugs)

  1. Open the attached Project Package. Clear_GCS_WGS_1984_to_run_Table_to_Point_issue.zip
  2. Run the Table to Point tool on the POI_CC_All.csv file (or POI_CC_All in the project GDB).
  3. Use MGRS as the Input Coordinate Format.
  4. Use the MGRS field in the table as the X Field (longitude, UTM, MGRS, USNG, GARS, GEOREF).
  5. Leave the string "GCS_WGS_1984" in the Spatial Reference input field.
  6. Click Run. The tool fails.
  7. Repeat the process, but delete the string "GCS_WGS_1984" in the Spatial Reference input field before clicking Run. The tool runs correctly and produces point features. image

This also happens with UTM, MGRS, USNG, GARS, GEOREF, UTMBands, UTMZones coordinate formats.

Context

Should not need to delete the value - the correct value should automatically be used when you choose one of the single field string inputs.

Version Introduced

This behavior began after the tools were moved into the PYT files.
Tested several released branches of the repo and you do not need to blank that field for the tool to run correctly in the Feb2017 release or the June2017 release, but you do need to do if for the June2018 release and later.

I wonder if there was some validation logic in the TBX file that did not make it into the PYT.

The tool from Jun 2018 (PYT) works correctly in ArcMap 10.3.1 - you do not need to delete the Spatial Reference input string for the tool to produce correct output in ArcMap. image

I discovered this issue while testing a fix that I made for issue #386 (not yet merged).

Your Environment

ArcGIS Pro 2.3 Military Tools June2018 release and later.

Note, the problem seems to only affect ArcGIS Pro.

csmoore commented 4 years ago

I could not reproduce this (on Pro 2.5), but the next version of this tool (for Pro 2.6) no longer has a default value for the optional Spatial Reference.