0

I am using ArcMap 10.8.

I have a flow direction raster and many point shapefiles with one feature each.

I want to calculate one raster watershed for each point shapefile

fd = "C:/sample/raster/gwo_flowdir.tif"
dirpoints = "C:/sample/shp/gof_no3_single/"
dirraster = "C:/sample/raster/single_wsheds/"
allids = [5000,5001,5002,5003,5005]
allids = [str(x) for x in allids]
for id in allids:
    arcpy.gp.Watershed_sa(fd, dirpoints+id+".shp", dirraster+id+".tif", "ID")

The single output watersheds are written, and contain information in the attribute table:

enter image description here

However, when I load the raster into ArcMap, the raster cells are not displayed/not visible, whereas they ARE written and visible when I use watershed as a 'stand-alone' tool

2
  • Are you saying that when you run the code you are not seeing the results in the map, but the code runs without error? The reason why is that nowhere in your code do you say, add the output to the map. A simple solution would be go to the folder and add the rasters to your map.
    – Hornbydd
    Mar 30, 2022 at 10:48
  • The code runs without error, the raster is created and also contains the right information (number of cells in the watershed, field 'count) in the attribute table, but the cells are not visible'
    – TVolt
    Mar 30, 2022 at 10:56

1 Answer 1

0

In your screen shot you show an example of some output but you say it is not visible. As you are creating watersheds it is highly suspicious that your watershed consists of only 2 pixels as per your example.

I suspect you simply cannot see the two pixels as one would be expecting to see a proper drainage catchment. A catchment of 2 pixels is not a catchment.

Your code shows no attempt to snap the pour point before you attempt to generate the watershed which is the standard approach. Taking a point and using that to generate a catchment without attempting to align it to the main channel will generate erroneous catchments, often very small as they are capturing the valley side. I believe this is what is happening to you.

There are similar q&a on this forum about this topic, you need only search for snap pour point, for example this.

3
  • I am aware that the depicted 'watershed' in the attribute table is very small (only 2 cells, 2*20m*20m=800m²). This is because I am working with wells and an interpolated groundwater surface (groundwater flow direction), so the wells are not supposed to be 'watershed outlets' in the sense of surface hydrology. I only try to use the watershed tool to model an approximate inflow direction/area towards these wells
    – TVolt
    Mar 30, 2022 at 13:14
  • May be you should have mentioned that important information in your question? You are using tools that were designed to model surface water and you are "misusing" them with a groundwater surface DEM. I'm not a groundwater specialist so can't really comment on your approach.
    – Hornbydd
    Apr 1, 2022 at 15:23
  • Actually the information of using the groundwater surface and not a DEM is not important for my question. Besides, I created a hydrologically conditioned groundwater surface using the Fill Tool to get proper flow directions and accumulation. My problem seems to be only technical. Like I wrote, outside of the 'for-loop' the watershed tool provides satisfying results.
    – TVolt
    Apr 7, 2022 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.