Urban Flood Visualization Framework Based on Spatial Grid

To overcome the low accuracy of visual perception caused by the small sample size and spatial heterogeneity of urban flood control data resulting from the use of rainfall gauge sensors, an urban flood visual framework based on a spatial grid was proposed. The framework is an aggregation framework composed of multiple submodels and algorithms. A three-level urban flood control grid based on the territorial management business model was designed for a local administrative bureau. A grid-constrained point data spatial clustering algorithm based on this grid division was proposed to solve the statistical bias problem. An algorithm that increases the number of samples was developed to support the adaptive covering heat map generation. The new algorithm can provide dense sensing information with only a small number of sensors. This framework was tested by an urban flood control business. The results demonstrate that the visual models and algorithms included in this framework eliminate the effects of spatial heterogeneity, solve the statistical bias problem, and improve the visual perception accuracy. The visualization framework is expected to be very helpful for the emergency response and decision making in urban flood control, and can also be applied to other fields such as water conservation and urban management.


Introduction
Flooding has been a prominent urban problem for many years. With the rapid increase in urban population and the high speed of urban construction, the area of water-impervious surfaces in urban built environments has rapidly grown. This problem coupled with the difficulty in the quantitative forecasting of local heavy rainfall in extreme weather such as rainstorms (1)(2)(3) has resulted in the increased probability of urban flooding and greater damage year by year. The heavy rainstorm in Beijing on July 21, 2012 affected nearly 780000 people and caused a direct economic loss of more than 14 billion yuan. (4) The National Flood and Drought Management Command emphasizes the need to refine information acquisition and visualization, to fully inspect hidden danger points, and to specify the response rules to maintain social stability and sustainable economic development. (5) In response to urban flooding, many countries have developed appropriate measurements to mitigate damage. Japan not only focuses on engineering measures such as embankments and urban drainage networks, but also stresses non-engineering measures such as citizen risk reduction, disaster insurance, and flood warning systems. In response to floods, Japan has gradually transformed from an administrative-oriented approach toward flood prevention and control to real-time flood forecasting, raising public awareness of flood defenses, and integrated flood management. (6) The UK has incorporated flood insurance as part of urban flood disaster management: the government is responsible for reducing the risk of floods and insurance companies are responsible for providing property flood insurance to residents and companies in flood-prone areas. (7) The UK has also established a Flood Forecasting Centre to issue early warnings of floods detected through the use of technology. UNESCO encourages urban flood stakeholders, which are mainly community residents, scientific institutions, and private organizations affected by urban flooding, to participate in urban flood control management, where stakeholders fully share disaster information so as to reduce decision risks. (8) With the development of modern information technology, the Internet Era concept is widely used in urban management and urban flood management. Cities have established urban flood emergency management systems using modern communication technology, geographic information technology, and Internet of Things technology at the core. For instance, Heilongjiang Province has established a flood control geographic information emergency command system based on the SuperMap platform to guarantee the rapid response of flood control emergency management and disaster prevention and mitigation. (9) A monitoring and early warning system for waterlogged urban roads based on smart devices has been designed and implemented. (10) The Flood Control Office and Meteorological Bureau of Yueyang, Hunan Province, jointly developed the Yueyang Flood Control Meteorological Forecasting and Warning System for the real-time monitoring of urban rainfall and to provide suggestions for flood control management. (11) Urban flood monitoring and the disaster response are undergoing a gradual transition. In existing urban flood control systems, the management mode of "verticality and parallelism" is mostly adopted. (12) Parallelism refers to setting up a flood control office, water bureau, and other sections with the county and district government as the working unit. They are responsible for collecting information on pre-flood material reserves, hidden dangers, rescue teams, the flood season and flood conditions, and other information, and also the dispatch work. Verticality includes many departments such as municipal, drainage, housing, and other departments, which temporarily undertake rescue and mitigation work within their own working scope in the flood season. Because each unit has different responsibilities, this management mode can easily form "information islands"; secondly, it is difficult to archive basic information, which reduces the level of data utilization. (13) Therefore, in modern urban flood control, the management concept should be changed into a data-driven model to enhance the potential of data information application. Among these changes, graph-or map-based information presentation is an important visualization method, and many map-based works have been reported. As examples of research on interactive mapping, Qi et al. optimized a mathematical hierarchical model of thematic data in maps to optimize the hierarchical visualization of thematic data. (14) Andrienko and coworkers conducted the visualization analysis of interactive mapping by studying the transformation of visual variables. (15)(16)(17) Schnabel and Hurni used thematic statistical symbols as a basis to study the construction of geometric elements in map symbols, and they used geometric elements for the visual representation of map symbols (18) by analyzing thematic mapping modes in smart cities. Ren and Du proposed four thematic mapping modes, "subscription-based mode", "order-based mode", "custom-made mode", and "intelligent mode", and carried out the corresponding technical implementation. (19) However, the existing visualization studies do not consider the dependent territory management of urban flood control and the spatial heterogeneity of flood information. In these studies, rainfall values were sensed by rainfall gauges at fixed positions. The distributions of rainfall and disaster prevention materials are spatially heterogeneous; therefore, flood measurement at a certain location is different from that at other locations. The direct application of existing geographic information spatial visualization technology can easily lead to a statistical bias problem in the spatial interpolation of flood control information. This problem is mainly due to the dependent territory management model of urban flood control. The formulation of urban flood measurements relies on urban flood control information, which has specific spatial regional characteristics. Therefore, a new visualization method constrained by spatial units for urban flood control information should be developed.
The contributions of this paper are summarized as follows: (1) A visualization model framework with spatial grid constraints is proposed. The framework is an aggregation of several submodels with the spatial grid as the constraint. It focuses on solving statistical bias problems in the spatial distribution and spatial interpolation of urban flood control information, and can avoid the inaccurate estimation by the spatial interpolation of urban flood control information. (2) An urban flood monitoring information system was designed and implemented to demonstrate the usability of the visualization model. Some key applications were engaged to validate the system. The results show that the proposed visualization model framework can be extended to other applications of urban grid-based management. The rest of this paper is organized as follows. Section 2 describes the novel visualization method for urban flood information. In Sect. 3, the system design and implementation are described and some functional modules are introduced. We conclude our work and provide directions for future work in Sect. 4.

