MzS Tools: GIS methods and tools for seismic microzonation mapping

MzSTools is a plugin for QGIS developed by the Institute of Environmental Geology and Geoengineering of the National Research Council (CNR-IGAG). The plugin has been designed as a set of practical and easy-to-use tools to carry out seismic microzonation (SM) studies, by producing standard compliant geographic database and maps, thus making them accurate, homogeneous and uniform for all municipalities in Italy. A geodatabase based on SQLite/SpatiaLite Relational Database Management System (RDBMS) has been designed to collect and store data related to elements such as: geognostic surveys; bedrocks and cover terrains; superficial and buried geomorphological elements; tectonic-structural elements; elements of geological instability such as landslide zones, liquefaction zones and zones affected by active and capable faults; homogeneous microzones in seismic perspective, microzones characterized by a seismic amplification factor. MzSTools assembles in a single software environment a set of useful tools in a configurable QGIS project template, comprising layers, symbol libraries, cartographic styles and print layouts for the SM maps. The plugin is open source and hosted on the GitHub platform, and available via the official QGIS plugins repository (https://plugins.qgis.org/plugins/MzSTools/).


Introduction
Earthquakes, landslides, subsidence, and floods are geological hazards that commonly affect urban centres and whose impact leads to loss of human lives and huge economic damages. Therefore, national and international institutions are trying to address their policies to mitigate risks by managing environmental hazards and planning future development of urban areas [17]. Earthquakes are one of the main natural disasters and many studies are aimed at mitigating the seismic risk. To achieve this goal, geological, geotechnical and geophysical data are analyzed and integrated to map zones, especially in urban areas, with homogeneous seismic behavior in case of a seismic event; this process is called "seismic microzonation" (SM).
SM studies require in-depth knowledge of the subsoil and of the geological characteristics of the study area, and this data is often managed through geographic information systems (GIS).
A GIS allow to manage data assigning geographic information, attributes and to produce new information through operations of spatial analysis on different kinds of data.
The first examples of SM studies in urban areas were carried out starting from geological and geotechnical data stored in a database, and performing data management and spatial analysis tasks to produce microzonation maps. Some experiences of SM were based on a single hazardous parameter (e.g. VS30, natural period and response spectra), whose interpolation produced thematic maps. The spatial distribution of these parameters provided information on the scenario of site amplification in different parts of the city [8]. In some cases, the significance of the generated maps, with geological and geophysical data (e.g. fundamental period or liquefaction susceptibility) with respect to damage risk, was verified by means of a statistical regression analysis [6].
A number of SM studies were carried out, also, using automated GIS-aided methodologies. In those cases, GIS was only used for locating the available borehole and for drawing digital contour maps, while data processing was performed externally with specific software. Processing of selected geological data, along with engineering geological information, was used to establish the shear wave with depth to estimate, as a final product, seismic ground surface response in the study area [12]. GIS are also employed with integrated systems that consist of a database containing different kinds of data and sub-modules that execute various functions (input, geostatistical 3D integration, real-time earthquake hazard assessment) to obtain earthquake hazard liquefaction assessment [6].
Identifying areas in the territory with a homogeneous seismic response in case of earthquake is the result of the analysis of different geological, geomorphological and geophysical factors. For this reason, some SM studies were carried out using the multicriteria decision analysis which, through the analytical hierarchy process (AHP) technique, assigned weights to factors (peak ground acceleration, geology, geomorphology, slope amplification factor, etc.) depending on their contribution to the seismic hazard, allowing to produce maps of susceptibility to seismic risk [2,4,5,9,11 ].
In Italy, after the earthquake in 2009, the "National Plan for Earthquake Prevention" was launched and the law 77/2009 assigned economical incentives to perform seismic microzonation studies in all the urban areas characterized by a value of peak ground acceleration (PGA) greater than 0.125 g. SM studies have been regulated by technical documents drawn up by the Italian Civil Protection, which foresee three levels of studies. The first level identifies homogeneous areas in a seismic perspective on a purely geological basis [10], while levels 2 and 3 quantify the seismic amplification with numerical analyses of local seismic response.
To provide recommendations on how to conduct SM studies in the three levels, Italian Civil Protection, with the support of experts and research institutions, defined guidelines, standards and a technical reference document. Cartographic standards have been prepared [3] to obtain homogeneous studies for different areas. This document define the specifications to follow for data storage and map design and styling for the different levels of SM studies [16].
Therefore, one of the critical steps in SM studies is to produce SM Standards compliant data and maps. In fact, all of the data and cartography that constitutes a study is subject to validation by a technical structure that checks the compliance with the Standards and requests corrections, in case of discrepancies, before accepting a study In this paper we present a specific tool, developed as an extension for the open source QGIS software to assist study authors in the production of thematic SM maps (survey map, geological-technical map, microzonation maps, etc.) and the management of geological, geotechnical and geophysical data according to the established standards .
The GIS laboratory of CNR IGAG developed "MzS Tools" to support geologists in many stages of SM studies, from data collection to map production, in a single, userfriendly and inexpensive software environment. The tool is free, open source and downloadable as a QGIS plugin.

Materials and Methods
The complexity of the mechanical and physical characteristics of the subsoil complicates the data archiving process, which in turn is a prerequisite to analyze and represent data on maps. The storage of geological information needs a well-defined data structure, respecting a specific scheme that guarantees its integrity, consistency and graphic reproduction by means of standardized thematic maps.
The standardization of data storage and their cartographic representation facilitates the reading and comparison of results coming from different territorial backgrounds. The SM Standards provide the technical specifications for the production of several elements necessary to carry out the SM studies:: • cartographic styles (symbols, colors, descriptions) and print layout for maps; • the database structure for storing alphanumeric and geographic data; • the filesystem structure to manage all project files. The SM Standards do not explain the procedural aspects to be adopted for the implementation of SM studies, such as the use of specific software or data management and processing tools, for which the decisions are up to the authors of the studies. The only basic requirement is that the data storage and maps, regardless of the software and tools used, comply with the SM Standards.
The software platform used for the development of the MzS Tools database and cartography tools is the open source and multiplatform QGIS software. QGIS [12] is one of the most widely used and best known open source GIS software [15]; it features a huge number of capabilities ranging from data editing to geoprocessing, with support for all the main raster and vector data formats and online services such as WMS (Web Map Service) and WFS (Web Feature Service). These capabilities, great extensibility and ease of use, make QGIS an obvious choice for an open, integrated platform for GIS projects. Moreover, an open source software does not force users and institutions to acquire commercial licenses and to become dependent on a single vendor for products and services ("vendor lock-in").
The basic idea of the development of MzS Tools was to provide, in a single environment, a complete set of useful software tools for SM studies, simplifying the procedures for creating projects and maps according to the SM Standards. QGIS allows adding specific functionality through scripts and programs written in Python by means of an interpreter and a series of specific libraries. PyQGIS is the library that allows Python to interact with the features of QGIS. PyQT allows the creation of customized graphical interfaces such as "widgets" (buttons, labels, tables, drop-down menus, etc.) for insertion and data editing; furthermore, QGIS makes it possible to assign to each layer specific and complex graphical data entry forms designed with QT Designer.
The plugins published through the official QGIS repository can be searched and installed using the integrated plugin manager ( Figure 1); after installing MzS Tools, a toolbar containing SM specific tools is automatically displayed in the QGIS interface. MzS Tools aims to address and provide solutions for a series of practical challenges commonly faced by SM study authors: • automatic generation of the project structure; • ready to use geodatabase structure in SQLite / SpatiaLite format; • assisted editing of georeferenced geometries to ensure the correctness and coherence of the geographic layers; • user-friendly data entry interfaces for the attribute tables of the vector layers and for the survey database, comprising features to simplify the encoding of information, the selection of admissible values and the management of relationships between the database tables. • dedicated tool to import data from existing projects based on shapefiles and Microsoft Access database; • symbol libraries in Scalable Vector Graphics (SVG) format; • configurable QGIS project, automatically generated for a specific municipality; • ready to use, standard compliant print layouts for SM maps; • automated export tool to produce a project structure based on shapefiles (geographic data) and SQLite (survey database) format, as required by the standards for study validation.

Database structure
A fundamental element of SM is the definition of the subsoil model of the study area. To define the subsoil model it is necessary to have a dataset of georeferenced information such as a topographic base map (with a scale of at least 1: 10,000), geological, geologicaltechnical, hydrogeological and geomorphological maps.
Lithostratigraphic and geotechnical data are also required from geognostic surveys and geophysical data that define the velocity of propagation of seismic waves within the covering deposits and geological units of the substrate.
The information to be filled in the survey database is detailed in the SM Standards. The geographic layers generally have a single attributes table, with the exception of geological surveys in which alphanumeric information is stored in a series of related tables in a Microsoft Access Database, and linked to georeferenced geometric objects (shapefile or ESRI geodatabase) with a 1:1 relation. The geological and geophysics surveys are stored in two different geographic layers characterized by punctual ("Ind_pu") and linear ("Ind_ln") geometries. One of the biggest drawbacks of the SM Standards approach consists in having to manually relate the geometries of the geological surveys to the attributes contained in the Microsoft Access database, by ensuring the correspondence of the respective ID codes.
MzS Tools has solved this problem by using the SQLite / SpatiaLite geodatabase format, which integrates both georeferenced geometries and alphanumeric information in a single table. Moreover, database features such as views, functions and triggers, have been introduced to automate many operations and ensure greater quality and control of data. In fact, SQLite is a full-featured open source Relational Database Management System (RDBMS) that uses a single file (with the ".sqlite" extension) for storing information on desktop platforms, while SpatiaLite adds functionality for the management of georeferenced data, compliant with OGC (Open Geospatial Consortium) standards. SQLite/Spa-tiaLite allows to build single-user, lightweight and high-performance geodatabases and to manage data through SQL (Structured Query Language) and a complete set of spatial functions. Figure 2 shows the scheme of the seismic microzonation database (SMDb) described in the SM Standards.  Table 1 and Appendix A).
The structure of the SMDb consists of 17 tables of which: 11 tables with geographic information and attributes; 5 non-spatial tables related to the geognostic surveys and a table containing the metadata of the MS study.
The geodatabase managed by MzS Tools has been structured in order to store the information as shown in Table 1. • Stab: stable zones and stable zones susceptible to local amplification with amplification factor (Fa).
• Instab: areas of attention for instability with amplification factor (Fa) and specific instability parameters. The MzS Tools geodatabase adds to the SMDb schema a series of views (virtual tables based on specific queries) and accessory tables ("lookup tables" and tables containing administrative units 1 ) to support functionality of the QGIS project ( Figure 3). These additions help manage the map layouts and facilitate the insertion of data through data entry forms, e.g. by using drop-down menus containing lists of codes fetched from lookup tables.

