laptop and a wrench

漏洞

In ArcGIS Pro, calculating the field values with the 'is' operator does not work if the corresponding value has spaces or special characters.

上次发布: July 8, 2021 ArcGIS Pro
漏洞 ID 编号 BUG-000140734
已提交June 15, 2021
上次修改时间March 20, 2025
适用范围ArcGIS Pro
找到的版本2.8
操作系统Windows OS
操作系统版本10.0 64 Bit
状态Will Not Be Addressed

附加信息

This is a quirk of the is the operator in Python (which checks whether two objects point to the same memory), and how strings are stored (equivalent alphanumeric strings like 'Texas' point to the same object in memory when invoked, strings such as 'South Dakota' do not point to the same object in memory. The top answer at https://stackoverflow.com/questions/16756699/is-operator-behaves-differently-when-comparing-strings-with-spaces describes this well). String equality has to be checked using == (which checks for value equality) for this reason.

解决办法

It is to be noted other operators can be used in the scenario to return the results when matching them up with the fields having values of either spaces or some other special characters. 

Expression 1: 

def Reclass(value1): 

  if value1 == 'South Dakota': 

    return 1 

  else: 

    return 0 

Expression 2: 

def Reclass(value1): 

  if 'South Dakota' in value1: 

    return 1 

  else: 

    return 0 

重现步骤

漏洞 ID: BUG-000140734

软件:

  • ArcGIS Pro

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

下载 Esri 支持应用程序

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

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项