Visualization model framework
Spatial heterogeneity means that spatial information is distributed unevenly across subspaces. The geographic processes or geographic phenomena characterized at various geographic scales vary widely. Therefore, there is a problem of local inaccuracy of the information in the study area used for decision making and inference in urban flood control decision making and emergency responses. Most of the existing studies on flood control information visualization assume good spatial and temporal smoothness of urban flood control information (20,21) while ignoring the heterogeneity among data. In the visualization of urban flood control information, one of the difficulties is to eliminate the influence of spatiotemporal heterogeneity to the maximum extent to ensure an accurate visualization of the urban flood control information for decision making and emergency responses. Various methods of identifying and eliminating spatiotemporal heterogeneity have been proposed. For the spatiotemporal heterogeneity of geographical spatiotemporal processes (urban PM2.5), Fan et al. proposed a spatial heterogeneity partitioning of the study area using the REDCAP clustering algorithm, a temporal partitioning using data slicing, then conducted spatial interpolation in the subspace to improve the spatial interpolation accuracy. (22) The sandwich estimation model adopts a hierarchical strategy to divide the study area into a sampling layer, a partitioning layer, and a reporting layer, and employs a twice-stratified statistical strategy to take spatial heterogeneity into account, so as to improve spatial interpolation accuracy. However, it is only suitable for conducting spatial interpolation on small samples towards study objects with spatial heterogeneity. (23,24) In this paper, a spatial-grid-constrained model framework for visualizing urban flood control information is proposed to solve this problem by combining spatial regional characteristics and the territorial management model of urban flood control management and policy formulation.
The visualization model framework is an aggregation method composed of multiple visualization submodels and algorithms, including a grid partitioning model, a point data grid clustering visualization model, and a heat map visualization model with spatial interpolation. Several visualization models were designed and implemented in the framework according to the spatial regional characteristics and the territorial management mode of urban flood control management and policy formulation. The framework focuses on solving the statistical bias problems in the spatial distribution and spatial interpolation of urban flood control information, and it can avoid the problem of inaccurate estimation of urban flood control information by spatial interpolation. The conceptual design of the framework is shown in Fig. 1.

