RATSforClassification.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:python_scripting_for_spatial_data_processing 作者: upsdeepak 项目源码 文件源码
def classifyLevel1Assign(classLevel1Img):
    # Create Output Array
    level1 = numpy.empty_like(classLevel1Img, dtype = numpy.dtype('a255'))
    level1[...] = "NA"
    # Non Vegetated
    level1 = numpy.where(numpy.logical_or(classLevel1Img == "NA",
                                          numpy.logical_or(classLevel1Img == "Water",
                                                           classLevel1Img == "Urban")),
                         "Non Vegetated", level1)

    # Vegetated
    level1 = numpy.where(numpy.logical_or(classLevel1Img == "Photosynthetic Vegetated",
                                          classLevel1Img == "Non Photosynthetic Vegetated",
                                          classLevel1Img == "Non Submerged Aquatic Vegetated"),
                         "Vegetated", level1)

    return level1

# A function for classifying level 2
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号