A Web and Mobile GIS for Identifying Areas within the Radius Affected by Natural Disasters Based on OpenStreetMap Data

—In many countries where natural disasters often occur, such as Indonesia, information about the area affected by the disaster is very important. As in the transportation sector, road users must avoid affected areas and roads. To overcome this problem, in this paper we propose a Geographic Information System (GIS) to identify areas affected by natural disasters within a certain radius. We use a web-based and mobile platform to present an open access sys-tem. In addition, we utilize Open Street Map map data as a source of spatial database that is open, wide-scale, and complete. In the initial stage, polygon-shaped road data will be split into shorter line segments and stored in Post GISS patial DBMS. Furthermore, this system will automatically detect road segments that included within the radius of a natural disaster event. Displays of road segments affected by disasters will be accessible to users through web and mobile applications. In addition, we also test and evaluate our system in case studies in certain areas in Indonesia.


Introduction
In this world, every country will be at risk of natural disasters, such as floods, earthquakes, tsunami, fires, and landslides [1]. Even some regions of the country have high rates of natural disasters. For example, areas that have high rainfall will have a higher risk of floods and landslides. Areas that are close to the tectonic plate boundaries will be more affected by tectonic earthquakes. And then the areas close to active volcanoes, the possibility of volcanic earthquakes will be higher.
At a particular scale, a natural disaster will cause damage to the infrastructure of an area, especially the transportation sector. In this sector, the road is an important infrastructure and is widely used by the population. Destruction to road infrastructure will result in a collapse in logistics access from one area to another. In this incident, road users often do not know the information of the area affected by natural disasters, especially information about roads that cannot be passed. If the information can be known first, then road users will be able to make a solution to these conditions, such as finding another route or cancelling the travel plan.
To overcome this problem, in this paper we propose a geographic information system to identify areas affected by natural disasters within a certain radius. In this system, if a disaster occurs that affects infrastructure damage, the government or a related institution will determine a centre point for the disaster and decide the level of destruction from the disaster. The level of destruction will define how far the radius of the area affected by the disaster. Furthermore, the infrastructure especially roads, that entering the radius will be displayed in the form of data and digital maps. With an open-access system model, users can freely access and obtain information related to which roads are affected by the disaster so it cannot be passed [2]. In addition, geospatial information in the form of disaster location data that is accurate, reliable, and accountable is needed to facilitate disaster management.
As a case study, we will implement this system in the territory of Indonesia, which is in East Java province. To implement an open-access system, we will develop applications on the web and Android mobile platforms. With both types of platforms, the users will be able to access this system from anywhere, including from their respective vehicles. For spatial data needs, we use data from Open Street Map [3], a free access map data of the world and built by a community of mappers that contribute and maintain data about roads, trails, cafés, railway stations, and much more. The coverage of spatial data provided by Open Street Map has been very extensive and quite comprehensive, especially for road data in Indonesia. It was different with spatial data that has been collected by local government or specific organization. It was often incompatible [4].
To implement spatial data processing, we use several geometry calculation methods in this system. First, we downloaded the Open Street Map data specifically for the province of East Java, Indonesia, then export it into a spatial DBMS, Pos tGIS. The polygon-shaped road data will be split into shorter line segments and stored in another table. For each natural disaster event that is entered, the system will automatically identify segments that enter the circle at a certain radius, based on that data. Several spatial functions and Haversine formulas [5] are used in the identification process.
At the end of this paper, we present the results of testing and evaluation of this system. Performance shows that the density of a region's data will affect the access time of this system. This is due to the use of spatial functions and geometric calculations that require a long processing time. Furthermore, it will be closed with conclusions obtained and plans for future works. This paper contains 8 sections. Section 2 provide some related research that was conducted in GIS for disaster management. In section 3, we discuss about GIS, spatial data, OpenStreetMap, and geometry calculation for spatial case. Section 4 explain about the method to detect affected area of disaster. Section 5 present the design of the mobile and web system. In section 6, we show implementation process of the system. Evaluation about system implementation is explained in section 7. Finally, we resume the conclusion about this research and provide the future works.

