How to use Mosaic Dataset Configuration Script (MDCS) and arcpy to add a spatial inde

المشرف العام

Administrator
طاقم الإدارة
For a mosaic dataset ("demo1") created via Mosaic DatasetConfiguration Script (MDCS) I also calculate the Boundary envelope (BB command). I would like to also calculate a spatial index for the Boundary polygon to avoid a warning message in ArcMap when demo1 is used as a basemap layer. I can do this directly in ArcMap by analyzing the basemap layer and selecting to solve the problem. My issue is trying to automate this in MDCS. As a first attempt I've tried to create a custom MDCS command to do this and call this last from the master.xml config file. In this example I've hijacked the "sample00" example command in MDCS_UC.py.

def sample00(self, data):

workspace = data['workspace'] md = data['mosaicdataset'] arcpy.env.workspace = workspace arcpy.AddSpatialIndex_management('demo1\Boundary') return True

Invariably I always get an error that 'demo1\Boundary' doesn't exist.



أكثر...
 
أعلى