Repository for Ideas & Research
Open Source GIS, Hydrologic Modeling, Optimization

How to import ArcGIS flow direction into GRASS GIS

As shown in Figure 1, ArcGIS uses powers of two to represent the flow direction starting with \(2^0\) from East in the clockwise direction. Figure 2 shows how the r.watershed module in GRASS GIS encodes similar information in a raster map. This module measures the aspect of each cell in the counter-clockwise direction from East and divides the aspect angle by 45 so that East becomes 8, which is \(8\times 45^\circ=360^\circ\). East is not 0 because this module uses 0 to indicate depression areas.

 32  64 128
161
842
Figure 1: ArcGIS flow direction encoding
  3    2    1  
48
567
Figure 2: GRASS GIS drainage encoding

Using this information, you can import the flow direction raster from ArcGIS into GRASS GIS and convert it to the drainage raster.

  1. In ArcGIS, right click on the flow direction layer (fdr) => Data => Export Data
  2. Export fdr as GeoTiff (TIFF format). Output filename fdr.tif in this example.
  3. In GRASS GIS, import fdr.tif first:
    r.in.gdal input=fdr.tif output=fdr
  4. Convert fdr to drain:
    r.mapcalc expression="drain=int(8-log(fdr,2))"

Sat Jun 30 05:15:43 2018 EDT by Huidae Cho
Parsing time: 0.053 seconds
XHTML . CSS . Powered by Uniqki!