import geomorph_routines_module


class LicenseError(Exception):
    pass


try:
    #Check for spatial analyst license
    if arcpy.CheckExtension("Spatial") == "Available":
        arcpy.CheckOutExtension("Spatial")
    else:
        raise LicenseError
    #
    inR = arcpy.GetParameterAsText(0)
    r = geomorph_routines_module.checkExt(inR)

    rOne = arcpy.GetParameterAsText(0)
    rasterOne = geomorph_routines_module.checkExt(rOne)
    rasterOneDesc = arcpy.Describe(rasterOne)
    rTwo = arcpy.GetParameterAsText(1)
    rasterTwo = geomorph_routines_module.checkExt(rTwo)
    rasterTwoDesc = arcpy.Describe(rasterTwo)

    # Set overwrite option
    env.overwriteOutput = True

    analysisWindow = arcpy.GetParameterAsText(3)

    #Set message about running
    arcpy.AddMessage("Calculating Statistics......")
Beispiel #2
0
import geomorph_routines_module


class LicenseError(Exception):
    pass


try:
    #Check for spatial analyst license
    if arcpy.CheckExtension("Spatial") == "Available":
        arcpy.CheckOutExtension("Spatial")
    else:
        raise LicenseError

    inR = arcpy.GetParameterAsText(0)
    r = geomorph_routines_module.checkExt(inR)
    inZUnits = arcpy.GetParameterAsText(1)
    zFactor = geomorph_routines_module.getZFactor(r, inZUnits)
    # Set overwrite option
    env.overwriteOutput = True

    # Getting info on raster
    dscRaster = arcpy.Describe(r)
    inSpRef = dscRaster.spatialReference
    spRefType = inSpRef.type
    cellSize = dscRaster.meanCellHeight
    if spRefType == "Geographic":
        cellSize = cellSize / zFactor
    slope = Slope(r, "DEGREE", zFactor)
    aspect = Aspect(r)
Beispiel #3
0
import geomorph_routines_module


class LicenseError(Exception):
    pass


try:
    #Check for spatial analyst license
    if arcpy.CheckExtension("Spatial") == "Available":
        arcpy.CheckOutExtension("Spatial")
    else:
        raise LicenseError

    r = arcpy.GetParameterAsText(0)
    demRaster = geomorph_routines_module.checkExt(r)
    dscRaster = arcpy.Describe(demRaster)

    zUnits = arcpy.GetParameterAsText(1)
    zFactor = geomorph_routines_module.getZFactor(demRaster, zUnits)
    t = arcpy.GetParameterAsText(2)
    s = arcpy.GetParameterAsText(3)

    # Set overwrite option
    env.overwriteOutput = True
    #Need to have appropriate extent, will not work in ArcMap if spRefs differ

    #Set message about running
    arcpy.AddMessage("Running Slope Impedance......")

    tmp1 = Slope(demRaster, "PERCENT_RISE", zFactor)