## 2 Data and Methods
### Methods
#### 2.3.1 Landscape Metrics Method  
Landscape ecology takes the knowledge system of geography and ecology as the framework and constructs landscape indexes based on the spatial distribution characteristics of regional landscapes to describe the characteristics of each block to carry out targeted analysis on the spatial distribution of regional parcels, such as dominance degree, concentration degree, and connectivity degree [54; 62; 63; 64; 65; 66]. Commonly used software for landscape spatial pattern analysis includes APACK, SIMMAP, LEAP, and Fragstats [58]. This article uses Fragstats4.1 as an analysis tool to calculate the landscape index of the main types of land use in Shanghai. The number of patches (NP), mean patch size (MPS), path density (PD), largest path index (LPI) and landscape shape index (LSI) were selected to analyze the landscape spatial patterns (Table 3). Here, NP is the total number of plots of land type, which can reflect the concentration or fragmentation degree of land type. Generally, a greater NP value corresponds to a higher fragmentation degree of land, with a lower value corresponding to a higher concentration degree. MPS is the ratio between the area and the number of patches, which indirectly reflects the expansion or shrinkage trend of the landscape lot. With an increase in MPS, the land type generally presents an expansion trend, and vice versa. The information reflected by PD is similar to that reflected by NP, and it is suitable for the macroscopic display of the concentration or fragmentation degree of land type and is also a negative indicator of land spatial concentration degree. LPI is the largest patch area in the land type and represents a simple index for measuring landscape dominance. LSI reflects the degree of agglomeration or dispersion of land type. A larger LSI corresponds to a more discrete land type and more irregular and disorderly characteristics. However, when the LSI becomes increasingly concentrated, it represents a negative index of land space concentration degree and an important index in landscape ecological statistics [64]. To further analyze the spatial structure of the landscape of the land, we selected AI, MNN, DIVISION, CONNECT, COHESION, and SPLIT [48] to quantify the landscape spatial structure characteristics of land use in Shanghai (Table 4). \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Acronym** & **Name** & **Formula** & **Definition** \\ \hline NP & Number of patches & \(NP=n_{i}\) & \(n_{i}\) is the number of patches contained in type \(i\) \\ MPS & Mean patch size & \(MPS=\frac{\alpha_{i}}{n_{i}}\) & \(CA\) is the type of patches area, \(n_{i}\) is the number of patches of type \(i\) \\ PD & Path density & \(PD=\frac{n_{i}}{\sigma}\left(10000\right)*\left(100\right)\) & \(n_{i}\) is the number of patches of type \(i\), \(A\) is the total area of all landscapes \\ LPI & Largest path index & \(LPI=\frac{\max_{i}}{A^{\lambda}}*\left(100\right)\) & \(a_{ij}\) is the area of patch \(ij\), \(A\) is the total area of all landscapes \\ LSI & Landscape shape index & \(LSI=\frac{\alpha_{i}}{min_{i}}*\left(10000\right)*\left(100\right)\) & \(e_{i}\) is the total edge length or perimeter of type patch, and \(mine_{i}\) is the possible minimum value of \(e_{i}\) \\ \hline \hline \end{tabular} Note: Type \(i\) represents the landscape type of cultivated land, while patch \(ij\) represents the patch of cultivated land.  
\end{table} 
Table 3: The calculation formula and definitions of landscape pattern indexes. Here, the aggregation index (AI), which mainly reflects the degree of spatial concentration of a land use type, is calculated based on the length of the common boundary between pixels of the same land use type. The higher the AI value is, the higher the degree of spatial agglomeration of the land use type is. The mean nearest distance (MNN) refers to the average distance to the nearest adjacent patches of the same type. Larger values of MNN indicate that patches of the same land use type are more scattered.