Related Works
In 2013, Lamovec et al conduct a study to present the important method in machine learning for quick and effective procedures on remote sensing data for detecting flooded area [6]. They use satellite images, digital terrain models (DTMs), and the river network in this case. The J48 decision tree algorithm produced the best results to determine flooded area in Selška Sora river valley, Slovenia.
In 2017, Sangameswar et al developed an algorithm to identify area affected by natural disaster using data that gathered from social media [7].To obtain information on the natural disaster, the tweets from Twitter social media are extracted to R-Studio environment then analyze it using big data mining algorithm to map and present the natural disaster in India.
Also in 2017, Ruiliang Pu conducted a study about mapping and assessing natural disasters with utilize geospatial technology, including remote sensing, GIS, GPS, and spatial statistics [8].This study related to mapping, monitoring, and assessing natural disasters before and after they occur.
Continue in 2017, Indriasari et al propose My Map Volunteers, a mobile and web application to map the disaster volunteer position [9]. It can effectively and efficiently detect the position then improve the disaster management. With this application, the disaster coordinator can search the volunteers and monitor their positions fastly.
In 2018, Wang et al proposed an architecture to collect, manage, transport, and process the observational data of geosensor networks disaster monitoring [10]. To apply this architecture, they developed the Mine Slope Monitoring System in China. This study evaluated this system has been implemented at the Chinese mine.
In 2019, Subasinghe et al developed Citizen Disaster Reaction Multi-Agent Simulation, a multiagent system that simulates the reaction of citizens to a natural disaster in a city by gathering information from social media [1]. The evaluation result showed that event mapping based on citizen update streams is mostly influenced by the amount and movement of citizen.
Also in 2019, Srivathsav et al proposed a system namely Automatic Disaster Detection System, a post disaster system that designed to detect the disaster affected areas and to support post operations [11]. With this system, we can see the area that most affected by natural disaster with comparing imager from Google Earth.

Geographic Information Systems
Geographic Information System (GIS) is a computer-based system that is used to store and manipulate geographic information [12]. GIS is designed to collect, store, and analyze objects integrate location as part of an information system [13]. GIS has the following four capabilities in handling data that is a geographic reference [14], including input, data management (data storage and calling), data analysis and manipulation, and output. Nowadays, there are some proliferation of free-to-use mapping software such as Google Maps and Bing Maps, as well as the free and open-source map provides Open Street Map [15]. As an information system, GIS comprises spatial data, the software, and analysis and modeling tools [13]. It produces visual or data outputs shared on a network or cloud, stored in a database, or displayed on mobile or computer devices. The most widely used data is the spatial data type. The DBMS type is spatial DBMS. In this system, the source of map data used is Open Street Map and the spatial DBMS used is Post GIS. In GIS, existing spatial data will be processed so that the information needed by the user is generated. Data processing can use queries on the DBMS by utilizing functions for geometry. Also, geometry processing with formulas, such as Haversine, is needed to find the distance of 2 points.

Spatial DBMS
Spatial data is data that have some form of spatial or geographic reference that enables them to be located in two (or three) dimensional space [16]. The objects stored in spatial database are the spatial objects with each type and has implicit relationship between the objects [17]. Currently, spatial data is becoming an important medium for sustainable development planning and natural resource management on continental, national, regional and local coverage. The utilization of spatial data is increasing after the existence of digital mapping technology and its utilization in GIS. Spatial data formats can be vector (polygon / area, line, points) or raster.
The Spatial Database Management System (Spatial DBMS) is software that can work like the existing DBMS and supports spatial data models, spatial abstract data types (ADT / Abstract Data Type) & query languages that can call ADT. This software also supports spatial indexing, efficient spatial operation processing algorithms, and domain rules that are specific to query optimization. One of the open-source Spatial DBMS is Post GIS, an extension of Postgre SQL that can perform spatial data processing. Post GIS can be used to handle and process geographic data. This GIS database can both manage the spatial data and common DBMS function [18].

Open street map data
Open Street Map (OSM) is a project that aims to create and provide geographic. It is a free access map data of the world and built by a community of mappers that contribute and maintain data about roads, trails, railway stations, and much more [3]. Through the Open Data Commons Open Database License 1.0, OSM contributors can own, modify, and share data widely.OSM's greatest strength that it will be huge media of contributors [2]. They have collected and generated street and topographic data with simple teams and without world-class equipment. They also have unequal mapping and cartographic experience, different cultures, and various educational backgrounds and interests [19].
At present, there are various types of digital map providers available on the internet, but most have limitations in their free use [20]. It makes the community, government, researchers and academics, innovators, and many other parties unable to freely use the data available on the map. The availability of OSM spatial datasets has produced many opportunities for researchers and developers to develop system against restricted spatial datasets [21].In OSM, the spatial objects are encodedin the form of vector data, including points, polylines, and polygons [22]. It was described as attributes called tags (place, road, river, highway, and so on). Initially, OSM focused onmapping streets and roads, then it has moved so far beyond these types [23].The number of new features will always increase year by year [24].