Urban flood control grid division
A cellular grid is the smallest unit of urban grid-based management. Grid division methods include the regular rectangle method, road network method, and administrative division method. These methods have been widely used in grid community management, grid emergency resource management, and grid land resource management. The regular rectangle method divides areas into regular square grids with fixed length and width, or latitude and longitude. The spatial location of a square grid is determined by its center [ Fig. 2(a)]. This method is simple owing to its results always being given for areas with regular shapes, and the data are easily processed. However, this method ignores the influence of large buildings, lakes, and administrative boundaries. This often results in geographic entities crossing grid boundaries. An urban road network has obvious boundary lines and geographic entity differentiation, so the road network method [ Fig. 2(b)] has clear grid boundaries and is simple to operate, but the unevenness of the road distribution leads to large differences in grid areas. Moreover, a single grid may contain multiple administrative areas, leading to contradictions in administrative authority attribution and governance.
As an example of division into administrative regions, Beijing is divided into three levels of administrative units, namely, districts, subdistricts, and communities, which are responsible for issues related to government work. For urban flood control emergency management, the different levels of administrative units are responsible for flood control data collection, flood control business management, and flood control emergency response. The administrative division method has a similar relationship to flood control in terms of territorial division and authority management, which can avoid the overlapping of grid units or territorial omission and achieve seamless boundaries. Regarding grid coding, administrative codes can be used as grid codes, since the coding method is unified nationwide, which is conducive to data sharing among departments.
Taking an urban district in Beijing as an example, the district flood control office is responsible for the management of the flood control and coordinating the flood control of the district's streets and commissions such as landscaping, sanitation, and drainage groups. The district-subdistrict (commission)-community three-level model is mainly adopted to deliver flood control information. We divide the urban flood control grid into three levels: district, subdistrict, and community levels (see Fig. 3). The whole urban area is divided into one district-

Grid clustering algorithm for point data
Urban flood management information includes rescue materials, hidden trouble spots, waterlogged spots, rainfall, and other types of information that are essential in determining the warning level of flood control, response plan, and dispatch of rescue personnel. The visualization technology for this type of information is usually based on pictures, text, and tables. Thematic mapping modes were previously analyzed and four thematic mapping modes have been proposed, "subscription-based mode", "order-based mode", "custom-made mode", and "intelligent mode", which are used to carry out the corresponding technical practice. (19) To address the problem of data classification in thematic maps, mathematical grading models have been used to optimize thematic data grading in maps and visualization effects. (14) In addition, spatial clustering is also an effective method for synthesizing various data and finding information features rapidly. The basic principle of clustering is to divide a data set into several classes or clusters according to certain rules, so that objects in the same class or cluster have greater similarity and the disparities between different classes or clusters are as large as possible, allowing different features of the data set to be discovered. (25) The clustering results can express the spatial distribution characteristics and potential relationships of point data. Clustering algorithms can be classified into the following categories based on their characteristics: divisionbased clustering, hierarchy-based clustering, density-based clustering, grid-based clustering, model-based clustering, and fuzzy clustering. (26) For large-scale and high-dimensional data, most of the current algorithms are ineffective. Sun et al. proposed a novel sparse representation framework based on the latent space that learns dictionaries, (27) which can reduce dimensionality to obtain hidden information. Undesirable outliers are another issue in clustering, and the multistep clustering method was proposed for robust clustering. (28) In the implementation of point clustering algorithms, mainstream map service plug-ins (such as Baidu Maps API, Google Maps API, OpenLayers, and Leaflet) provide point clustering algorithms. In the implementation of such algorithms, the grid, the distance, or the grid and the distance are used to process the data set, then the data distribution characteristics are described in the form of aggregate points. This reduces the amount of calculation while solving the problem of point data occlusion during the visualization of massive data. However, in the application of urban flood control information visualization, the territorial authority of urban flood control information management is not taken into account and spatial bias exists in the statistics. In other words, the real information of an administrative unit is different from the spatial statistics. In addition, the spatial location of the aggregation points representing the aggregated information is uncertain, and it is very likely to be outside the spatial grid range it represents.
To address the above problems, we propose a point data clustering algorithm with spatial grid constraints. The basic idea of this algorithm is to divide the data set into multiple subsets and perform point clustering with the spatial grid as the smallest spatially constrained unit. The data set is validated and classified according to the point data grid and location attributes. Data that meet the validation conditions are grouped into the same subset, and data that do not meet all the validation conditions are deleted, thus forming multiple point data subsets with the cellular grid boundary as the constraint, on which point data clustering is performed. The algorithm is shown in Fig. 4.

