ArcGIS for Desktop

  • 文档
  • 合约
  • 支持

  • My Profile
  • 帮助
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS for Desktop

全面的专业性 GIS

ArcGIS for Server

面向企业的 GIS

ArcGIS for Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 合约
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

帮助

  • 主页
  • 入门
  • 制图
  • 分析
  • 管理数据
  • 工具
  • 更多...

//

需要 Spatial Analyst 许可。

  • 摘要
  • 插图
  • 用法
  • 语法
  • 代码实例
  • 环境
  • 许可信息

摘要

将两个栅格的值逐像元地整除。

插图

Divide illustration
OutRas = Raster("InRas1") // Raster("InRas2")

讨论

使用具有栅格输入的运算符时,结果将为栅格。但是,如果所有输入为数字,那么结果也是数字。

当表达式中使用多个运算符时,其不一定按照从左到右的顺序执行。具有最高优先值的运算符将首先执行。有关运算符优先级的详细信息,请参阅运算符优先级表。您可使用括号来控制执行顺序。

此运算符的运算结果与输入的顺序有关。

当一个数除以零时,输出结果为 NoData。

如果两个输入均为整数,则输出为整数值。例如,如果 5 除以 2,则输出为 2(舍去余数)。

如果其中一个输入为浮点型,则输出的商将为浮点型。例如,如果 5.3 除以 2,则输出为 2.0(舍去余数 0.65)。

执行“整除”运算的另一个方法为 a //= b,这是 a = a // b 的另一种写法。

语法

in_raster_or_constant1 // in_raster_or_constant2
操作数说明数据类型
in_raster_or_constant1

The input whose values will be divided by the second input.

If the first input is a raster and the second is a scalar, an output raster is created with each input raster value being divided by the scalar value.

Raster Layer | Constant
in_raster_or_constant2

The input whose values the first input are to be divided by.

If the first input is a scalar and the second is a raster, an output raster is created with each input raster value being divided into the scalar value.

Raster Layer | Constant

返回值

名称说明数据类型
out_raster

输出栅格对象。

The cell values are the quotient of the first input raster (dividend) divided by the second input (divisor).

Raster

代码实例

// (Integer Division) example 1 (Python window)

This sample divides the values of the first input raster by the second.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outDivide = Raster("degs") // Raster("negs")
outDivide.save("C:/sapyexamples/output/outdivide")
// (Integer Division) example 2 (stand-alone script)

This sample divides the values of the first input raster by the second.

# Name: Op_IntegerDivide_Ex_02.py
# Description: Divides the values of two rasters on a cell-by-cell basis
# 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
inRaster01 = Raster("elevation")
inRaster02 = Raster("landuse")

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute Integer Divide
outDivide = inRaster01 // inRaster02

# Save the output 
outDivide.save("C:/sapyexamples/output/outdivide2")

环境

  • 像元大小
  • 当前工作空间
  • 掩膜
  • 输出坐标系
  • 范围
  • 临时工作空间
  • 捕捉栅格

相关主题

  • 地图代数运算符概述
有关此主题的反馈?

ArcGIS for Desktop

  • 主页
  • 文档
  • 合约
  • 支持

ArcGIS 平台

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • 内部人员博客
  • 用户大会
  • 开发者峰会
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | 隐私政策 | 法律声明