1 Introduction

In recent years, the frequent occurrence of global earthquake disasters has brought serious threats and losses to people’s lives and property around the world. Governments and research institutions funded a lot of scientific research seeking ways to mitigate the disasters and losses caused by earthquakes (Xu et al. 2016; Federal Emergency Management Agency (FEMA) 2008, 2012a, b, c, 2013). With the development of computer science and technology, a considerable number of earthquake disaster loss assessment systems have been developed in the last decades, which have made great contributions to earthquake disaster prediction, emergency rescue efficiency, and government decision-making process. Table 1 summarizes some of the features of existing seismic disaster loss assessment software.

Table 1 Summary of the earthquake disaster loss assessment software

One of the challenges for earthquake disaster loss assessment software resides in the capability of global application. For instance, HAZUS-MH is a multi-hazard analysis software that was developed by Federal Emergency Management Agency (FEMA) and National Institute of Building Sciences (NIBS), it is excessively calibrated to U.S. conditions, and it runs only with the commercial software ArcGIS. Comprehensive Approach to Probabilistic Risk Assessment (CAPPA) is an analysis tool introduced to perform both deterministic and probabilistic risk assessment that is applied in Central and South America and in some countries of Europe and Asia (Reinoso et al. 2018). Earthquake Loss Estimation Routine (ELER) has been developed within the EC FP6 project, Network of Research Infrastructures for European Seismology, which is used to seismic risk assessment at the panEuropean level (Corbane et al. 2017). However, earthquake is a global disaster. Disaster prevention and mitigation are problems without borders. In many developing countries and regions, due to the backwardness of seismic risk assessment research and the low seismic performance of buildings, the tragedy of seismic catastrophes caused by minor earthquake still occurs without proper remediation. Thus, it is imperative to establish a global system platform to conduct earthquake risk and loss assessment work worldwide. Some of the earthquake disaster loss assessment software (e.g., SELENA, OPENRISK, PAGER, RADIUS, OpenQuake) are developed under such objective. SEimic Loss EstimatioN using a logic tree Approach (SELENA) is developed by Norwegian Seismic Array (NORSAR) and the University of Alicante with support from the International Center for Geohazards in Norway. It is mainly based on the core of HAZUS methodology and uses a logic tree-computation scheme for the weighting of the input parameters in order to account for epistemic uncertainty (Molina et al. 2010). It is open for any user-defined data and it can be applied to any part of the world. Prompt Assessment of Global Earthquakes for Response System (PAGER) plays a major alerting role for global earthquake disasters as part of the U.S. Geological Survey’s response protocol. It provides economic loss impact and casualty estimates following major earthquakes worldwide (Allen et al. 2009). The United Nations Office for Disaster Risk Reduction launched the Risk Assessment tools for Diagnosis of Urban areas against Seismic disasters (RADIUS) project in 1996 to reduce the seismic risk in urban areas, especially for developing countries (Mazumder and Salman 2019). However, seismic loss estimation for different parts of the world requires different approaches and attributes due to the different seismic characteristic, architectural characteristic and economic characteristic (Karimzadeh et al. 2014). Therefore, it is difficult to apply one earthquake disaster loss assessment software for all countries of the world. China is one of the high-seismicity regions in the world. Thus, it is imperative to develop an earthquake disaster loss assessment software suitable for China’s earthquake characteristics, architectural characteristics, economic and demographic characteristics. At present, Taiwan Earthquake Loss Estimation System (TELES) has been developed for earthquake disaster loss assessment of Taiwan. The localized database, analysis mode, and parameter value of Taiwan are applied in the software (Yeh et al. 2006). Based on WebGIS platform, Chen (2012) established a comprehensive earthquake disaster loss assessment system (HAZ-China), which mainly focused on the mainland of China to provide comprehensive earthquake information services for different users. However, the structural vulnerability model in the system mainly utilizes the seismic damage matrix based on the statistics of seismic damage data; thus, the seismic vulnerability of new structures or areas without seismic damage data cannot be evaluated (Chen 2016).

