I have the following code in Python for a tool I want to build. For some reason I viewshed don't exist in the folder I have chose (out). Also when I am trying to define the output workspace every time the file I have created inside the Input folder is deleted so I created one more outside of the folder where my input data are. Why is that? I am using ArcGis 10.2.2
import arcpy, os
from arcpy import env
from arcpy.sa import *
env.workspace = arcpy.GetParameterAsText(0)
out = arcpy.GetParameterAsText(1)
fc = arcpy.ListFeatureClasses("Pnt*", "Point")
ras = arcpy.ListRasters("clip*", "GRID")
point = "Pntclip_pol1"
dem = "clip_pol1"
i = 1
for shp in fc:
for raster in ras:
if (shp == 'point' and raster == 'dem'):
inRaster = raster
inObserverFeatures = shp
outViewshed = Viewshed(inRaster, inObserverFeatures, "")
outViewshed.save(out + "view" + str(i))
i = int(i) + 1
point = "Pntclip_pol" + str(i)
dem = "clippol" + str(i)