## 2 Methods
### Pre-Earthquake Phase  
#### 2.1.1 Population Distribution  
The true spatial distribution of the population should be conducted using a census. However, this approach is both costly and difficult to achieve. To address this issue, this paper explores the intrinsic link between building size, building function, and people distribution, using an area weighting method to refine the population of different age levels to each building. The specific calculation process is shown in Equations (2)-(4). \[P_{i}=P1+P2 \tag{2}\]  
\[P1_{i}=\frac{S}{S_{i}}\times T \tag{3}\]  
\[P2_{i}=\frac{S}{S_{i}}\times R \tag{4}\]  
In the above equation, \(P_{i}\) stand for the population in the building with function \(i\). \(P1\), \(P2\), and \(S\), respectively, stand for the resident population, random population, and floor area of the building with function \(i\). \(S_{i}\), \(T\), and \(R\), respectively, stand for total building area in different functions, total population, and total mobile population under the function of the administrative district where they are located. Since the population distribution of each building is not counted in most undeveloped areas, we need to simulate the population of each building according to different age groups and different building functions. Firstly, we will simulate the total number of resident staff in buildings with the same function. According to the work of different groups, we will divide them into the following groups: 0-14 years old, 14-60 years old, and over 60 years old, and we will allocate different age groups to the same function according to their functions. For example, the 0-14-year-old group is mainly in education during the day and accommodation at night. In the daytime, the total number of schools is equal to the total number of permanent residents aged 0-14. Then, population distribution of individual buildings is conducted according to Equation (3), which concerns the proportion of each school area to the total area of education services. Through the study of indoor population in Sichuan area [27; 28], the functional areas of each age group in different time periods were summarized. Tables 2 and 3 below show the corresponding architectural functions at different ages and times. Building area \(S\)  
The content of basic geographic data varies from region to region around the world, and not all regions have real-time updated building mapping data. This paper proposes a method to obtain the area of pre-earthquake buildings based on remote sensing images, with professional manual correction, to form relatively accurate vector data of buildings. The U2-Net network [29] is used to detect building edge information, which is able to capture much contextual information in imagery and increase the depth of the architecture without significantly increasing the computational cost. Vectorization and manual inspection were carried out based on the above results, and the roof area was calculated using the computational geometry function in ArcGIS. In addition, DSM data are used to obtain the floor height of the building. This method uses the center of the building as a rectangular buffer zone, the plural of DSM points within the building contour as the building elevation, and the plural of DSM points in the non-building area within the buffer zone as the ground elevation, and calculates the number of floors by calculating the building height. The floor height of the building is taken with reference to the Residential Design Code, which depicts the height of ordinary residential floors as 2.6-2.80 m, and the floor height of stores is generally between 4.5 and