laptop and a wrench

Error

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

Última publicación: October 6, 2022 ArcGIS Pro
Número de ID del error BUG-000152518
EnviadoSeptember 22, 2022
Última modificaciónJune 23, 2025
Relacionado conArcGIS Pro
Versión encontrada3.0
Sistema operativoN/A
Versión de sistema operativoN/A
EstadoAs Designed

Información adicional

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);

Solución alternativa

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.

Pasos para reproducir

ID del error: BUG-000152518

Software:

  • ArcGIS Pro

Recibir notificaciones cuando cambie el estado de un error

Descargar la aplicación de soporte de Esri

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga