logo资料库

ArcGIS教程:Nibble (Spatial Analyst).docx

第1页 / 共2页
第2页 / 共2页
资料共2页,全文预览结束
地理国情监测云平台 http://www.dsac.cn/ 摘要 用最邻近点的值替换掩膜范围内的栅格像元的值。 插图 用法 · 包含 NoData 的输入栅格中的像元将被一点点地除去。要一点点地除去 NoData,首先将其转换为 其他值。 语法 Nibble (in_raster, in_mask_raster, {nibble_values}) 代码实例 Nibble 示例 1(Python 窗口) 此例使用由输入栅格的最邻近点确定的值来替换由输入掩膜所识别的像元。 import arcpy from arcpy import env from arcpy.sa import * env.workspace = "C:/sapyexamples/data" nibbleOut = Nibble("land", "snow", "DATA_ONLY") nibbleOut.save("C:/sapyexamples/output/nibbleout") Nibble 示例 2(独立脚本)
地理国情监测云平台 http://www.dsac.cn/ 此例使用由输入栅格的最邻近点确定的值来替换由输入掩膜所识别的像元。 # Name: Nibble_Ex_02.py # Description: Replaces cells of a raster corresponding to a mask # with the values of the nearest neighbors. # Requirements: Spatial Analyst Extension # Import system modules import arcpy from arcpy import env from arcpy.sa import * # Set environment settings env.workspace = "C:/sapyexamples/data" # Set local variables inRaster = "land" inMask = "snow" # Check out the ArcGIS Spatial Analyst extension license arcpy.CheckOutExtension("Spatial") # Execute Nibble nibbleOut = Nibble(inRaster, inMask, "ALL_VALUES") # Save the output nibbleOut.save("C:/sapyexamples/output/outnibble") 环境 像元大小, 当前工作空间, 掩膜, 输出坐标系, 范围, 临时工作空间, 捕捉栅格
分享到:
收藏