In software engineering, the maintenance and update of software is a problem that has to be considered before development. With the deepening of research, the theory of earthquake disaster loss assessment is updated and improved constantly; thus, the corresponding software also needs to be updated. Sometimes, performing upgrades, repairs or reconfigurations on a software has required either recompilation of the whole source code and reinstall or at least stopping and restarting the system. As shown in Table 1, although these software tools have better extendibility, some software tools still need to be reinstalled to modify or add individual module (ELER 2019; SELENA 2019; OSRE 2019; CAPRA 2019). It is inconvenient to update. Moreover, an upgrade of the software may dictate changing the programming language completely, overthrowing the previous architecture, and re-encoding, which significantly increases the cost of the system. For example, the first version (V1.0) of Kandilli Observatory and Earthquake Research Institute Loss Estimation Software (KOERILOSS) was developed based on MapInfo; however, the software had been rewritten to run under Excel (V2.0) and Matlab (V3.0) in the later (Strasser et al. 2008). Several modules of the OSRE (Open Source Risk Engine) program were initially coded in FORTRAN, C and Basic and then converted into Visual Basic.net (OSRE 2019). HAZ-Taiwan was developed based on the analysis process and architecture of HAZUS. However, due to the change of software demand, the increase of function and the difficulty of upgrade and maintenance, the National Center for Research on Earthquake Engineering of Taiwan had to develop a new software, namely TELES (Yeh et al. 2006). Those works caused a lot of extra expense. Fortunately, an extensible plugin framework can be utilized herein to address this issue, which has several notable advantages, including update and extend the applications without restarting, incorporating extensions developed by third parties and customizability (Chatley et al. 2003; Maas et al. 2018). Plugin technology is an effective way to improve software reusability and scalability. Eclipse (2018) and SharpDevelop (2018) are two well-known plugin applications that provide an important reference for the development of other plugin applications. Several applications with a generalized and flexible plugin architecture have been developed in some subject fields which allow them to be extended dynamically at runtime (Knublauch et al. 2004; Incardona et al. 2010; Maas et al. 2018; Knox et al. 2018). Typically, in the field of earthquake, MAEviz is a broadly extensible platform for earthquake hazard risk management based on the Eclipse Rich Client Platform which provides a base set of plugins that can be used to build new applications (MAEviz 2018; Eclipse RCP 2019).

In this study, an extendable plugin framework, CEDLES, has been developed based on an object oriented plugin architecture, which incorporates the StartupApp project, EngineBase project, ArcEngineBase project, and AddInManager project. Having such a framework is particularly relevant for collaborative seismic software development. It allows a rapid development process of extensible and customizable earthquake hazard risk forecast and loss evaluation applications with low regression risks and high-quality confidence. A first application prototype, Earthquake Risk Prediction and Loss Assessment System (ERPLAS) is developed based on CEDLES, which aims to integrate mature earthquake disaster models, especially suitable for earthquake risk prediction and loss assessment in China, including the model of seismic hazard, structural vulnerability, loss assessment, earthquake insurance rate estimation, and benefit–cost analysis of building retrofit. The CEDLES framework and ERPLAS are described in this article.

2 The CEDLES framework

In software engineering, an application framework is a semi-finished application with partial functionality that provides a reusable generic structure that can be shared between applications. The idea of a CEDLES framework is mainly inspired by the Opensource.net integrated development environment (IDE), which was enhanced by SharpDevelop 5.1.0 Build 5216. SharpDevelop’s most useful contribution to CEDLES was its ability to use a dynamic link library (DLL) (2018) to extend plugins and its mode to manager plugins. Two open-source projects were incorporated in the framework to meet the requirements of having a system that can custom interface a layout and also record a system log. The two projects are, respectively, the AvalonDock project, which is a Windows Presentation Foundation (WPF) control for adding a docking layout system to our application (AvalonDock 2018), and the Apache log4net project, which is a tool to help the programmer output log statements to a variety of output targets (Log4net 2018). The framework source code is written in Microsoft Visual C# language, and the interface style is implemented by overriding the style control.

The CEDLES framework is comprised of a startup project, a base for a common plugin framework, a base for the geographic information system (GIS) plugin framework, and a plugin manager project. The collaboration diagram of the CEDLES framework is shown in Fig. 1. The StartupApp is the startup project that initializes the basic services, plugin engine, and log service of the framework. The EngineBase project is the base of whole framework, which includes a set of libraries, tools, conventions and services (thread library, progress bar tool, view convention and prompt message service), and can be utilized to develop common plugins. There is a special project in the framework, ArcEngineBase, which encapsulates a large number of functions related to GIS. The AddInManager project is designed to manage the plugins. The main components of the CEDLES framework are described in the following sections.

Fig. 1
figure 1

Collaboration diagram of CEDLES framework

2.1 Plugin management

The framework is designed with a plugin management tool to manage the plugins. Actually, the tool is also a plugin. The class diagram is shown in Fig. 2. Specifying the action of plugins is the main function of the plugin manager, which will automatically scan all the directories in the plugin path preset by the programmer and list the available plugin functions. Users can use it to enable, disable, install, uninstall, and update the plugins. Three types of plugins can be loaded in the framework. The first type is preinstalled plugins that would automatically be added by host application to initialize the necessary functions. It should be noted that the preinstalled plugins can only be disabled. The second type is external plugins which can be added, disabled, and removed. Notably, removing the external plugins only removes the reference to the configuration file, but it does not actually delete the plugins. The third type is user plugins, which can be installed, disabled, and uninstalled. This plugin can make the application system more flexible and general. Users can dynamically load the required plugins according to their needs, instead of all the plugins.

Fig. 2
figure 2

Class diagram of plugin management

2.2 View definition

A view definition model has been developed in order to set the style, form, and position of the plugin windows easily and efficiently. To meet the requirements of developers that add new plugins as the main windows or dockable side windows, two kinds of classes are defined in the EngineBase project.

