[GIS] pour point user click input over map for watershed delineation

arcgis-10.0arcpy

I have a drainage density map and i want to interactively retrieve watershed by clicking a point on map. Once I zoomed to an area of interest and click the highest accumulation point of my choice then i get in return watershed only encompassing that outlet. I am wondering if anyone had already done that manually or automatically. Any suggestion to do it will be helpful.

Thanks.

Best Answer

To do this I think you need to use:

  1. Snap Pour Point
  2. Watershed
  3. Feature Set parameter (to let you indicate a point on your map) for a model or script that runs the above

UPDATE

I do not have a Spatial Analyst license to test the Snap Pour Point and Watershed parts, but I just tested the Feature Set parameter to ask a user to input a point using the cursor on a map, and then buffer it. This demonstrates the remaining bit that seems to be causing you problems.

The Python script (test.py) is:

import arcpy

geom = arcpy.GetParameter(0)

arcpy.Buffer_analysis(geom,"C:/Support/Prasad/test.gdb/testPntBuffer","1 DecimalDegrees","FULL","ROUND","NONE","#")

I then created a point feature class with the correct coordinate system to act as the schema for the point I want to Buffer (or in your case to Snap Pour Point then Watershed).

When I used Add Script to create a tool from test.py I just gave it one parameter:

enter image description here

With that done I run the tool, which gives me the chance to click on the map to create a point geometry that gets passed to the Python script to Buffer it.