Geometry
Geometry means the measurement of the earth, namely the study of relationships within space. To calculate the coordinates of the location of the earth in this study using the decimal degree format that is by using 2 numbers that show horizontal and vertical lines. The Haversine formula is an important equation in the field of navigation, to find the distance of an arc between two points on the ball of longitude and latitude [5]. TheHaversine formula, in another name, is also termed as "Great cir-cleDistances" [25].This is a form of special equations of spherical trigonometry in looking for the relationship between sides and angles of triangles in the spherical plane.
To get the distance between two coordinate points on the earth, it is necessary to implement the haversine and spherical law of cosines equations to get the Haversineformula as shown in Formula 1. (1) In its application to the earth, this Haversine formula must be multiplied by the radius of the earth's circle whose value is 6371 km. For latitude and longitude values in the form of decimal degrees, it must be changed to radians by multiplying the latitude and longitude values by 1 degree or 0.01745329251994 rad [2].

Method
To build a system capable of processing spatial data, a Spatial Database Management System (SDBMS) is needed. In this study, the author uses Post GIS because it is open source, supports several spatial functions, and is quite supportive when compared to other open-source Spatial DBMS [8]. We carry out three stages of the process namely exporting source data, processing spatial data, and presenting maps to users. As shown in Fig.1, data source will come from Open Street Map and end in the presentation of maps on web and mobile applications.

Exporting data source
In this research, we will use the Open Street Map road spatial data for Indonesia, especially the East Java province, as a data source. The data format and structures are open and free to access for developing and delivering geographical information [26]. This data can be converted into other widely used spatial data formats, such as KLM (Google Earth) and SHP (Arc GIS). As the extraction of data from OSM, it will take some time to extract, especially for a large area [27]. Furthermore, OSM source data is exported to Postgre SQL which already has a Post GIS extension so that it can perform operations for spatial data [28]. Postgre SQL with this extension can then be classified as a SDBMS, a DBMS that can process spatial data. Then the data that has been stored in this SDBMS can be further processed for the needs of mapping road conditions.

Data processing
Spatial data from OSM is stored in SDBMS with multiline string geometry data types. The multiline string data type is a type of geometry data in the form of collections that only contain line string. While line string is a collection of dots that form a set of connected straight lines. This data type is usually used to map certain objects such as roads, rivers, paths, and circuit paths. Geometry data for this road needs to be processed before it can be marked as a disaster-affected area. Line lengths vary from tens of meters to thousands of meters, thus requiring the separation of road data into segments with a maximum length of 5 meters [8]. Each of these road segments will be marked according to their conditions. Fig. 2 shows the steps to make the affected area data. To mark the affected area on the road can be done on 1 data road with a maximum length of 5 meters [8]. Each road segment can be marked and stored in a separate status table. Data collection of road segments that have been marked according to their respective areas are then displayed in map form on web browsers and mobile devices. To display spatial data in the form of maps in web browsers and mobile devices, can use the Leaflet library which is integrated with the PHP programming language and XAMMP as the server.

User presentation
To present the map information to user, we use two frameworks, including web application and mobile application. The web applications will be developed with the Node.js, an event-driven I/O server-side JavaScript environment that allows for Ja-vaScript to operate on the server. To present the OSM-based map, we use Leaflets, the leading open-source JavaScript library for mobile-friendly interactive maps. To fit up the web application, we develop an Android-based application using the react native libraries from Github. With mobile apps, people can easily to acquire information, resources, and services at any time and place [29].
An OSM-based map will be displayed on the web page or mobile application, as a basis for displaying damaged road data. Further damaged road segments will be added at the top layer, according to the geometry of the segments, including the coordinates, lengths, and locations of the region.

System Design
To mark the affected area on the road can be done on 1 data road with a maximum length of 5 meters [30]. Each road segment can be marked and stored in a separate status table. Data collection of road segments that have been marked according to their respective areas are then displayed in map form on web browsers and mobile devices.

Type of disaster
Natural disasters are disasters caused by events or series of events caused by nature, including earthquakes, tsunamis, volcanic eruptions, floods, droughts, hurricanes, and landslides. According to these conditions, the writer uses geometry analysis. The generating process is carried out around the circle of areas where natural disasters occur.

Database design
This database contains disaster entities as a whole and segment data entities reported according to disaster conditions. The road segment entity will be filled with segmented process results data from all road segments taken from Open Street Map. Each segment will represent part of the path that can be given a status according to its condition. Each segment will contain information such as road ID, length, geometry data, region, and road metadata. Fig. 3 has shown that the disaster_points table represents all path data taken directly from Openstreetmaps. Spatial data points are stored in multicasting format. Furthermore, all data paths are broken down into segments that are stored in the pnm_road_segments table, where spatial data from the road segment is stored inline string format. The next data segment inputted by the admin will be saved in disas-ter_points. Every natural disaster will be stored in a disaster_points table, including radius, disaster status, related information, time of occurrence and reporting time. Each disasteraffected area will include one or more roads and will be stored in the road_segments table. Each saved segment will contain information from the center line geometry, the centroid point geometry, and segment length.

