Solved! Go to Solution.
rasters2 = arcpy.ListRasters("Raster*") for raster in rasters: print "processing raster:"+raster #big extent arcpy.env.extent = "C:/studium/00_Master/clean/clipper.shp" #convert nodata to zero out1 = Con(IsNull(raster), 0, raster) #sum rasters together if i == 0: out2 = out1 i += 1 else: out2 = out2 + out1 i += 1 head, tail = ntpath.split(raster) #save final output out2.save("C:/studium/project/script6/output.tif")
arcpy.env.extent = "C:/studium/00_Master/clean/clipper.shp" comboGrdList = [] rastersList = arcpy.ListRasters("Raster*") for raster in rasterList: out1 = Con(IsNull(raster), 0, raster) out1.save("twr_" + str(raster.split("_")[-1])) #assuming that raster is something like "tower_12" comboGrdList.append(out1) comboGrd = arcpy.sa.Combine(comboGrdList)
comboGrd = arcpy.sa.Combine(comboGrdList)
create a heat map or the like (I think that's basically what you have)
normalize the values for the heat map so that they range from 0 to 1
"If something is hard you should just give up, since it probably wasn't worth doing it in the first place."
pointDict = {} pointFcList = ["tower_1.shp","tower_2.shp","tower_3.shp"] for pointFc in pointfcList: searchRows = arcpy.da.SearchCursor(pointFc, ["SHAPE@XY","DISTANCE"]) towerId = pointFc.split("_")[-1] for searchRow in searchRows: xyKey, distance = searchRow if xyKey not in pointDict: pointDict[xyKey] = [(distance, towerId)] else: pointDict[xyKey].append((distance, towerId)) for keyKey in pointDict: pointDict[xyKey].sort()
for pointFc in pointfcList:must be pointFcList
for keyKey in pointDict:must be pointDict[keyKey].sort()
pointDict[xyKey].sort()
towerId = pointFc.split("_")[-1]I added [:-4] to cut off the ".shp"
Question: What if two towers were visible: One at 200m distance, and the other at 201m distance (shouldn't that distance rank variable be a bit more scaler?)