The first type of plugin window can be embedded as a child form in the main form, or it can be independent of the main form. The logical class hierarchy is shown in Fig. 3. A user control can always be used as the main part of those windows. The view type of Windows Form (WinForm) or WPF can be implemented by inheriting the WinControlDocVIew class and WpfControlDocView class, respectively. Both classes implement the same interface (IViewContent, ICanBeDirty, and IDocView) and have a common parent class (LayoutDocument). Another type of plugin window is the dockable side window that can be anchored on the top and bottom as well as to the left and right of the main window. These classes are organized hierarchically, as shown in Fig. 4. LayoutAnchorable is a base class with two subclasses (WinControlAnchorView and WpfControlAnchorView) that implement two interfaces (IViewContent and IAnchorView). Similarly, developers can realize various forms by inheriting those subclasses.

Fig. 3
figure 3

The logical class hierarchy of main window

Fig. 4
figure 4

The logical class hierarchy of dockable side window

If the developers clearly understand the view type and the relative path of the assembly, the view collection can be obtained by a generic method encapsulated in the framework. The specific program statement is as follows (see Fig. 5). The parameters, fullClassName and relativeDllPath represent the full name of the view and the relative path of assembly containing the view, respectively.

Fig. 5
figure 5

Program statement to obtain views

2.3 GIS service

The CEDLES framework also includes the ArcEngine service classes that can be used as the parent classes of more GIS plugins. The function classes of coordinate transformation, database management, and data conversion have been encapsulated in the framework, which also include preloaded plugins, such as layer editing, symbol management, layer management, thematic map customization, and other plugins. These preloaded plugins provide basic GIS functionality to the system. The CEDLES framework provides a data model tool kit that allows the construction of specific data models needed by advanced software. It is beneficial for both documentation and communication purpose and also makes implementation more straightforward. Three types of data entry models (Shapefile, Geodatabase, and XML) can be selected based on the user’s existing data format. These data models are also available in several common data save formats including.doc, .docx, .pdf, .xlsx, and .mxd in order to store and exchange data conveniently. Database operation functions are encapsulated for multiple databases (e.g., Oracle, MySQL, Access) considering developers’ different demands.

2.4 Interface design

The plugin interface is a protocol, a contract that implements the interaction between the plugin and the framework, and provides an extensible access portal for the plugin. It should be noted that the interface of this framework is not redesigned but directly calls upon the interface functions in the class library, ICSharpCode.Core. The inheritance relationship of interfaces is shown in Fig. 6. Five types of interfaces are designed for different functions, which are implemented by corresponding abstract classes, but they all have a common base interface (ICommand). Abstract methods for common tool button and common menu item are defined in the IBasicCommand and IMenuCommand interfaces, respectively. The remaining three interfaces define abstract methods for menu item with option status, tool with drop-down box feature, and text label on the toolbar. This hierarchy makes it straightforward to develop new functional plugins by inheriting those command classes and overriding the run function in the classes.

Fig. 6
figure 6

The inheritance relationship of interfaces

2.5 Framework workflow

The application framework supports the structure of the entire plugin application software, responsible for dynamically loading plugins, generating interactive interfaces based on plugin configuration, and coordinating inter-operability between plugins. The CEDLES framework workflow is shown in Fig. 7. When the host application startup is activated, it will automatically search for plugins in the AddIns folder under a specific path. If there are any plugins, they will be checked to see if they support the specific interface defined by the host application. The reflection mechanism provided by the Microsoft.NET Framework supports dynamically creating objects and calling methods in objects while the program is running. This is the key to plugins that are dynamically loaded by the application framework. The plugin will be instantiated when it meets the interface requirements and the resources of icons; then, strings will be loaded. After refreshing the interface of the host application, the icons and strings are displayed in the menu bar. When user clicks the menu in the host application, a corresponding plugin will be loaded according to the configuration file (Fig. 8) and its interface function will be called up. Then, it starts to run the plugin functions, and the process of calling up plugins finishes.

Fig. 7
figure 7

CEDLES framework workflow

Fig. 8
figure 8

Plugin configuration file

3 Implementation of ERPLAS

The purpose of developing ERPLAS is to integrate excellent earthquake disaster models to meet the assessment requirements of different users in China, at the same time, to make contribution to other developing countries without earthquake disaster assessment software. In ERPLAS, the plugins of seismic hazard analysis, loss assessment, structural damage analysis, earthquake insurance rate estimation, and benefit–cost analysis of building retrofit, as well as fragility curve management and emergency shelter analysis, have been integrated; however, in the following sections, just the former few plugins are briefly described. It should be noted that not all analysis plugins are suitable for other countries. To access more accurate results of earthquake disaster assessment, user or research institute, especially for those developing countries which have none corresponding application, can integrate their own earthquake disaster models in order to implement software localization, which can take full account of their country’s seismic characteristics, architectural strengths, and weaknesses, as well as the seismic readiness of both the population and economy.

3.1 Develop environment

The system is based on C/S architecture, with Microsoft.Net as the development platform and ArcGIS Engine components as the key technology. It is coded in C# with an integrated development environment, Visual Studio 2013. The reason for choosing the C# language is that it has a powerful support platform, which can be utilized to develop desktop applications more plain and efficient. Furthermore, integrating GIS functions with C# language can get more community support. The model-view-view-model (MVVM) (2018) design pattern is adopted due to its advantages of loose coupling and reusability. The Oracle (2018) database is used to manage attribute data, and the model of “Oracle + ArcSDE (2018)” is adopted to manage spatial data.