The QGIS project structure
The MzS Tools "New project" tool allows generating an archive structure and a QGIS project for a new MS study. Once the municipality has been chosen, the plugin automatically performs a series of settings on the project: database views are updated on the basis of the chosen municipality, the base map and layouts in QGIS project are centered on the municipality extent. Furthermore, the "New project" tool UI (user interface) allows the user to insert metadata such as the author's information, data ownership, the nominal reference scale etc., as required by SM standards.
The QGIS project TOC (table of contents) contained in the "Layers Panel" presents a tree structure (Figure 4) with layer groups. The "Layout" group, in particular, contains layers specifically set for cartographic output, while the other layer groups are dedicated to data management and editing. Some utility layers such as municipal administrative limits and some WMS services 2 are preloaded in the "Cartografia di base" group, but others can be added according to project needs. All the layers contained within these groups have specific styles based on logical expressions that allow complying with the indications of the SM Standards regarding styling and symbology ( Figure 5). The project also contains settings reflecting the one to many (1-N) relationships existing between the geological survey tables ( Figure 6)

Data entry and geometry editing
To facilitate the storage of alphanumeric data in the SMDb, 23 data entry forms have been configured within the QGIS project. QGIS automatically displays the appropriate form as soon as the geometry of a feature has been edited.
The data entry form can be more or less articulated according to the amount of information related to the inserted geometry. Table 2 lists and describes of the forms divided by theme:

