Skip to content

Instantly share code, notes, and snippets.

@crazyzlj
Last active July 21, 2017 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crazyzlj/1cde498f1c0d97166a7f0404b2c8b3df to your computer and use it in GitHub Desktop.
Save crazyzlj/1cde498f1c0d97166a7f0404b2c8b3df to your computer and use it in GitHub Desktop.
pygeoc_examples
if __name__ == '__main__':
import os
from seims.pygeoc.pygeoc.hydro.hydro import D8Util
dirname = r'C:\z_data\ChangTing\dem\dem_v1986_bj1954\watershed_delineation\youwuzhen_10m_omp\spatial_raster'
infile = dirname + os.sep + r'flow_dir.tif'
outfile = dirname + os.sep + r'flow_dir_ag.tif'
D8Util.convert_code(infile, outfile, "taudem", "arcgis", 2)
# Export to GeoTIFF tool in Whitebox GAT not work in my computer, so export as ASCII file, and use raster_to_gtiff() to convert.
inasc = r'hillslope_wb.asc'
outtif = r'hillslope_wb.tif'
from seims.pygeoc.pygeoc.raster.raster import RasterUtilClass
RasterUtilClass.raster_to_gtiff(inasc, outtif)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment