laptop and a wrench

Bogue

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.

Dernière publication: December 27, 2022 ArcGIS Pro
Numéro d’ID de bogue BUG-000153681
EnvoiNovember 14, 2022
Dernière modificationJune 5, 2024
S’applique àArcGIS Pro
Version trouvée2.9
Système d’exploitationWindows OS
Version du système d’exploitation10.0 64 Bit
Version de correction3.2
StatutFixed

Informations supplémentaires

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

Solution de contournement

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

Étapes pour reproduire

ID de bogue: BUG-000153681

Logiciel:

  • ArcGIS Pro

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement