先回顾一下raster和grid数据结构概念上的辨析:
推荐系列博文:http://blog.csdn.net/redhairp/article/details/7242026
raster:
The term raster data structure refers to a matrix composed of distinct units called
pixels or cells. Each pixel or cell stores a numeric value. The pixels in a raster image usually consist of continuous brightness values represented as digital numbers. A raster image may be converted into a raster map by using image processing techniques to label each pixel with a numeric value indicating its category or surface type. Raster maps can also be created by rasterizing existing digital vector maps.
光栅数据结构是指由不同的单元组成的矩阵,称为像素或单元格。每个像素或单元存储一个数值。光栅图像中的像素通常由以数字表示的连续亮度值组成。光栅图像可以通过使用图像处理技术将每个像素标记为指示其类别或表面类型的数值来转换为光栅地图。光栅地图也可以通过栅格化现有的数字矢量地图来创建。
grid:
GRID is an implementation of the generic raster data structure. It uses blocks and tiles for spatial indexing and an adaptive run-length compression technique for reducing storage. The values associated with the cells in a grid may be continuous or discrete. Hence, both raster images and raster maps can be stored in GRID. The operators that are part of the GRID system are designed for the analysis and overlay of raster maps. However, they may also be usefully employed for a variety of image-processing and analysis tasks.
网格是一种通用光栅数据结构的实现。它使用块和分片进行空间索引,并使用自适应游程压缩技术来减少存储。与网格中的单元格相关联的值可以是连续的,也可以是离散的。因此,栅格图像和栅格地图都可以存储在栅格中。作为栅格系统一部分的运算符是为栅格地图的分析和叠加而设计的。然而,它们也可用于各种图像处理和分析任务。
栅格重分类提示出错,多半是因为没有把grid格式转化为tiff格式所致。
Arcpy栅格批量相除:
推荐博文:用Arcpy批量进行栅格计算_darcy_vb的博客-CSDN博客_arcpy 栅格计算器
https://blog.csdn.net/darcy_vb/article/details/85918454?utm_medium=distribute.pc_relevant.none-task-blog-OPENSEARCH-3.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-OPENSEARCH-3.not_use_machine_learn_pai
Arcpy栅格批量裁剪
>>> import arcpy
>>> arcpy.env.workspace="H:\pptmean"#要裁剪的栅格影像的位置
>>> rasters = arcpy.ListRasters("*","tiff")#读取tiff格式数据
>>> print rasters
>>> rasters = arcpy.ListRasters("*","grid")#读取grid格式数据
>>> print rasters
[u'2003pptmean', u'2004pptmean', u'2005pptmean', u'2006pptmean', u'2007pptmean', u'2008pptmean-', u'2009pptmean-', u'2010pptmean', u'2011pptmean', u'2012pptmean-', u'2013pptmean', u'2014pptmean-', u'2015pptmean', u'2016pptmean-', u'2017pptmean', u'2018pptmean']
>>> mask = "H:/ETHAI03-18/ETH.shp"#用于裁剪的shp文件位置
>>> for raster in rasters:
... out = "H:/ETHAI03-18/clip/"+"clip_"+raster#裁剪后数据位置和数据名称设定
... arcpy.gp.ExtractByMask_sa(raster,mask,out)
... print("clip_"+raster+"has done")
: