Closed lfunkhouser closed 5 years ago
From @topowright on October 15, 2018 13:2
@lfunkhouser this should be moved to the gp repo.
Output type can be changed for decimal degrees by using the "DD_NUMERIC" keyword for Convert Coordinate Notation.
In ConvertCoordinates.py lines 144 to 151 denote the notation types...
# {"format":"field_name(s)", ...}
notationsToAdd = {"DD":"DDLat; DDLon",
"DDM":"DDMLat; DDMLon",
"DMS":"DMSLat; DMSLon",
"UTM_BANDS":"UTM_BANDS",
"MGRS":"MGRS",
"USNG":"USNG",
"GARS":"GARS",
"GEOREF":"GEOREF"}
Change the "DD" to "DD_NUMERIC"
# {"format":"field_name(s)", ...}
notationsToAdd = {"DD_NUMERIC":"DDLat; DDLon",
"DDM":"DDMLat; DDMLon",
"DMS":"DMSLat; DMSLon",
"UTM_BANDS":"UTM_BANDS",
"MGRS":"MGRS",
"USNG":"USNG",
"GARS":"GARS",
"GEOREF":"GEOREF"}
Probably a good idea to add a unit test to check for output field types at this point too.
@mfunk 's suggested solution works well (thanks for that), so my question is do you want to
@lfunkhouser @dfoll @BobBooth
Original output (with hemisphere character):
New output (numeric format):
I'd vote to add DDLatNumeric and DDLonNumeric, but keep the string values too.
Unfortunately it looks like those output field names "DDLat" "DDLon" are hard-coded in the System Convert Coordinate Notation tool, so it doesn't seem possible to have 2 DD outputs (DD, DD_NUMERIC) in the same table, so we may have to go with option 1, but looking into this further...
@csmoore If you don't like the field that the system tool gives you, change it in the CC tool. Add your own field, copy values from original field to the new one, then delete the original. Basically the same thing we do with the 'gridcode' field for any of the Raster To Feature tools.
Addressed in PR #405 - adds numeric lat/lon to conversion outputs (screenshots of ArcMap + Pro after change/PR below):
Ran tool on EnemyLocationsDD.csv, MontereyPointsOfInterest.csv, TabletoPoint.csv. Tested with input coordinates of DD (text), DD(numeric), MGRS. Tool ran correctly and produced outputs, which had all the output fields, including the new ones DDLatNumeric and DDLongNumeric, as well as the text DDlat and DDLon.
Created PR to update What's New page: https://github.com/ArcGIS/arcgis-solutions-website/pull/7634 Update has been made in CMS, and MT pages & PDFs republished.
This change is now visible in dev version of solutions pages on the What's New and Military Tools for ArcGIS 3.4 pages.
From @nfeuerstein on September 25, 2018 21:27
Steps to reproduce:
You will be unable to use the 'Display XY Data' with the fields that were the output of the Convert Coordinates script because they're in Text format.
@lfunkhouser
Copied from original issue: Esri/coordinate-conversion-addin-dotnet#521