2007年07月07日 星期六 09:15
Script example
# Use Calculate Default Grid Index to update the spatial index of a FC
import arcgisscripting
gp = arcgisscripting.create()
fc = "c:/temp/hydrology.gdb/rivers"
try:
# Get the grid sizes from the tool, this is a string with 3 semi-colon seperated values (typically something like "1500; 0; 0")
indexgrids = gp.CalculateDefaultGridIndex(fc)
indexgrid1 = indexgrids.split(";")[0]
indexgrid2 = indexgrids.split(";")[1]
# First remove the existing grid index
gp.RemoveSpatialIndex(fc)
# Now add the indexes calculated by the tool
gp.AddSpatialIndex(input, indexgrid1, indexgrid2)
except:
print gp.getmessages()
在上面的脚本中我使用dir(gp) 为什么看不到 AddSpatialIndex这个函数
zhangbaocai_cug
2007-07-06
Zeuux © 2025
京ICP备05028076号