Closed csmoore closed 6 years ago
Here's my doc from encountering this issue:
The Table to Polygon tool is failing when it is run on the repo test data (TableToPolygon_single.csv) if the optional "Line Field" input is set to the Name attribute.
The error message is: "... PYTHON ERRORS: Traceback info: File "C:\Users\username\Documents\GitHub\military-tools-geoprocessing-toolbox\toolboxes\scripts\ConversionUtilities.py", line 135, in polylineToPolygon outRows.insertRow([outPoly, inID])
Error Info: The value type is incompatible with the field type. [Name] ..." Note, this is not a new problem with the tool in the new Python toolbox, Military Tools.pyt - I am also seeing it with the tool in "Military_Tools_arcmap.tbx"
The table contains this attribute which serves as a group identifier for sets of points that belong together in a given polygon. The result of running the tool on this data should be an output polygon for each of the named areas. Name field:
The Table to Polyline tool is working correctly with these inputs, creating a set of line features from the related points, see:
The tool runs correctly if it is fed a table with integer group IDs, see:
Tool should create polygons grouped by name field, like the Table to Polyline tool does for lines, given a name field with string values, as well as an ID field with Integer values.
Using CSV test data, TableToPolyline_single.cs (https://github.com/Esri/military-tools-geoprocessing-toolbox/blob/dev/testdata/CSV/TableToPolyline_single.csv)
Fails in both "Military_Tools_arcmap.tbx" and "Military Tools.pyt" (Dev branjch 5/9/18) using ArcMap 10.5
The TableToPolygonTestCase.py has been updated to include a test that actually compares the number of features you would expect when a grouping value is used. Note 1: It fails, because the tool is currently broken. Note 2: Once the tool is fixed, the rest of the test cases should be updated to use the same logic (maybe one could be left with the old "expectedFeatures = int(1)" comparison, which tests if you're converting all of the points in a given table into a single polygon. This seems like an edge case, rather than the main use for the tool. The same applies to the TableToPolylineTestCase.py @csmoore https://github.com/Esri/military-tools-geoprocessing-toolbox/pull/290
Looking at this now and see where the assumption is made that the field will be of type "Long": https://github.com/Esri/military-tools-geoprocessing-toolbox/blob/dev/toolboxes/scripts/ConversionUtilities.py#L98
And can't convert here: https://github.com/Esri/military-tools-geoprocessing-toolbox/blob/dev/toolboxes/scripts/ConversionUtilities.py#L123
Hopefully a straight forward fix to made the added field of type text
Fix added to PR #290 - ready for QA/QC when merged - removing dev label
Fix for this caused a problem with Table to Ellipse. Bob will work on this today.
I believe that PR https://github.com/Esri/military-tools-geoprocessing-toolbox/pull/319 fixes this. @topowright - please review and merge.
Checklist test created: https://github.com/ArcGIS/solutions-defense-test-catalog/pulls
tested manually from dev branch in pro 2.2 -- removed G-QC Verify (Checklist)
tested on Pro 2.0 with MT 2.0 from ...\Esri\Released\ArcGISforDefense this issue was occurring there, so I am listing this in the issues addressed
Tasks to be done 16 May 2018
Expected Behavior
Setting the "Line" parameter to a field should create individual lines/polygons/etc. for each unique field We should Support strings and ints as inputs.
Current Beh
Expected Behavior
Setting the "Line" parameter to a field should create individual lines/polygons/etc. for each unique field We should Support strings and ints as inputs.
Current Behavior
Setting the "Line" parameter causes a python crash in the tool (output below)
Steps to Reproduce (for bugs)
Your Environment