laptop and a wrench

Bug

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.

Zuletzt veröffentlicht: December 27, 2022 ArcGIS Pro
Bug-ID-Nummer BUG-000153681
EingereichtNovember 14, 2022
Zuletzt geändertJune 5, 2024
Gilt fürArcGIS Pro
Gefunden in Version2.9
BetriebssystemWindows OS
Betriebssystemversion10.0 64 Bit
Behoben in Version3.2
StatusFixed

Zusätzliche Informationen

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

Workaround

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

Schritte zur Reproduzierung

Bug-ID: BUG-000153681

Software:

  • ArcGIS Pro

Benachrichtigung erhalten, wenn sich der Status eines Bugs ändert

Esri Support App herunterladen

Weitere Informationen zu diesem Thema erkunden

Unterstützung durch ArcGIS-Experten anfordern

An den technischen Support wenden

Esri Support App herunterladen

Zu Download-Optionen wechseln