Topological editing
For the production of SM maps, a series of rules should be applied during geometry editing to avoid topological errors regarding polygons contained in the same layer or in different layers, as in the case of stable and unstable zones and geological-technical units.
MzS Tools provides a dedicated tool that automatically apply, to suitable layers of a SM project, a series of settings related to the QGIS "Topological editing" features 3 . These features help the SM study author to avoid topological errors commonly made during feature editing. The topological rule allows you to prevent overlapping of polygons during digitization (Figure 8). If you already have one polygon, it is possible with this rule to digitise a second adjacent polygon so that both polygons overlap and QGIS then clips the second polygon to the common boundary. (Figure 8).
In particular, the topological controls concern the intersections between polygons of the same layer (stable, unstable zones and geological-technical units).

Import tool
MzS Tools plugin provides the "Import project folder to geodatabase" tool ( Figure 9) to import data from an existing, SM standard compliant project based on the use of shapefiles and Microsoft Access database as data formats. The plugin tool is able to automatically transfer the geographic data coming from the shapefiles and all the accessory files stored in the existing project structure, to a new MzS Tools project structure. To import data from the Microsoft Access database it is necessary to convert the tables first to a textual format (the operation is described in detail in the plugin manual).
After importing the data, a textual report is written which lists the operations performed and the possible errors found.

