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

Military_Tools - Conversion - Convert Coordinates - failing in Pro 1.2 #32

Closed pshowalter closed 8 years ago

pshowalter commented 8 years ago

In ArcGIS Pro 1.2 Military_Tools - Conversion - Convert Coordinates is failing. It seems to run OK in ArcMap after the changes below were made. By reviewing error log, found a few changes to get it to run a bit further:

In ConvertCoordinates.py code and found reference to toolbox label, rather than the name:

# Load required toolboxes scriptpath = sys.path[0] #toolboxpath = os.path.join(scriptpath,"..\\Military Tools.tbx") toolboxpath = os.path.join(scriptpath,"..\\Military_Tools.tbx")

The tool proceeded to ~line 82 where a reference to toolbox alias "ma" is found and changed to "mt". #arcpy.AddUniqueRowID_ma(Output_Table, "JoinID") arcpy.AddUniqueRowID_mt(Output_Table, "JoinID") ` One successful run, but multiple failures:

Messages Start Time: Fri Apr 29 11:50:40 2016 Executing (sourceCC): sourceCC table_to_2_point_test DD_1 POINT_YX1_TEXT # C:\ArcGISForDefense\MilitaryAnalyst\MT_PRO_12_Projects\Table_To_2_Point_Line_v2\Table_To_Point.gdb\CC_TABLE_DD_1 "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119522E-09;0.001;0.001;IsHighPrecision" Start Time: Fri Apr 29 11:50:40 2016 Running script sourceCC... table_to_2_point_test C:\ArcGISForDefense\MilitaryAnalyst\MT_PRO_12_Projects\Table_To_2_Point_Line_v2\Table_To_Point.gdb\CC_TABLE_DD_1 Failed script sourceCC... <class 'SyntaxError'>SyntaxError("invalid or missing encoding declaration for 'C:\myProjects\GitHub\military-tools-geoprocessing-toolbox\toolboxes\Military_Tools.tbx'",) Failed to execute (sourceCC). Failed at Fri Apr 29 11:50:54 2016 (Elapsed Time: 13.58 seconds) Failed to execute (ConvertCoordinates). Failed at Fri Apr 29 11:50:54 2016 (Elapsed Time: 13.76 seconds)

mfunk commented 8 years ago

https://github.com/Esri/solutions-geoprocessing-toolbox/issues/378

mfunk commented 8 years ago

This is a symptom of having a single script tool in multiple toolboxes, and a good reason to re-write tools to work as methods in a single module file like we did for Range Rings.

csmoore commented 8 years ago

This is also very similar to #28 here (but was a "_10.3" on the tbx name) - so you may be able to combine the issues.

mfunk commented 8 years ago

Fixed in #121