Road segmentations
The existing data in Open Street Map is represented in the form of string lines, where the length of each segment varies from tens of meters to thousands of meters. To record road conditions, a shorter segment is needed so that data collection of road conditions will be more detailed. Each path will be splatted into several segments with maximum length of the segment is 5 meters [30]. To segment paths with a maximum length of 5 meters can use the following query: SELECT a.osm_id,(a.ra).path [1] AS sid, a.name, st_segmentize ((a.ra).geom, 0.00004533::double precision) AS lgeom, st_length ((a.ra).geom::geography) AS length FROM (SELECT osm_id::bigint AS osm_id, name, st_dump(geom) AS ra FROM pnm_roads) a;

Identifying of affected segments
The road segment may have affected status if the admin has validated a disaster will be published via the website. The following are the coloring types of disasters that occur with the following results: • Landslide: Green • Flood: Blue • Fire: Red • Earthquake: Yellow Following this, the marking area flow can be seen in Fig. 4. The following is an explanation of each process above: • Determine the centre point (latitude and longitude): In addition to determining the centre point is also determined the disaster radius value with units of KMs that are useful for forming circles on the map. • Data is stored in the database: After the data input process, the data will be stored in the Post GIS database. • Encoding: This is the process of implementing a system that has been designed previously that is making the affected area in the form of a circle by dividing the road segment using the PHP programming language. • Shown on the web: At this stage, the results of the coding will appear in the form of websites with various colors according to the type of disaster that is inputted and contains information about the disaster.
With the steps above which are based on the leaflet library so that the affected area is formed in the form of a circle with the description of the affected street name, the length of the affected segment and the shortest distance from the centre with different colors for each disaster. System Implementation At this stage detailed and detailed discussion on the implementation and testing of identification of areas affected by natural disasters by utilizing OSM spatial data. Below is a description of the course of the geographic information system.

Spatial data
Spatial data stored in DBMS can then be accessed and presented through web applications and mobile devices. By using the web and cellular applications, all communities can easily access this system, used to visually see data and road positions affected by disasters.

Web application
In developing web applications, the author uses PHP and JavaScript to encode the system. Helped with leaflet as an open source JavaScript library and easy to analyze to do the interactive mapping. OSM-based maps will be shown below.  Fig. 5 is a display of a web-based system, as a basis for displaying road data affected by natural disasters, information is added according to the coordinates of the disaster centre in the form of street names, the length of the affected segment and the shortest distance from the centre point. Besides, the user can input the range of date that the disaster was available. The disaster affected areas do not all have street names, but on the OSM map they already have osm_id just naming the road. To get results like the picture above the author uses the following query: In the query above $latt and $long is the latitude and longitude value at the center of the disaster. Whereas $radd itself is a radius value on the OSM map which at each kilometre = 0.0091 on the map and $ km is the radius value that has been inputted to the disaster data, that the data will be dynamically loaded by the system.

Evaluation
Based on application in the previous section, it is necessary to implement database design in SDBMS Postgre SQL with Post GIS extension. With this implementation, it takes some time to load the following application. The time calculation table needed in the disaster data runtime process is based on the radius value. Different centroid point will produce different number of segments and roads. Refer on Table 1 and Table 2, segment number under 5000 will make application timeout. The longest loading time obtained by case of centroid that produces 4754 segments with more than 6 minutes loading time. The result, of course, is depend on the hardware specification and connection quality.  The table above is the result of a system runtime whose center point (latitude and longitude) has been determined previously. The timeout results are obtained if the process of loading the system is long enough. This is due to the wider area segment that requires a long load time too.  figure 7 where the graph above shows that the radius value in a disaster greatly affects the load process on the system. This is because the radius value affects the area affected. The higher the radius value, the wider the area affected by the disaster, which means that the length of the segment is wider, and the road data affected is also increasing.

Conclusion
The results of this spatial data analysis are able to segment the path and display the affected segment length by forming circles or radius in kilometers. Every disaster event will be stored in a disaster ID, each disaster ID has its own radius value and centre point so it can be clearly seen that each disaster will display the name of the affected road, the length of the affected segment and the closest distance from the disaster point. The process of displaying the area affected on the map also requires a certain amount of time depending on the density of the road, the connection and the area affected.
In the future, we will improve the method with the form of a polygon of affected area. We will also add some features to detect other objects like building, river, lake, public facilities. Also, the features to make new route to avoid disaster affected area. In addition, we will also develop the design of this this so that it can be more integrated and with existing natural disaster warning systems.