Export tool
The file system structure of a project generated by the MzS Tools plugin does not correspond entirely to that provided by the SM Standards, as the former is optimized for use with QGIS. The project, though, can be automatically transposed in a SM Standards compliant structure by using an "Export" tool ( Figure 10). This tool should be used at the end of the entire study workflow to produce a file structure capable of passing the final validation process. The tool requires an empty folder in which to export the project, at the end it generates a textual report with the result of the project export operations.

Map layouts
The QGIS Print Layout functions are accessible from the main menu in the Project section. The QGIS project generated by the MzS Tools plugin provides a set of ready to use print layouts for the different maps to be produced in a SM study ( Figure 11). The layouts are automatically centered and zoomed to the extent of the selected municipality. Below is the list of map layouts provided by MzS Tools: • Geological Survey Map.
• Map of Homogeneous Microzones in a seismic perspective.  To use a specific print layout, it is necessary to enable the corresponding layers of the QGIS project, located in the group layer "Layout" (Figure 12)

Figure 12. QGIS project layers set for SM cartography
Layers located in the "Layout" group are specifically filtered and styled for cartographic output. For example, the punctual geological surveys layer is styled leveraging the QGIS "point displacement" functions, which allows distinguishing the different surveys associated with each site (Figure 13).

Discussion and comparison with other approaches
The implementation of SM studies requires the use of software tools that allow to perform different types of operations on the data and to simplify repetitive tasks such as: data management within a geodatabase structure; georeferenced geometry editing; design of GIS projects with different layers, styles and symbols; use of processing and data displaying tools; design of print layouts for the production of the required cartographic outputs etc.
The fundamental requirement for a SM project in Italy, regardless of the software and tools used, is compliance with the SM Standards (database and maps). This requirement is essential for the validation of a study by the Italian Civil Protection Department, which supervises the SM studies at the national level.
Among the tools currently available, which may be used to support SM studies, we can mention: • SoftMS 4 , a tool specifically developed for the management of the of the alphanumeric attributes of the punctual and linear surveys in a Microsoft Access Database; • GIS software for editing georeferenced data and viewing map layers (for example ESRI ArcGIS or QGIS); • Graphics Software for managing map layouts and for cartographic production (can be a GIS or a graphics software such as Adobe Illustrator, Corel-Draw, and Inkscape). The use of generic software and tools not specifically aimed at SM studies can lead to a waste of time and a greater chance of making mistakes, compared to using specific tools.
In the context of SM, MzS Tools represents a comprehensive solution that assembles a number of useful tools, in a single environment based on the QGIS software, with the aim of simplifying data management and standard compliant map production. The plugin allows users to manage SM data and automate various types of tasks (project generation, data import and export, topological editing, integrity and validity checks on entered data). The QGIS project also includes ready to use layer styles and symbol libraries.
The main advantages in using this tool, compared to other tools and software, can be identified in significant time savings, due to the automation of different processes, and the production of SM studies compliant to the Standards and less prone to errors.
MzS Tools has already been used to support studies in the municipalities of Casamicciola Terme, Forio and Lacco Ameno on the island of Ischia, affected by the seismic events of 21 August 2017, as well as the municipalities affected by the events of 2016 and 2017 in central Italy. Table 17 shows a comparison between the MzS Tools proposed solutions to ease some of the SM study challenges, and some of the possible alternative approaches. On the basis of these considerations it is possible to argue that using a specialized tool such as MzS Tools can be useful to reduce errors and study execution times, while ensuring Standards compliant results. Automatic generation of an optimized archiving structure for a specific municipality. Standards compliant structure generated by an export tool.
Manually structure the workspace or use the available generic templates.

