ArcGIS教程:按属性提取 (空间分析)
来源:互联网 发布:python idle 下载 编辑:程序博客网 时间:2024/05/18 03:49
摘要
基于逻辑查询提取栅格像元。
插图
用法
· 如果 Where 子句的求值结果是 True,则将为该像元位置返回初始输入值。如果其求值结果是 False,则将为像元位置指定 NoData。
· 对于输出栅格,将舍弃输入栅格中的所有额外项(值和计数除外)。
· 如果在 Where 子句中指定了除输入栅格的值以外的某一项,则将为此像元位置返回初始输入值。
· 当输入为多波段栅格时,将输出一个新的多波段栅格。对输入多波段栅格中的每一单个波段都会进行相应分析。
默认输出格式是 Esri Grid 堆栈。请注意,Esri Grid 堆栈的名称不能以数字开头、不能使用空格,并且长度不能超过 9个字符。
· 如果输入内容为根据多波段栅格(超过三个波段)创建的图层,提取操作将只考虑图层加载(符号化)的波段。因此,输出的多波段栅格只会具有三个波段,分别对应于输入图层显示中使用的多波段栅格。
· 如果输入栅格为整型,那么输出栅格也为整型。如果输入栅格为浮点型,则输出栅格也为浮点型。
代码实例
按属性提取 (ExtractByAttributes) 示例 1(Python 窗口)
本示例将基于逻辑查询从栅格中提取像元,其中高程大于 1,000 米。
import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
attExtract = ExtractByAttributes("elevation", "VALUE > 1000")
attExtract.save("c:/sapyexamples/output/attextract")
按属性提取 (ExtractByAttributes) 示例 2(独立脚本)
本示例将基于逻辑查询从栅格中提取像元,其中高程大于 1,000 米。
# Name: ExtractByAttributes_Ex_02.py
# Description: Extracts the cells of a raster based on a logical query.
# 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 = "elevation"
inSQLClause = "VALUE > 1000"
# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")
# Execute ExtractByAttributes
attExtract = ExtractByAttributes(inRaster, inSQLClause)
# Save the output
attExtract.save("c:/sapyexamples/output/attextract02")
- ArcGIS教程:按属性提取 (空间分析)
- ArcGIS教程:按圆形区域提取 (空间分析)
- ArcGIS教程:用矩形提取 (空间分析)
- ArcGIS教程:多边形提取 (空间分析)
- ArcGIS教程:用点提取 (空间分析)
- ArcGIS教程:按掩膜提取 (空间分析)
- ArcGIS教程:值提取至点 (空间分析)
- ArcGIS教程:多值提取至点 (空间分析)
- ArcGIS教程:按属性、形状或位置进行提取
- ArcGIS教程:采样 (空间分析)
- ArcGIS教程:路径距离 (空间分析)
- ArcGIS教程:欧氏距离 (空间分析)
- ArcGIS教程:欧氏方向 (空间分析)
- ArcGIS教程:欧氏分配 (空间分析)
- ArcGIS教程:成本路径 (空间分析)
- ArcGIS教程:成本距离 (空间分析)
- ArcGIS教程:成本距离 (空间分析)
- ArcGIS教程:成本回溯链接 (空间分析)
- zabbix 2.4 报错汇总
- public、private、protected、Friendly的区别与作用域,以及不写时的区别?
- 彻底解决mysql中文乱码的办法
- QT图片有彩到灰
- connect永远阻塞线程及解决方案
- ArcGIS教程:按属性提取 (空间分析)
- mysql varchar
- [Mysql] Limit分页性能陷阱
- CCT之CAMERA TUNNING调试学习总结
- Dialog
- 关于java StringBuilder初始化的一个坑
- 将txt转换pdf的详细操作步骤
- Android数据库高手秘籍(一)——SQLite命令
- Tomcat安装运行详解