Original User: csny490"If something is hard you should just give up, since it probably wasn't worth doing it in the first place."
NOT! 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?)Okay - How about this (and BTW, this would go way faster if you can coarsen the cell size). Also, make sure the cells are all alligned by setting a snap raster. Also, be aware you might fill up your RAM depending on how many pixels are involved:1. For each tower make a viewshed/euclidean distance raster so that the output raster name has the tower id in it "tower_12", and the raster values are the distances away from the tower.2. Convert that raster to a point featureclass. 3. Using a search cursor, load all the point FCs into a Python dictionary. The dictionary key will be a tuple of the X,Y coordinate pair.So maybe some thing like this (warning UNTESTED!):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()
So now (I think) you have everything you need to compute the score:How many towers are visible at a given x,y coordinate? len(pointDict[xyKey])What is the closest tower's distance to a given x,y coordinate? pointDict[xyKey][0][0]What is the closest tower id to a given x,y coordinate? pointDict[xyKey][0][1]How about the 2nd closest tower distance? Or the 3rd? pointDict[xyKey][1][0], pointDict[xyKey][2][0]How about the 2nd closest tower id? Or the 3rd? pointDict[xyKey][1][1], pointDict[xyKey][2][1]