GIS project
Automatic generation of a QGIS project including all of the required layers, styles, symbol libraries and layouts.
Manually build the GIS project (e.g. in ESRI ArcGIS), with required styles, symbols and cartographic layouts, by following the SM Standards specifications.

Data management
Single Spatialite geodatabase containing both the georeferenced geometries and the alphanumeric tables for punctual and linear surveys. Possible and further developments of the plugin could concern the integration of tools for data analysis such as: • geological and geotechnical lithostratigraphic data extraction from geological surveys to parameterize geological units and stable zones; • identify areas with a slope greater than 15°; this value is a limit beyond which the seismic signal is amplified; • automatically calculate the extension of zones of attention, susceptibility and respect for active and capable faults (FAC) by using geoprocessing tools calibrated on the type of faults (normal, inverse, transcurrent) and on the geometric ratio FW/HW (footwall / hang wall). This would allow defining geometric limits of the microzones allowing to improve the SM studies and to refine the parameterization, ultimately producing better cartographic representations.

Conclusions
Since its release, MzS Tools has been used in a number of SM studies (more than 4000 downloads are recorded in the QGIS plugin repository), allowing to optimize different types of data management and mapping tasks, while avoiding common causes of errors and producing standard compliant results. The main features of MzS Tools can be identified in: • Creating, managing and editing SM data through an advanced geodatabase structure in SQLite / SpatiaLite format. • Data management and map production are carried out in the user-friendly, feature rich and open source QGIS environment, with the support of additional tools specifically developed for SM studies.
• Input and encoding of structured data through custom forms allows to avoid common errors and eases the data entry of coherent data in related tables. • Topological editing rules allow to avoid common errors during georeferenced geometry editing, as required by the SM Standards. • The availability of a complete set of ready to use map layouts, cartographic styles and reusable symbols leads to great time saving and less chance of errors. MzS Tools, by extending the already rich set of QGIS features with specific tools, responds to a series of practical needs, giving the authors of SM studies in Italy the possibility to use a single software environment and to simplify many aspects of the process of managing a project and producing the final cartographic outputs.
The software is published through the official QGIS plugin repository and can be downloaded directly through the extension management interface. Software development is still in progress, with the introduction of new functions and the improvement of existing ones. Being an open source product, the development of the plugin is open to anyone willing to contribute with code, suggestions and bug reports by using the GitHub platform at https://github.com/CNR-IGAG/mzs-tools.
MzS Tools was created to facilitate SM studies in Italy, but a similar approach could be easily adopted, with appropriate modifications, in other contexts by leveraging the extensibility of QGIS and the wide range of flexible features offered by free and open source software.
Funding: This research received no external funding.