Skip to main content
Question

Update spatial index


Hello everybody,

 

We are looking for a solution to update a spatial index in a Esri SDE database after the Geodatabase_SDE writer has finished writing the data. We are going the work with FME Desktop 2020. The only solution we could find is making an python script and use this in the "Shutdown python script" event.

 

Does anybody know an easier solution?

Greetings from the Netherlands

2 replies

samisnunu
Contributor
Forum|alt.badge.img+10
  • Contributor
  • June 11, 2020

You could use this code in the Shutdown Python Script in the workspace parameters,  and update target feature classes list:

import fme
import arcpy

arcpy.env.workspace  = fme.macroValues['TARGET_SDE_CONNECTION_FILE']
feature_class_list = ['fc1''fc2','fc3']

print('Update spatial index...')

# Recreate the spatial indexes
try:
    for fc in feature_class_list:
        arcpy.RemoveSpatialIndex_management(fc)
        print(arcpy.GetMessages(2))
        arcpy.AddSpatialIndex_management(fc)
        print(arcpy.GetMessages(2))
    print('Done.')

except:
    print(arcpy.GetMessages(2))

Thank you for your response,

 

But my client prefers a solution without python. Do you know if FME has a possibility for this?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings