import arcpy
from arcpy import env
from arcpy.ia import *
env.workspace = "C:/iapyexamples/data"
outBooleanNot = BooleanNot("degs")
outBooleanNot.save("C:/iapyexamples/output/outboolnot.tif")
BooleanNot 示例 2(独立脚本)
本例对 Grid 栅格执行“布尔非”(求反)运算。
# Name: BooleanNot_Ex_02.py
# Description: Performs a Boolean complement (NOT) operation on the
# pixel values of an input raster
# Requirements: Image Analyst extension
# Import system modules
import arcpy
from arcpy import env
from arcpy.ia import *
# Set environment settings
env.workspace = "C:/iapyexamples/data"
# Set local variables
inRaster = "degs"
# Run BooleanNot
outBooleanNot = BooleanNot(inRaster)
# Save the output
outBooleanNot.save("C:/iapyexamples/output/outboolnot")