Heat map generation algorithm for spatial interpolation
The kernel density heat map is a classical method of spatial point pattern analysis and visualization, and is commonly used in crime analysis, public health, transportation planning, and other fields of applied research. Many map vendors provide open-source interfaces for heat map production, such as Baidu Maps, Amap, ESRI, OpenLayers, and Leaflet. The selection of radius parameters is the key to the generation of a heat map, which greatly affects the visual perception effect and user information decision. As shown in Fig. 5, a heat map has a good visualization effect at a certain map scale [ Fig. 5(a)], but when the map is zoomed, the map scale is changed, and it is easy to show that a heat map cannot cover all the areas or the density is concentrated [Figs. 5(b) and 5(c)]. Therefore, the adaptive determination of parameters has become a hot topic of research, resulting in various methods such as the thumb method, crossvalidation method, and adaptive cross-validation method. To balance the accuracy of parameter selection and computational efficiency, a fast adaptive heat map generation algorithm based on quadtree partitioning that is suitable for big data analysis and visualization has been proposed. (29) However, for small sample data for urban flood control, the drawback of heat maps is their high computational complexity.
To address the above problems, we design a spatially encrypted heat map generation algorithm that takes the spatial coverage ratio into account. The basic principle is to use a spatial interpolation algorithm to spatially enrich the sampling points to ensure the full coverage of the heat map to solve the coverage ratio problem at different scales. It is also helpful for improving  the accuracy of visual perception and meeting the user's decision-making needs. To address the balance between the number of interpolation points and computational efficiency, we design an algorithm to calculate the minimum number of required points, thus avoiding the problem of a large computational load. The flow chart of this algorithm is given in Fig. 6.
To facilitate the calculation of the minimum number of interpolation points, the concept of the reference scale is introduced. Its definition is as follows: when the visualization effect of the heat map is satisfactory, its current scale is defined as the reference scale, which is expressed by its scale denominator M r . Then, the relationship between the number of points required for the heat map N r and the reference scale can be determined. When the map scale changes, the formula for calculating the minimum number of encrypted points is as follows: where M r is the reference scale, M 1 is the current map scale, N r is the number of points in the reference scale scene, and N 1 is the minimum number of encrypted points required at the current scale.

Development environment
The system adopts a browser/server (B/S) framework with Java and HTML and CSS languages on the server and client sides, respectively. The integration environment of the system uses IntelliJ IDEA 2018.3 x64 and JetBrains WebStorm 2017.2.3 x64. In the spatial data processing, we apply the open-source GIS desktop software QGIS for coordinate conversion and other related works, and we use Baidu Maps API for JavaScript to complete the grid map visualization. The system environment is shown in Table 1.
The system is developed using Spring Boot technology based on the model-view-controller (MVC) mechanism, which divides the presentation layer of the three-level framework into three parts: the model, view, and controller. The model mainly includes business logic data, such as the Action and DAO classes in the Web. The model is independent of the data format, so the model can be used with multiple views once written in the actual development, reducing code repetition. The view is generally a user interaction interface composed of HTML. The controller controls the interface data updates according to user operations and plays a connecting role in the model and view. (30) The Spring Boot technology, as a set of concise development methods based on the Spring framework, simplifies the development model, reduces the difficulty in project building, and makes the development, testing, configuration, deployment, and monitoring of the project easier.

