laptop and a wrench

Bug

The ConvertDirection Arcade function gives incorrect longitude values when the output direction type is South.

Last Published: October 6, 2022 ArcGIS Pro
Bug ID Number BUG-000152518
SubmittedSeptember 22, 2022
Last ModifiedJune 23, 2025
Applies toArcGIS Pro
Version found3.0
Operating SystemN/A
Operating System VersionN/A
StatusAs Designed

Additional Information

The ConvertDirection Arcade function's directionType indicates the reference for how a bearing angle on a circle is defined. The angle where directionType = north is the central angle on a circle measured in the clockwise direction from north, and when directionType = south, the central angle is measured in the clockwise direction from south. See the documentation about the various direction references available: https://pro.arcgis.com/en/pro-app/latest/help/editing/direction-formats-for-editing.htm The ConvertDirection function converts central angles on a 360° circle-not hemispheres measured as plus and minus 90° or 180°. To convert latitude and longitude formats, additional logic must be included in an Arcade expression to determine East and West longitude and North and South latitude. Users wanting to convert geographic coordinates from decimal degrees to DMS format should do the conversion on the absolute value of the coordinate value and add the appropriate direction unit for a positive or negative original coordinate value. This Arcade example converts the latitude and longitude in decimal degrees to DMS format.

// Correct any input longitude values that extend beyond the date line
function Mod(value, range, upperEnd)
{
  while (value > upperEnd)
    value -= range;
  var lowerEnd = upperEnd - range;
  while (value <= lowerEnd)
    value += range;
  return value;
}

function LatLongToDMS(lat, lon)
{
  lon = Mod(lon, 360, 180);

  var dmsLat = ConvertDirection(abs(lat), {"directionType":"north", "angleType":"degrees"},
                                          {"directionType":"north", "angleType":"dms", "outputType":"text", "format":'d[°] mm[\'] ss.ssss["] '})
               + iif( lat >= 0, "N", "S");

  var dmsLon = ConvertDirection(abs(lon), {"directionType":"north", "angleType":"degrees"},
                                     {"directionType":"north", "angleType":"dms", "outputType":"text", "format":'d[°] mm[\'] ss.ssss["] '})
               + iif( lon >= 0, "E", "W");
  
  return dmsLat + ", " + dmsLon;
}

return LatLongToDMS(Geometry($feature).y, Geometry($feature).x);

Workaround

Use the calculate geometry attributes tool or write an arcade expression to convert decimal degrees to Degree Minute Seconds (DMS) notation by referring to https://support.esri.com/en/technical-article/000008758.

Steps to Reproduce

Bug ID: BUG-000152518

Software:

  • ArcGIS Pro

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options