3.2 Plugin content

A plugin can be regarded as a software package with inheritance and implementation the same interface and can be recognized and consistently called by the main program. Each plugin is composed of three parts. The first part consists of files with the extension “.resx” used to define the resources. For example, files named “ImageResources.resx” and “StringResources.resx” are always used to manage the key value of image resources and character string resources, respectively. Those resources will be registered in the CEDLES framework by calling up automatically executed commands when the CEDLES framework startup is initiated. The second part consists of source codes that implement the full functions of the plugin. We can call up the functions and services which are encapsulated in the CEDLES framework to quickly and conveniently develop the plugins. However, a class is needed to implement the interface defined in Sect. 2.4. To implement the interface, the class run function must be overridden, and the basic properties of the graphical user interface must be defined for the plugin, including the starting position, title, height, width, and the content of the interface. The class will be called up in the plugin configuration file (see Fig. 8). The third part is an add-in configuration file, which is actually an extensive markup language (XML) document (see Fig. 8). Strong self-descriptiveness and clear hierarchy are the characteristics of XML, so that it is suitable for describing important information such as software configuration, metadata, and interface lists. It is very convenient to use XML to represent plugin configuration information and the .NET framework to encapsulate a function package for reading and writing XML files and locating elements quickly by node, which makes the operation easier. The add-in node sets the properties of the plugin, including the plugin name, author, description, and the visibility in the management plugin. The manifest node and runtime node indicate the name of the corresponding “*.dll” assembly and its relative position, respectively. The main part of the configuration file is configured in the path node, including the plugin’s unique ID, icon, shortcut, and the function class of the plugin. After the configuration file is complete, the plugin can be called in the system.

3.3 Seismic hazard analysis plugin

The main objective of seismic hazard analysis is to estimate ground motions and return period at the site or in a region (Liu et al. 2013). Probabilistic seismic hazard analysis (PSHA) and deterministic seismic hazard analysis (DSHA) are the most frequently used methods (Wang and Taheri 2014). Hence, those two methods had been integrated in the seismic hazard analysis plugin. In addition, a modified PSHA method, China probabilistic seismic hazard analysis (CPSHA), was proposed by considering spatially and temporally inhomogeneous seismic activities in China and had been implemented on the seismic hazard map of China (NSPRC 2015). This method was also implemented in this plugin. It should be noted that the most important difference between PSHA and CPSHA is the different of seismicity model (Liu et al. 2013). In PSHA, the potential source zone is used to represent the areas where earthquakes may occur in the future. However, the tri-classes seismic source model is adopted in CPSHA, which consists of the seismic statistical zone, the background seismicity potential source zone, and the tectonic potential source zone. In CPSHA, the probability that the ground motion generated at the site of all potential source zones in the statistical zone exceeds the specified value can be calculated by Eq. 1. Assuming that there are Nz seismic statistical zones that contribute to the seismic hazard risk of the site, the total probability of seismic year exceedance at the site is expressed as follows (Eq. 2).

$$P_{z} (A \ge a) = 1 - \exp \left( {\frac{ - 2v}{\beta }\sum\limits_{i = 1}^{{N_{SZ} }} {\sum\limits_{j = 1}^{{N_{M} }} {\iint {f_{M} (m_{j} ) \cdot \text{sh} \left( {\frac{1}{2}\beta \cdot\Delta M} \right) \cdot \frac{{f_{{i,m_{j} }} }}{{S_{i} }} \cdot P\left[ {A \ge a |E_{i} \left( {m_{j} ,r_{k} \left( {x,y} \right)} \right)} \right]{\text{d}}x{\text{d}}y}} } } \right)$$
(1)
$$P\left( {A \ge a} \right) = 1 - \prod\limits_{n = 1}^{{N_{z} }} {\left[ {1 - P_{z} (A \ge a )} \right]}$$
(2)

where v is the annual average occurrence rate of earthquakes which magnitude greater than threshold magnitude in the seismic statistical zone; \(\beta\) is the product of b and \(\ln 10\), where b is the coefficient of Gutenberg–Richter law; \(S_{i}\) is the area of potential source zone i in the seismic statistical zone; \(P\left[ {A \ge a |E_{i} \left( {m_{j} ,r_{k} \left( {x,y} \right)} \right)} \right]\) is the probability that the intensity of ground motion generated at the site greater than or equal to the specified value when the seismic event Ei occurred in the potential source zone i; \(f_{M} (m_{j} )\) is the probability density distribution function of magnitude in seismic statistical zone; \(f_{{i,m_{j} }}\) is the spatial distribution function of potential source zone. \(\Delta M\) is the magnitude division interval.

3.4 Structural damage analysis plugin

