我遇到了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)
答案 0 :(得分:0)
在你的地图代数函数之后添加print gp.GetMessages(),看看它是否能让你知道发生了什么