我有.tif格式的多个光栅图像,我想将光栅文件转换为基本上是点形文件的点。我尝试使用以下代码,它不会工作。
import arcpy
from arcpy import env
from arcpy.sa import *
# Set environment settings
env.workspace = r"E:/Soil Moisture/SM Final"
# Set local variables
outpoint = r"E:/wallace/Soil Moisture/SM Final/rast_point/"
field = "VALUE"
# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")
# Get a list of the rasters in the workspace
rasters = arcpy.ListRasters()
# Loop through the list of rasters
for inRaster in rasters:
# Set the outputname for each output to be the same as the input
outpoint = outpoint + "\\" + inRaster
# Process: raster to popint
arcpy.RasterToPoint_conversion(inRaster, outpoint, field)
我该如何解决这个问题?