laptop and a wrench

Erro

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

Última Publicação: October 6, 2022 ArcGIS Pro
Número de ID do Erro BUG-000152518
EnviadoSeptember 22, 2022
Última ModificaçãoJune 23, 2025
Aplica-se àArcGIS Pro
Versão encontrada3.0
Sistema OperacionalN/A
Versão do Sistema OperacionalN/A
StatusAs Designed

Informações Adicionais

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

Solução Provisória

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.

Etapas para Reproduzir

ID do Erro: BUG-000152518

Software:

  • ArcGIS Pro

Seja notificado quando o status de um erro mudar

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download