1 Create Fishnet
先准備好需要格網化的polygon矢量
打開Toolbox中的 Data Management Tools,選擇 Create Fishnet
Create Fishnet creates a feature class containing a net of rectangular cells.創造一個包含一些列矩形Polygon的shp
使用該工具要求以下三個基本信息:
the spatial extent of the fishnet, the number of rows and columns, and the angle of rotation. 空間范圍 行列數 旋轉角度
The tool has 11 parameters, and you should think of these in four distinct groups:
- The spatial extent of fishnet
- The number of rows and columns and height and width of each cell in the fishnet 輸入好行列數/輸入cell高度和寬度
- The angle of rotation for the fishnet
- Parameters that define the output feature class name and type (polygons or lines) and an optional point dataset containing centroids of each cell
根據需要旋轉的角度,以及右上角頂點的y軸坐標,即可使用tan函數計算出右上角頂點坐標,作為 Opposite corner of Fishnet 處的坐標值
Output feature class 輸出
可以選擇輸出為POLYGON 或者 POLYLINE
如果要使用Overlay工具集中的工具在網格上疊加分析,建議選擇 POLYGON 作為輸出類型
如果只是為了顯示網格,選擇輸出幾何類型為 POLYLINE 即可(輸出為 POLYGON 比 POLYLINE 要慢很多)
得到1km×1km網格的矢量:
可以使用Clip工具對網格矢量進行裁剪:
得到如下矢量:
2 分區統計
想要計算每個網格中的不同土地利用類型的像元數量(或者是計算某種土地利用類型在網格中所占的比例)可以使用分區統計工具集
例如,想計算每個網格中建設用地(紅色區域)所占的面積比例,以表征城市發展強度
這一步可以先把建設用地重分類為1,其他類型重分類為0
With the Zonal Statistics tool, a statistic is calculated for each zone defined by a zone dataset, based on values from another dataset (a value raster). A single output value is computed for every zone in the input zone dataset.
A zone is all the cells in a raster that have the same value, whether or not they are contiguous. The input zone layer defines the shape, values, and locations of the zones. An integer field in the zone input is specified to define the zones. A string field can also be used. Both raster and feature datasets can be used as the zone dataset.
The input value raster contains the input values used in calculating the output statistic for each zone.
In the following illustration, the Zone layer demonstrates an input raster that defines the zones. The Value layer contains the input for which a statistic is to be calculated per zone.
In this example, the maximum of the value input is to be identified for each zone.
因此,將得到的網格矢量新建一個ID字段以標識每個網格多邊形,再輸入想要計算的柵格數據在每個網格中的像元的最大、最小、平均值等等。
Output data type
* Only integer is supported.
操作步驟:
如果區域輸入是矢量要素數據集,應先對其進行“矢量至柵格”轉換。並且要確保轉換結果與值柵格圖像完全對齊,建議您檢查環境設置和柵格設置中的范圍和捕捉柵格是否設置正確。
如果是柵格數據,則應該保證區域輸入和值柵格的像元大小一致,且影像范圍一致。
進行分區統計
位於空間分析工具箱中:
得到的結果:
替代方法:
先將柵格數據轉為點矢量,這里發現像元的個數和矢量點的個數是相同的。
右擊生成的網格矢量grid.shp,選擇Join
選擇基於空間位置連接數據
生成的矢量的屬性表:Count_代表每個網格中的像元點的個數,Sum_Grid_C代表每個網格中所有的像元點的值的總和(這里等於建設用地像元點的總數量)
通過字段計算器將 Sum_Grid_C / Count_ 即可得到每個網格中的建設用地所占比例。
其實因為只要計算建設用地的面積比例,而建設用地的值是1,因此,直接選擇計算落在每個網格中的所有矢量點的值的均值,得到的結果就是建設用地面積比例。
結果如下:
參考:ArcGIS10.4 幫助文檔
https://www.cnblogs.com/Roxy121314/p/9703369.html
https://desktop.arcgis.com/zh-cn/arcmap/10.3/tools/spatial-analyst-toolbox/zonal-statistics.htm