ArcGIS for Desktop

  • Documentación
  • Precios
  • Soporte

  • My Profile
  • Ayuda
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

La plataforma de representación cartográfica para tu organización

ArcGIS for Desktop

Un completo SIG profesional

ArcGIS for Server

SIG en tu empresa

ArcGIS for Developers

Herramientas para crear aplicaciones basadas en la ubicación

ArcGIS Solutions

Plantillas de aplicaciones y mapas gratuitas para tu sector

ArcGIS Marketplace

Obtén aplicaciones y datos para tu organización.

  • Documentación
  • Precios
  • Soporte
Esri
  • Iniciar sesión
user
  • Mi perfil
  • Cerrar sesión

Help

  • Inicio
  • Introducción
  • Mapa
  • Analizar
  • Administrar datos
  • Herramientas
  • Más...

NbrRectangle

Disponible con una licencia de Spatial Analyst.

  • Resumen
  • Ilustración
  • Debate
  • Sintaxis
  • Propiedades
  • Ejemplo de código

Resumen

Defines a rectangle neighborhood which is created by specifying the height and the width in either map units or number of cells.

Ilustración

NbrRectangle neighborhoods for FocalStatistics function
NbrRectangle neighborhood examples for the FocalStatistics function.
NbrRectangle neighborhood for BlockStatistics function
NbrRectangle neighborhood example for the BlockStatistics function (width = 6 cells, height = 4 cells).

Debate

Tools that use neighborhood rectangle object: Block Statistics, Focal Statistics, Point Statistics, and Point Density.

The rectangle neighborhood is specified by providing a width and a height in either cells or map units.

When rectangle is used in a focal tool the x, y position of the processing cell within the neighborhood is determined, with respect to the upper-left corner of the neighborhood, by the following equations:

 x = (width of the neighborhood + 1)/2
 y = (height of the neighborhood + 1)/2

If the input number of cells is even, the x,y coordinates are computed using truncation.

Only the cells whose centers fall within the defined object are processed as part of the rectangle neighborhood.

Sintaxis

 NbrRectangle ({width}, {height}, {units})
ParámetroExplicaciónTipo de datos
width

The width of the rectangle neighborhood.

If only the width is specified, the resulting neighborhood is a square.

(El valor predeterminado es 3)

Double
height

The height of the rectangle neighborhood.

If only the height is specified, the resulting neighborhood is a square.

(El valor predeterminado es 3)

Double
units

Defines the units of the neighborhood.

  • CELL —The unit of measurement is in cells.
  • MAP —The units are in map coordinates.

(El valor predeterminado es CELL)

String

Propiedades

PropiedadExplicaciónTipo de datos
width
(Lectura y escritura)

The width of the rectangle neighborhood.

If only the width is specified, the height will default to the same as the width, resulting in a square neighborhood.

Double
height
(Lectura y escritura)

The height of the rectangle neighborhood.

If only the height is specified, the width will default to the same as the height, resulting in a square neighborhood.

Double
units
(Lectura y escritura)

Defines the units of the neighborhood.

String

Ejemplo de código

NbrRectangle example 1 (Python window)

Demonstrates how to create a NbrRectangle class and use it in the BlockStatistics tool within the Python window.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outNbrRec = BlockStatistics("block", NbrRectangle(4, 5, "MAP"))
outNbrRec.save("C:/sapyexamples/output/blstatsnbrr2")
NbrRectangle example 2 (stand-alone script)

Implements the BlockStatistics tool using the NbrRectangle class.

# Name: NbrRectangle_Ex_02.py
# Description: Uses the NbrRectangle object to execute BlockStatistics tool.
# 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 = "block"

# Create the Neighborhood Object
width = 5
height = 6
myNbrRec = NbrRectangle(width, height, "MAP")

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

# Execute BlockStatistics
outBlkStat =  BlockStatistics(inRaster, myNbrRec, "MINIMUM", "DATA")

# Save the output 
outBlkStat.save("C:/sapyexamples/output/blstat_rec3")

Temas relacionados

  • An overview of Spatial Analyst classes
  • An overview of neighborhood classes
¿Algún comentario sobre este tema?

ArcGIS for Desktop

  • Inicio
  • Documentación
  • Precios
  • Soporte

Plataforma ArcGIS

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

Acerca de Esri

  • Quiénes somos
  • Empleo
  • Blog interno
  • Conferencia de usuarios
  • Cumbre de desarrolladores
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacidad | Legal