没有从scrip输出到地图代数ArcGIS

2024-09-29 19:28:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我对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)

Tags: thecoordinateosgpsystemssetarcgistiff

热门问题