The structural damage analysis plugin is developed to evaluate the damage state probabilities for each building due to ground motion. It involves the building typology and the fragility curve matching with the building typology. According to the building taxonomy of PAGER (Kishor et al. 2010), GEM (Brzev et al. 2016) and SYNER-G (Pitilakis and Argyroudis 2014) and based on the Chinese Code for seismic design of buildings (NSPRC 2010), a building taxonomy suitable for Chinese architecture is established. Compared with other taxonomies, except the basic parameters of construction type, occupational type, seismic design code, building height and seismic fortification intensity, two more parameters, service environment and service age of building are considered in this study. Service environment refers to the atmospheric environment where the building structures are located, including general atmospheric environment, offshore atmospheric environment, and freeze–thaw atmospheric environment. Service age of buildings is further divided into four levels (0–30 years, 31–40 years, 41–50 years, and 51–60 years). Based on the building taxonomy in this study, and combined with the probabilistic time-varying seismic risk assessment framework proposed by Rao (2014), the seismic vulnerability analysis of multi-age structures in three different atmospheric environment is carried out using the analytical seismic vulnerability analysis method. The fragility curve models considering the degradation performance of structures in different environments in China are established. Figure 9 presents the fragility curves of typical RC frame structures with 8-degree fortification under different service age in general atmospheric environment. Within this plugin, the extent of structural damage can either be quantified in the number of buildings or building floor area affected by a certain damage state ds.

Fig. 9
figure 9

Fragility curve for RC frame structures with different service age when the seismic fortification intensity is 8° (0.20 g)

3.5 Loss assessment plugin

Seismic risk results are represented by the physical damage of the building stock while taking into consideration local seismic hazard, vulnerability, and exposure models. Based on the physical damage results, both economic losses and number of casualties can be calculated. In the CEDLES framework, different loss assessment models can be integrated. In present study, the loss assessment models used in China are introduced in the following.

To determine the economic losses (i.e., structure loss, decoration loss and property loss) caused by direct structural damage, a modified economic loss model was proposed based on the methodology described by Sun and Chen (2009). The proposed economic loss model is described as follows:

$$L = \alpha (L_{\text{S}} + L_{\text{D}} + L_{\text{C}} )$$
(3)
$$L_{\text{S}} = \sum\limits_{i = 1}^{n} {\sum\limits_{j = 1}^{5} {C_{i} \cdot P(DS = ds_{j} ) \cdot R_{{ds_{j} }}^{s} } }$$
(4)
$$L_{\text{D}} = \beta_{1} \cdot \beta_{2} \cdot \beta_{3} \sum\limits_{i = 1}^{n} {\sum\limits_{j = 1}^{5} {\delta_{1} \cdot C_{i} \cdot P(DS = ds_{j} ) \cdot R_{{ds_{j} }}^{d} } }$$
(5)
$$L_{\text{C}} = \sum\limits_{i = 1}^{n} {\sum\limits_{j = 1}^{5} {\delta_{2} \cdot C_{i} \cdot P(DS = ds_{j} ) \cdot R_{{ds_{j} }}^{c} } }$$
(6)

where \(\alpha\) is the correction coefficient of economic loss for the ignored losses (e.g., natural environment loss), suggested as 1.0–1.3; \(L_{\text{S}}\), \(L_{\text{D}}\) and \(L_{\text{C}}\) are the structure loss, decoration loss, and property loss, respectively; \(P(DS = ds_{j} )\) is the probability for damage state \(ds_{j}\) (none, slight, moderate, extensive, or complete) to be incurred on an individual building in an earthquake; \(C_{i}\) is the cost of replacement for each structure i, which is equal to the product of replacement cost per floor area and total floor area; \(R_{{ds_{j} }}^{s}\), \(R_{{ds_{j} }}^{d}\), and \(R_{{ds_{j} }}^{c}\) is the loss ratio for damage state \(ds_{j}\) on structure, decoration, and property, respectively; \(\beta_{1}\), \(\beta_{2}\), and \(\beta_{3}\) is the decoration loss correction factor considering the economic developmental variety, building occupancy, and decoration level, respectively; \(\delta_{1}\) is the ratio of decoration cost to the structure replacement cost; \(\delta_{2}\) is the ratio of property cost to the structure replacement cost.

To compute the estimated number of casualties (i.e., fatalities, severe injuries, and minor injuries) which are mainly caused by the total or partial collapse of buildings, a casualty model considering damage probability, occupancy, population density, structure type, and earthquake time is proposed, as described in Eq. 7.

$$N_{s,i} = \sum\limits_{j = 1}^{n} {N_{j} = \lambda \cdot \mu } \cdot \gamma \cdot N_{0} \sum\limits_{j = 1}^{n} {A_{j} } P_{j}$$
(7)

where \(N_{s,i}\) is the total number of casualties in injury severity level i, i ranging from minor injuries (i = 1), severe injuries (i = 2) to fatalities (i = 3); \(N_{j}\) is the number of individual building j in injury severity level i; \(\lambda\) is the regional adjustment coefficient of building distribution; \(\mu\) is population density correction factor in different occupancy levels; \(\gamma\) is the people indoor rate in different occupancy levels at different earthquake time; N0 is the number of people per floor area; \(A_{j}\) is the total floor area of individual building j; Pj is the mean damage ratio of individual building j.

