我对ArcGIS的地图代数函数有问题。你知道吗
我有大约200个TIFF文件,我想用它们的属性值乘以1000。我编写的脚本(见下文)似乎可以正常工作,但我没有从中得到任何输出。为什么会这样?你知道吗
# Import system modules
import arcgisscripting, os, sys
# Create the Geoprocessor object
gp = arcgisscripting.create()
# Check out any necessary licenses
gp.CheckOutExtension("spatial")
# Load required toolboxes...
gp.AddToolbox("C:\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Spatial Analyst Tools.tbx")
# Set local variables
inDir = "E:\OriginalDatasetRepertory\VegetationCoverDensity\Grid"
OutRaster = "E:\OriginalDatasetRepertory\VegetationCoverDensity\MapAlgebra"
gp.outputCoordinateSystem = "Coordinate Systems\Geographic Coordinate Systems\World\WGS 1984.prj"
for TIFF in os.listdir(inDir):
# State the statistical expression
InExpression = tiff_files * 1000
print InExpression
# Set the output name
OutRasterName = TIFF.replace("LCI_","VC_")
print OutRasterName
# Process: Map Algebra
gp.SingleOutputMapAlgebra_sa(InExpression, OutRasterName, OutRaster)
添加打印获取消息()在地图代数函数之后,看看它是否能让你知道发生了什么
相关问题 更多 >
编程相关推荐