ArcGIS - Flow directions in the 4 cardinal directions only (North, East, South and West)

I would like to know if there is a way to calculate the flow directions in the 4 cardinal directions only (North, East, South and West). Indeed, ArcGIS transfers the flows in the 8 directions, which I don't want.

Does anyone have any idea how to proceed?

• Thanks for the answer. That's exactly what I'm looking for. Could you post the code because in the subject you indicate, it seems to me that it is not there. Sep 2 '18 at 8:13
• This is because he replied to my post half year later with advise to post solution. It's like dealing with a bot. Sep 2 '18 at 8:24
• Yes, it's true, it's not right. It would really help if you would send me your code. Thank you in advance. Sep 2 '18 at 8:36
• Tomorrow, if I have time. Sep 2 '18 at 9:45

Rotate your cost raster (DEM) by 45 degrees using any point in the middle. Set env. extent and cell size to ROTATED. Derive rows and columns rasters using technique described here.

Call rasters accordingly and find diagonal cells:

arcpy.gp.RasterCalculator_sa('("ROWS"*1261+"COLUMNS")%2', "C:/SCRATCH/chessboard")

I used 1261 here because max(COLUMNS)=1260 in my case. Number must be odd. Make sure output looks like that: Modify ROTATED using:

arcpy.gp.RasterCalculator_sa('Con("chessboard" == 1,"ROTATED","ROTATED"+10)', "C:/SCRATCH/pilars")

to force diagonal directions. Fill PILARS, derive Flow Directions and flow paths. Use flow direction to convert paths to polylines.

Un-rotate polylines to see: I used this field calculator expression to un-rotate streams:

from math import sin, cos
a=- math.pi/4
def RotateLine(x0,y0, shp):
part=shp.getPart(0)
ar=arcpy.Array()
for i in range(len(part)):
p=part.getObject(i)
x,y = p.X-x0, p.Y-y0
xN=cos(a)*x+sin(a)*y
yN=-sin(a)*x+cos(a)*y
pN=arcpy.Point(xN+x0,yN+y0)