美文网首页
利用Python在ArcGIS里面判断坡度和坡向

利用Python在ArcGIS里面判断坡度和坡向

作者: 任源_c4d5 | 来源:发表于2021-11-17 13:24 被阅读0次

    利用Python在ArcGIS里面判断坡度和坡向

    问题

    需求

    解决方法

    def reclass(slope, aspect):
        if slope < 5:
            result = ('无坡度')
        else:
            if aspect > 338:
                result = ('北坡')
            elif aspect > 293:
                result = ('西北坡')
            elif aspect > 248:
                result = ('西坡')
            elif aspect > 203:
                result = ('西南坡')
            elif aspect > 158:
                result = ('南坡')
            elif aspect > 113:
                result = ('东南坡')
            elif aspect > 68:
                result = ('东坡')
            elif aspect > 23:
                result = ('东北坡')    
            else:
                result = ('北坡')
        return result
    
    

    效果

    效果

    反思

    高度注意python里面的缩进问题,不同的软件tab缩进的字符不一样,少用tab,多用空格键。

    相关文章

      网友评论

          本文标题:利用Python在ArcGIS里面判断坡度和坡向

          本文链接:https://www.haomeiwen.com/subject/amultrtx.html