laptop and a wrench

漏洞

Using Python to run the Add Rasters To Mosaic Dataset tool with the NITF raster type does not parse correct values when executed outside of ArcGIS Pro, such as the Python window.

上次发布: December 27, 2022 ArcGIS Pro
漏洞 ID 编号 BUG-000153681
已提交November 14, 2022
上次修改时间June 5, 2024
适用范围ArcGIS Pro
找到的版本2.9
操作系统Windows OS
操作系统版本10.0 64 Bit
修正版本3.2
状态Fixed

附加信息

This issue is fixed in ArcGIS Pro 3.2.0. Use the ctypes workaround in ArcGIS Pro versions 3.1 and earlier.

解决办法

In ArcGIS Pro 3.0, add the following lines to force Python to init the plugin manager to allow the Add function to work correctly:

import arcpy from pathlib import Path # Workaround for missing init of Add-Ins in Python from ctypes import * hDADFLib = cdll.LoadLibrary(rcpy.GetInstallInfo()['InstallDir'] + r"bin\DADFLib.dll") hDADFLib.InitializeAddInManager.argtypes = [ c_void_p, c_wchar_p ] hDADFLib.IntiializeAddInManager.restype = c_int result = hDADFLib.InitializeAddInManager(0, "en_us")

mydir = Path(__file__).parent.absolute()

arcpy.management.AddRastersToMosaicDataset(str(mydir /r"test_md.gdb\ingest_test"), "NITF", r"'C:\data-local\test_images\'", "UPDATE_CELL_SIZES", "UPDATE_BOUNDARY", "NO_OVERVIEWS", None, 0, 1500, None, "*.NTF;*.NITF;*.NSF;*.NSIF;*.r0;*.bif", "SUBFOLDERS", "ALLOW_DUPLICATES", "NO_PYRAMIDS", "NO_STATISTICS", "NO_THUMBNAILS", "", "NO_FORCE_SPATIAL_REFERENCE", "NO_STATISTICS", None, "NO_PIXEL_CACHE", r"C:\Users\dan2120\AppData\Local\ESRI\rasterproxies\test_py_add_rasters")

重现步骤

漏洞 ID: BUG-000153681

软件:

  • ArcGIS Pro

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

下载 Esri 支持应用程序

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

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项