I'd like to us the arcpy.GANeighborhoodSelection_ga in a loop where the point coords would come from a different source. What I tried already: If I define the coords, it works:
pointcoord = "689383.6885 3973775.2178" arcpy.GANeighborhoodSelection_ga(inFile2, "neighbor", pointcoord, "1", "1","20", "20", "0", "One sector") Result 'neighbor' When I try to use variable for the coords I got error:
pointcoord = x, y print pointcoord (689383.6885, 3973775.2178) arcpy.GANeighborhoodSelection_ga(inFile2, "neighbor", pointcoord , "1", "1","20", "20", "0", "One sector") Runtime error Traceback (most recent call last): File "", line 1, in File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\ga.py", line 1075, in GANeighborhoodSelection raise e RuntimeError: Object: Error in executing tool pointcoord = "\"" + x + ' ' + y + "\"" Runtime error Traceback (most recent call last): File "", line 1, in TypeError: cannot concatenate 'str' and 'float' objects pointcoord = "\"" + str(x) + ' ' + str
+ "\"" print pointcoord "689383.6885 3973775.2178" arcpy.GANeighborhoodSelection_ga(inFile2, "neighbor", pointcoord, "1", "1","20", "20", "0", "One sector") Runtime error Traceback (most recent call last): File "", line 1, in File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\ga.py", line 1075, in GANeighborhoodSelection raise e ExecuteError: ERROR 000622: Failed to execute (Neighborhood Selection). Parameters are not valid. ERROR 000628: Cannot set input into parameter point_coord.
أكثر...
pointcoord = "689383.6885 3973775.2178" arcpy.GANeighborhoodSelection_ga(inFile2, "neighbor", pointcoord, "1", "1","20", "20", "0", "One sector") Result 'neighbor' When I try to use variable for the coords I got error:
pointcoord = x, y print pointcoord (689383.6885, 3973775.2178) arcpy.GANeighborhoodSelection_ga(inFile2, "neighbor", pointcoord , "1", "1","20", "20", "0", "One sector") Runtime error Traceback (most recent call last): File "", line 1, in File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\ga.py", line 1075, in GANeighborhoodSelection raise e RuntimeError: Object: Error in executing tool pointcoord = "\"" + x + ' ' + y + "\"" Runtime error Traceback (most recent call last): File "", line 1, in TypeError: cannot concatenate 'str' and 'float' objects pointcoord = "\"" + str(x) + ' ' + str
أكثر...