Last active
July 21, 2017 09:29
-
-
Save crazyzlj/1cde498f1c0d97166a7f0404b2c8b3df to your computer and use it in GitHub Desktop.
pygeoc_examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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