laptop and a wrench

漏洞

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

上次发布: October 6, 2022 ArcGIS Pro
漏洞 ID 编号 BUG-000152518
已提交September 22, 2022
上次修改时间June 23, 2025
适用范围ArcGIS Pro
找到的版本3.0
操作系统N/A
操作系统版本N/A
状态As Designed

附加信息

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

解决办法

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.

重现步骤

漏洞 ID: BUG-000152518

软件:

  • ArcGIS Pro

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项