3.6 Estimating earthquake insurance rate plugin

To calculate the earthquake insurance premium, the probability of occurrence of the scenario event and the possible amount of loss need to be estimated (Eren and Luş 2015). The base rate (BR) is equal to the product of the seismic hazard (PSH) and the structural probable maximum loss (PML) estimate (Yucemen 2005; Yucemen et al. 2008; Deniz and Yucemen 2009):

$${\text{BR}} = P_{\text{SH}} \cdot {\text{PML}}$$
(8)

where \(P_{\text{SH}}\) is equal to annual probability of an earthquake occurring at the site. The probability of the seismic hazard was taken as equal to a severe earthquake with a return period of 475 years (10% probability of exceedance in 50 years), which is the commonly accepted risk level for earthquake probable maximum loss in the insurance sector (Durukal et al. 2005). Hence in this study, \(P_{\text{SH}}\) is equal to \(\frac{1}{475}\). PML is the expected maximum earthquake loss to building under seismic action of local seismic fortification intensity level. Combining the above theory of structural vulnerability and economic loss, the PML is calculated as follows:

$${\text{PML}} = \sum\limits_{DS} {P(DS,SH) \times DR_{DS} }$$
(9)

where \(P(DS,SH)\) are the probabilities of five damage states (none, slight, moderate, extensive, and complete) under an earthquake with a 475 years return period; DRDS is the loss ratio for damage state DS on structure. Taking into account the profit and expenses (the daily expenses and taxes) of the insurance company, the total earthquake insurance rate (TR) can be calculated by multiplying the base rate (BR) with an amplification factor \(\rho\); generally, the value of \(\rho\) ranges from 1.2 to 1.67 (Deniz and Yucemen 2009).

3.7 Benefit–cost analysis plugin of building retrofit

This system provides a benefit–cost analysis plugin for deciding whether the employment of retrofitting/strengthening measures to a collection of existing buildings is advantageous from an economical point of view. Benefit–cost ratios (BCR) are a key parameter in establishing priorities for pre-earthquake strengthening projects (Kappos and Dimitrakopoulos 2008), which can be estimated as the difference between the estimates of the present value of these two economic losses, divided by the retrofitting costs (Valcárcel et al. 2013). Based on the works of Kappos and Dimitrakopoulos (2008) and Valcárcel et al. (2013), a method to calculate the BCR is proposed in this study:

$${\text{BCR}} = \frac{{\frac{{1 - (1 + i_{\text{s}} )^{ - t} }}{{\ln (1 + i_{\text{s}} )}} \cdot \int_{0}^{\infty } {(L - L^{\text{R}} )} {\text{d}}v(IM)}}{{Y - V_{\text{s}} \times (1 + i_{\text{s}} )^{ - t} }}$$
(10)

In this equation, is is annual discount rate and 7.5% is the recommended value; t is the time horizon; Y is the retrofitting costs; Vs is the residual value of building; L is the economic losses for the unreinforced case and \(L^{\text{R}}\) is the economic losses for the retrofitted case; \(v({\text{IM}})\) is the annual average exceeding probability of ground motion intensity. If the value of BCR is higher than 1.0, indicate that employing a retrofitting intervention is economically viable and the greater the value of BCR, the higher the priority of building reinforcement.

3.8 Software implementation

This prototype has been designed and developed with the aim of being easily configurable, extensible, and smoothly maintainable. This has been made possible by the functions and services that CEDLES provides, including the view definition function, the geographical information systems (GIS) service, database operations service and the interface. A graphical user interface (GUI) is shown in Fig. 10. In this system, users can customize the calculation model parameters according to the actual situation of the assessment area. Before starting to evaluate, the system will automatically check whether the calculation results already exists. If so, the system will load the results from the shape files (.shp) in the specified folder. If not, the system will restart evaluation, and the results are displayed in Charts, 2D and 3D. Notably, the core algorithms of all analysis plugins and the values of the variables and correction coefficients are given in the form of a user-defined interface. For data such as the ground motion attenuation models, the earthquake fault data, and the soil layer data, the users should input localized data in order to adapt the actual situation of the assessment region. Before the earthquake, the potential seismic risk of the assessment area is identified through the seismic hazard analysis plugin, and measures to avoid risks are proposed to provide a basis for the planning of government departments. The seismic loss assessment plugin can help in government decision-making and in the formation of disaster reduction policies. Insurance companies can calculate the annual insurance premium they need to charge anywhere in China based on the earthquake insurance rate plugin. Users can also give reinforcement advice for a single building or a group of buildings by using the benefit–cost analysis plugin. When a new earthquake occurs, the preliminary assessment of casualties and economic losses can be calculated rapidly, and the calculation results can be output in the forms of MS Word, Excel, and PDF, which can provide data support for emergency rescue. After the earthquake, a detailed assessment of the earthquake disaster combined with detailed data can be carried out. The assessment results can provide a basis for post-disaster scientific investigation and post-disaster recovery and reconstruction.