Grid clustering visualization for hidden points
To better describe the spatial distribution of hidden points in flood control in each cellular grid and solve the overlaying problem, this module implements grid-based visualization. The data include construction sites, underground spaces, human defense projects, and other hidden points. The main code functions are shown below in Algorithm 1. These functions adopt the spatially constrained point clustering algorithm designed in this paper to achieve the spatial clustering of point data of different grids, which allows flood control management personnel to perceive the flood control information more accurately and facilitate the decision making of inspection and emergency rescue materials and manpower deployment. The effect of grid-based clustering is shown in Fig. 7. The different colors and sizes of the circles are used to identify the different levels of aggregated data, and the aggregated points are accurately located in this grid.

Multiscale visualization of rainfall trend
This function was designed to indicate whether the station reports rainfall information correctly by setting different colors for station icons. By clicking a station icon, a large amount of information can be shown, such as the station location, rainfall value, grid, inspectors, and other related information, as labeled in Fig. 8. In our work, the rainfall value was collected by a network of gauges deployed at fixed positions. Therefore, the rainfall needs to be estimated at positions with no gauges. To better estimate the rainfall information in the whole region, this system adopts the ordinary Kriging interpolation algorithm based on the exponential variation function for interpolation. The core code of the spatial interpolation function is listed in Algorithm 2. The visualization result is shown in Fig. 8.

Visualization of emergency evacuation routes of population in hidden areas
In the traditional flood control data management mode, people prefer to use spreadsheets and publicity boards to show statistics and the evacuated population. To mitigate the problems of insufficient information, poor timeliness, and unsatisfactory results of traditional methods, we have developed a statistical visualization function based on maps to facilitate population transfer information for this module. This module quantitatively demonstrates the number of evacuated people and their transfer direction, and provides accurate visual perception information. The destination point represents the location to which people are evacuated. When the cursor follows the curve, the number of evacuated people in the transfer direction is displayed. Flashing dots in different grids represent the migration and migration information of people whose homes lie within the grid. An image of the prototype system is presented in Fig. 9. Algorithm 2 Kriging spatial interpolation.

Conclusions
In this paper, we proposed a framework for visualizing urban flood control information constrained by a spatial grid that addresses the problem of inaccurate visual presentation of information required for localized urban flood control management. The framework is an aggregation framework composed of several submodels and algorithms. We proposed a gridconstrained point data clustering algorithm for the point data of hidden points and emergency material used in flood control. The new clustering algorithm eliminates the problems of inaccurate clustering points and biased clustering information statistics caused by spatial heterogeneity, and can thus meet the territorial management needs of urban flood control. The accuracy of the visual perception of the heat map of flood control information is studied, and an algorithm for the spatial interpolation of a heat map is proposed to solve the problem. This algorithm can fully spatially cover the study area at different scales. Using the urban flood control visualization model proposed in this paper, an example of urban flood control area in a district of Beijing was examined. The results show that the framework can provide accurate visual perception information, which can help in decision-making. The proposed framework can also be applied to other areas of urban refinement management. However, further improvement of the framework is still required. For example, the framework depends on dense sample points. If there are insufficient rainfall gauges, a suitable spatial interpolation algorithm must be chosen to generate pseudo sample points. The suitability and robust validation of the framework for other interpolation algorithms will be future work.
Shouqing Wang received his Master's degree from Beijing University of Civil Engineering and Architecture. He is now working for Inspur Electronic Information Industry Co., Ltd. His research interests include smart cities and industrial Internet technology. Delong Li received his Master's degree from Beijing University of Civil Engineering and Architecture. He is now an engineer at Geovis Technology Co., Ltd. His research interests include Geo-IoT, data mining methods, and remote sensing.