I have multiple point feature class (las_1.shp, las_2.shp....._711) into one folder. I am trying to write a python script to perform IDW interpolation which will loop all the point feature class and outraster will save as it name of input raster.
Each Point feature class hold one Z filed only (Altit).
The problem is that after interpolation some of the generated raster are saved, however, with an error (all black). I think that the problem is in the part of save the raster (os.path.join) because a execute the script without this part and the interpolation works perfectly. I'm using Python 2.7.
Below is my script, what i have so far
import arcpy
from arcpy import env
from arcpy.sa import *
import os
arcpy.env.parallelProcessingFactor = "100%"
arcpy.env.overwriteOutput = True
env.workspace = r"C:\Users\pedro\Documents\Mestrado\GEO\Pontos_Laser\TESTE"
out_folder = r"C:\Users\pedro\Documents\Mestrado\GEO\Pontos_Laser\RASTER"
zField = "Altit"
points = arcpy.ListFeatureClasses("las_*.shp", "POINT")
print points
cellSize = 5
power = 2
searchRadius = RadiusVariable(12, 5)
arcpy.CheckOutExtension("Spatial")
for fc in points:
print fc
outIDW = Idw(fc, zField, cellSize, power, searchRadius)
tifname = fc[:7]
IDW_OUT= os.path.join(out_folder, '{}.tif'.format(tifname))
print IDW_OUT
outIDW.save(IDW_OUT)
print 'done'