Fig. 10
figure 10

The GUI of ERPLAS

4 Application

4.1 Introduction of the case study area

Baqiao District is located in the middle of Guanzhong Basin, Shaanxi Province (northwestern China), 5 km away from the center of Xi’an city. The district has an area of 332 km2 with a population of 600,000 and is divided into nine sub-district regions as shown in Fig. 11. According to the latest seismic ground motion parameter zonation map of China (NSPRC 2015), Baqiao District is located in seismic fortification intensity zone VIII (0.20 g). It is an old industrial district mainly composed of older brick masonry buildings. With rapid urbanization, some older buildings have been demolished and replaced. At the same time, Baqiao district is also a historical ancient city and tourist resort, with a large number of historical relics and cultural relics. All those make the buildings in Baqiao District diverse and have different seismic behavior.

Fig. 11
figure 11

The case study area, Baqiao District

There are 61,625 buildings in Baqiao District, which are distributed in general atmospheric environment. Figure 12 shows the number and proportion of buildings by structural type, as well as by construction year. In terms of structural type, the buildings are mainly composed of reinforced brick masonry (RBM) and unreinforced brick masonry (UBM). Other structural types are bottom frame (MBF), RC frame (C1), shear wall (C3), and steel frame (S1). In terms of construction year, the largest number of buildings were built in the year range from 2002 to 2010 (45%), and there are still 2% of buildings that were built before 1979. Figure 13 shows the distribution of the total built area and the population in each sub-district region of Baqiao District. Obviously, the built area is mainly distributed in areas 002, 003, 005, and 007, and area 005 has the greatest number of built area. However, the population is mainly distributed in areas 004–007, and area 007 has the greatest number of population density. It should be emphasized that these data were collected by the research team of second author in cooperation with the Seismological Bureau of Shaanxi Province in 2014. The entire data field survey work lasted for more than 10 months, but it is a wise investment as the reliability of loss estimations is dependent on the quality and quantity of the data collected.

Fig. 12
figure 12

The number and proportion of buildings by a structural type, b construction year

Fig. 13
figure 13

Distribution of the total a built area (in Thousand m2) and b population in each sub-district region of Baqiao District

4.2 Application results of ERPLAS

4.2.1 Seismic hazard analysis

The classical DSHA is carried out based on the historical earthquake. 1556 Huaxian earthquake (Ms 8.0, located at 109.7E longitude and 34.5 N latitude in Shaanxi province, focal depth is 14 km) is conducted as scenario earthquake. Baqiao is located southwest of Huaxian city, about 75 km from the epicenter. Historical statistics show that the earthquake caused a seismic intensity of IX in Baqiao. Based on the ground motion attenuation model and soil amplification effects, seismic hazard analysis is conducted. The ground motion attenuation model has the obvious regional characteristics according to the source characteristic, propagation medium property, and site condition, etc. (Hu 1990). In this study, the ground motion attenuation model developed by Yu and Wang (2003) is adopted.

$${\rm lg} Y = C_{1} + C_{2} M + C_{3} M^{2} + C_{4} { {\rm lg} }\left( {R + C_{5} e^{{C_{6} M}} } \right)$$
(11)

where Y is the horizontal component of peak ground acceleration (PGA) in g; M is the surface wave magnitude; R is the hypocentral distance in kms; C1, C2, C3, C4, C5, and C6 represent the regression coefficient. The regression coefficient and standard deviation of the major axis and minor axis are given in Table 2.

Table 2 The regression coefficient and standard deviation

It is a complicated problem that the soil amplification effects impact on the surface peak acceleration, which is influenced by the spectrum characteristics of ground motion and soil properties. Chen and Duan (2013) proposed a soil amplification model for Xi’an according to the abundant borehole date in Xi’an as Eq. 12.

$${\rm lg} \,k_{\text{sp}} = 1.660 - 0.412{\rm lg} H - 0.368{\rm lg} V_{\text{se}}$$
(12)

where \(k_{\text{sp}}\) represents the soil amplification factor; H represents the soil thickness in meters; and \(V_{\text{se}}\) represents the mean shear wave velocity (m/s).

Based on the research above, the peak acceleration map of Baqiao is derived by using the seismic hazard analysis plugin. In view of the differences in size from each sub-district, the area has been resampled on a uniform grid of 0.5 km × 0.5 km, which results in a database of 92,597 geocells. The peak ground acceleration map of Baqiao is shown in Fig. 14. The value of PGA from 0.3 to 0.5 g is in accordance with the real intensity distribution (NSPRC, 2015).

Fig. 14
figure 14

The peak acceleration map of Baqiao in Huaxian earthquake

4.2.2 Structural damage analysis

The damage of buildings in Baqiao District under Huaxian earthquake is analyzed by using structural damage analysis plugin. The ratio of the number of buildings in five damage states in different structural type and construction year as shown in Fig. 15. Referring to Fig. 15a, the damage state varies greatly due to different structural forms (building materials). On the whole, compared with masonry structure, RC structure and steel structure have better seismic performance, and the damage states are mainly concentrated in slight damage and moderate damage. In masonry structure, most of the RBM structure and MBF structure are in moderate damage state. The UBM structure has a large proportion of extensive damage due to the lack of aseismic measures. Similarly, the damage state of buildings in different construction year is quite different (Fig. 15b), which is mainly caused by the different degradation degree of mechanical properties of building materials in different service years, as well as by the difference of seismic design code in different stages. The majority of the buildings built after 2001 are in moderate damage state, while most of the buildings built before 1989 are in extensive and collapse damage state.

Fig. 15
figure 15

Ratio of the number of buildings in five damage states in different a structural types and b construction years

4.2.3 Loss estimations

As mentioned in Sect. 3.5, the direct economic loss includes the loss of structure, decoration, and property, and the casualties are divided into fatalities, severe injuries, and minor injuries. It is noteworthy that the calculation of direct economic loss and casualties involves the determination of many coefficients, which need to be determined according to the actual situation of each evaluation area to ensure the accuracy of the calculation results.

As shown in Fig. 16, the direct economic loss of area 005 and 007 are large due to the large floor area. Although most of the reinforced brick masonry structure are in moderate damage state and almost all of the unreinforced brick masonry structure are in extensive damage state, the direct economic loss of the former is greater than that of the latter, as the former is much more than the latter in quantity. Although the quantity of shear wall structures is small and most of them are in the damage state of slight and moderate, the direct economic loss of shear wall structure is greater than that of unreinforced brick masonry structure. The reason is that the replacement cost is quite high, as most of them are high-rise buildings with large loss ratio for corresponding damage state.

Fig. 16
figure 16

Direct economic loss: a spatial distribution in the sub-district level (total), b bar chart (structure, decoration, property and total)

The assessment results of casualties have a great relationship with the time of earthquake occurrence, as the people indoor rate determined by the time of earthquake occurrence. If the earthquake occurs at night (22:00 p.m.–07:00 a.m.), most of the residents would be sleeping, caused larger number of casualties than that occurred during the day. Obviously, the casualties in Baqiao are mainly concentrated in areas 002, 006, and 007 (Fig. 17). The population density of these areas is relatively large, and there are a large quantity of unreinforced brick masonry structures in these areas with long service years and high death rate. The number of fatalities in the areas 004, 008, and 009 is relatively small since the seismic ground motion subjected in these areas is relatively small.

Fig. 17
figure 17

Expected number of casualties: a spatial distribution in the sub-district level (death), b bar chart (minor, severe and death)

4.2.4 Decision support

According to the insurance rate determined in Sect. 3.6, the annual insurance premium of the buildings in Baqiao District under seismic action of the basic fortification intensity can be calculated by multiplying the total earthquake insurance rate (TR) with the building insured value (Fig. 18a). It should be noted that the premiums are calculated under ideal conditions, assuming that the popularization rate of earthquake insurance is 100%. These data can provide reference for the insurance policy making of our government or commercial insurance company.

Fig. 18
figure 18

The estimated distribution results of Baqiao under seismic action of intensity 8. a Annual premium (in thousand RMB), b building reinforcement

A retrofitting benefit–cost ratio for a given building typology at each site in the exposure model can be produced by using the benefit–cost analysis plugin of building retrofit. For those buildings that values over 1.0, a reasonable reinforcement scheme can be made to reduce the disaster losses of buildings in the earthquake. The spatial distribution of the quantity of buildings that need to be reinforced under seismic action of the basic fortification intensity in Baqiao District is illustrated in Fig. 18b.

5 Conclusions and future plans

Building a framework presents many advantages. Sharing the technical platform helps to collaborate and improve the quality of the framework itself. Furthermore, it allows the automation of the main part of the software development process to increase productivity and quality.

The CEDLES framework provides the possibility to build extensible earthquake hazard analysis applications. In this framework, many common functions and services are defined, including plugin management, view definition, GIS service, and database operations service. Therefore, it becomes possible to create the prototype for earthquake disaster risk prediction and loss assessment. The first prototype, ERPLAS, which integrates the earthquake disaster models for the earthquake risk prediction and loss assessment in China. It was applied to the Baqiao District, Xi’an, China, and the results of structural damage, economic loss, casualties, annual insurance premium and building reinforcement are calculated, which can provides data support for earthquake prevention and disaster reduction and emergency relief of our government. At the same time, it verifies the feasibility and convenience of the CEDLES framework. In addition, the CEDLES framework and ERPLAS application are intended to be an open-source software, and we hope to receive contributions from the community in order to support other adapters for different types of functionality. It should be noted that the precision and accuracy of the evaluation results are not only related to the evaluation models, but also related to the exposure model. Thus, a short-term plan is to develop an urban information collection tool that combines big data technology and web crawler technology based on existing collection methods (Long et al. 2016; Xu et al. 2018). Plans in the short and medium terms will focus on the development of new features and an improved overall efficiency of ERPLAS. Long-term plans are to integrate the latest earthquake disaster models and extend the CEDLES framework for fields other than earthquakes, such as fires, floods, and hurricanes.