0% found this document useful (0 votes)
29 views69 pages

Big Data & AI in Natural Disaster Management

This document discusses the application of big data and machine learning in natural disaster management, focusing on their roles in prediction, assessment, and response across six key areas. It highlights the importance of technology in enhancing disaster preparedness and response, while also addressing the unpredictability and challenges posed by natural disasters. The proposed system aims to create an application that accurately predicts various natural disasters, providing early warnings to both government officials and citizens.

Uploaded by

vvaithee177
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views69 pages

Big Data & AI in Natural Disaster Management

This document discusses the application of big data and machine learning in natural disaster management, focusing on their roles in prediction, assessment, and response across six key areas. It highlights the importance of technology in enhancing disaster preparedness and response, while also addressing the unpredictability and challenges posed by natural disasters. The proposed system aims to create an application that accurately predicts various natural disasters, providing early warnings to both government officials and citizens.

Uploaded by

vvaithee177
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

NATURAL DISASTER APPLICATION ON BIG DATA AND MACHINE

LEARNING

ABSTRACT

Natural disasters are events that are difficult to avoid. There are several ways of
reducing the risks of natural disasters. One of them is implementing disaster reduction
programs. There are already several developed countries that apply the concept of disaster
reduction. In addition to disaster reduction programs, there are several ways to predict or
reducing the risks using artificial intelligence technology. One of them is big data, machine
learning, and deep learning. By utilizing this method at the moment, it facilitates tasks in
visualizing, analyzing, and predicting natural disaster. This research will focus on conducting
a review process and understanding the purpose of machine learning and big data in the area
of disaster management and natural disaster. The result of this paper is providing insight and
the use of big data, machine learning, and deep learning in 6 disaster management area. This
6-disaster management area includes early warning damage, damage assessment, monitoring
and detection, forecasting and predicting, and post-disaster coordination, and response, and
long-term risk assessment and reduction.
CHAPTER - 1

1.1 INTRODUCTION

Natural disasters are events that result from natural processes that cannot be predicted.
Natural disasters can also cause loss of life or damage property and economic losses.
According to data provided by world health organizations from 1900 to 2018, there are
around 14 million for all types of disasters. Children are the most vulnerable groups who get
direct impacts of disasters. Disaster victims come from various countries, and disasters have
been threatening the lives of millions of children.

One effort to minimize disasters is to provide a program for reducing the risks of
natural disasters. Disaster risk reduction is a concept of how communities reduce damage and
victims affected by disasters. One example of risk reduction according to the Sendai
framework [3] made by UNISDR (United Nations International Strategy for Disaster
Reduction) is understanding the risk of the disaster. According to Goswami's research states
that the aim of disaster management is minimizing victims, can save victims promptly,
evacuate people to save places, Reconstruct the damages immediately, and Offer first aid
instantly.

The technology today is big data, machine learning, along with deep learning.
According to Hashem's research stated that big data is a set of techniques and technology that
requires a new form of integration to find large hidden values derived from datasets that are
complex, diverse, and of a massive scale. The advantage of using big data can determine the
pattern obtained from data analysis and the creation of hidden information.

In this study, we will review and focus more on Disaster management phases, which
focus more on the use of machine learning in the area of Disaster management phases, which
consists of the data source used and the model/algorithm used. Because to find out whether
the previous research solved the problem in the prediction area and early detection we must
know the data source used already has 5'v characteristics, namely Velocity, Volume, Value,
Variety, and Veracity. The performance level of the model made is good or not from the level
of accuracy, precision, recall, and the execution time. The propose of this study to give an
insight and the use of big data, machine learning, and deep learning from 6 disaster area
which is early warning damage, damage assessment, monitoring and detection, forecasting
and predicting, and post-disaster coordination, and response, and long-term risk assessment
and reduction. But also give the data source that the previous research.

Natural disasters can be defined as a combination of natural hazards and


vulnerabilities that endanger vulnerable communities that are incapable of withstanding the
adversities arising from them. Human beings invariably face threats of natural as well as
human-made disasters, which often lead to massive damages, human suffering, and negative
economic impacts. The main characteristics of natural disasters are unpredictability,
availability of limited resources in impacted areas, and dynamic changes in the environment.
Unpredictability implies that severe impacts on people and property during natural disasters
cannot be predicted with acceptable accuracy. The issue of limited resources emerges
because unpredictability makes it difficult to allocate adequate resources in advance.
Dynamic changes in the environment result because it is difficult to make predictions about
the movement of people and the damages that may occur because of the natural disaster. It is
difficult to predict such changes based on data that pertains to normal periods. Introducing
disaster management policies and applying appropriate levels of information technology and
equipment offer immense potential in enhancing the capabilities of disaster management
policies. In addition, the evolving trends have opened massive technological resources for
reducing disaster risks.

Big data is defined as the technological paradigm that allows researchers to conduct
an efficient analysis of vast quantities of data that is made available through the current
practices. It is the collection of scientific and engineering methods and tools that help in
making the best of massive amounts of available data. Big data addresses not only storage
issues, but also issues related to accessibility, distribution, analysis, and effective visual
presentation of data and analysis. Big data has now become a crucial element of
communication, which complements the conventional exchange of intentional and explicit
messages; such as first responders talking over a voice connection; or an announcement of a
text message through which warning is given to citizens faced with the threat of an
approaching natural disaster. More precisely, communication also entails understanding and
monitoring the entire body of public and openly available communication such as messages
and content that is publicly exchanged on social media. In such situations, people may be
exchanging messages in reporting their condition to their loved ones or making appeals for
help. However, big data allows researchers to conduct a detailed analysis of all
communications which provides valuable information that has a general validity for the
population at large; such as information about a disease outbreak.

In general, the disaster management cycle comprises four distinct phases, which are
“mitigation”, “preparedness”, “responses”, and “recovery”. The goal of the mitigation phase
is to minimize the effects of a disaster (building warning codes and risk zones, risk analysis,
public education). The main focus of the preparedness phase is on planning how to respond to
a disaster. It includes preparedness plans, emergency exercises, and training, but also the
Early Warning System development and implementation. Response activities pertain to
providing the required disaster management services to save lives and safeguard property and
protect the environment during disaster management situations. “Recovery” is the process of
returning systems to normal levels after a disaster. In recent years, the literature on disaster
management mostly focused on the potential that lies in using specific kinds of data for
natural disaster management. It is in this context that this paper makes a review of major big
data sources, the associated achievements in different disaster management phases, and
emerging technological topics associated with leveraging this new ecosystem of Big Data to
monitor and detect natural hazards, mitigate their effects, assist in relief efforts, and
contribute to the recovery and reconstruction processes.

Natural and man-made disasters impact the lives of millions of people worldwide
each year. Often it is the case that human lives are lost as a result of these events. Besides
human losses, significant impacts on infrastructure and properties are caused by disasters.
Disaster management operations are performed before, during and after the occurrence of a
disaster, aiming at preventing human losses, protecting people and infrastructure, reducing
the impacts on economy and reestablishing a state of normalcy. The complexity of the
disasters and the criticality and complexity of disaster operations require robust decision
making, enhanced by information technology and in particular AI. Effective and informed
disaster management is necessary to address the scale and the impact of disasters and in
recent years has been leveraged by advances in ML and DL.

Application fields include disasters such as hurricanes, earthquakes, floods, wildfires


and landslides. The management of man-made disasters such as refugee crises, can also
benefit from recent technological developments. Yet, there is no unique definition of a
disaster. According to the terminology of United Nations Office for Disaster Risk Reduction
(UNISDR), a disaster is a “serious disruption of the functioning of a community or a society
involving widespread human, material, economic or environmental losses and impacts, which
exceeds the ability of the affected community or society to cope using its own resources”.
Based on the EM-DAT terminology, disasters can be categorized in two main groups: natural
disasters and technological disasters. Using a different categorization, disasters have been
categorized to natural and man-made disasters. Moreover, the climate-related disasters in
2020 were mainly responsible for the 389 recorded disasters during the same year. The
statistics besides the human losses placed 2020 above the average in the number of recorded
disasters, with 26% more storms and 23% more floods, as well as in the annual average of
economic losses.

Disaster management addresses disasters over time. Four distinct phases have been
widely adopted: mitigation, preparedness, response and recovery. Mitigation relates to
activities that will either prevent the occurrence of a disaster or reduce the impacts of a
disaster. Preparedness includes the activities that prepare the communities to take actions in
response to a disaster, such as emergency planning, prepositioning of supplies, training and
education of the community in order to better respond when a disaster strikes or to mitigate
the effects of a disaster. Response includes the operations that implement the planning made
to protect the lives and property, the environment, and the socio-economic structure of the
community. Disaster relief and response also includes activities such as implementation of
emergency plans, emergency rescue and medical care, shelter opening and management,
distribution of supplies and damage assessment. It is one of the most researched phases
because it is during this phase that people and infrastructure need the most immediate
assistance. In this phase, time is very much of the essence, so techniques focus not only on
high accuracy results but also fast performing and optimized methods. Recovery
(reconstruction) includes the long-term actions that aim to bring a state of normalcy to the
community. Activities in this phase include among others financial assistance and
rebuilding/reconstruction (e.g., of buildings and key infrastructure). Moreover, the active
involvement of local communities in disaster management can lead to community resilience.

The AI techniques that are used for the purpose of assisting disaster management
across all of its phases consist of several ML and DL methods. ML methods include support
vector machine (SVM), Naïve Bayes (NB) methods, decision trees (DT), random forest (RF),
logistic regression (LR) and K-nearest neighbour (KNN) clustering algorithm. On the other
hand, DL methods include different architectures of artificial neural networks (ANNs), such
as convolutional neural networks (CNNs), multi-layer perceptron (MLP), recurrent neural
networks (RNNs), long short-term memory neural network (LSTM), transformers
architecture and generative adversarial networks (GANs) [3,9,10]. ML and DL enable the
utilization of big and complex datasets in order to develop systems that can predict disasters
as well as assist during the response and recovery after such events and practical decision-
support tools have been developed. These techniques take advantage of the ability to
manipulate different types of data from multiple sources and determine patterns that can
provide intelligence which would be otherwise impossible to divulge. Big data is available
from sources such as satellite imagery, unmanned aerial vehicles (UAVs), social media,
crowdsourcing, geographical information systems (GIS) and wireless sensor networks.

Recent reviews in disaster management have focused on applications of AI in disaster


management and the use and potential of big data in natural disaster management. Sun et al.
presented an overview of example AI applications in various application areas of disaster
management such as hazard risk assessment, vulnerability assessment, early warning
systems, disaster detection, event mapping, damage assessment, disaster rescue and relief and
resource allocation. There is an increasing trend in using AI to analyze and process big data
coming from various data sources for informed decision making in disaster management. The
studies included used in total 26 AI methods for 17 application areas of disaster management.
Yu et al. provided a systematic review of the role of big data in disaster management. The
review covered journal articles published in the period. They authors identified ML including
DL as both an evolutionary technology and emerging technological topic in facilitating
disaster management.

Taking into account the increasing trend in the development of ML-based methods for
disaster management and the rapid advances in DL, a comprehensive review focusing on ML
and DL advances in disaster management is needed. Accordingly, in this paper, a review of
literature studies utilizing ML and DL since 2017 has been conducted, covering various
phases of disaster management with different types of techniques and data.
1.2 OBJECTIVE
 Encouraging culture of disaster preparedness.
 Institutionalisation of disaster management.
 Safety and quick decision making.
 Post disaster medical help and first aid.

1.3 OVERVIEW OF THE PROJECT

Natural disasters can be defined as a combination of natural hazards and


vulnerabilities that endanger vulnerable communities that are incapable of withstanding the
adversities arising from them. Human beings invariably face threats of natural as well as
human-made disasters, which often lead to massive damages, human suffering, and negative
economic impacts. The main characteristics of natural disasters are unpredictability,
availability of limited resources in impacted areas, and dynamic changes in the environment.
Unpredictability implies that severe impacts on people and property during natural disasters
cannot be predicted with acceptable accuracy. The issue of limited resources emerges
because unpredictability makes it difficult to allocate adequate resources in advance.
Dynamic changes in the environment result because it is difficult to make predictions about
the movement of people and the damages that may occur because of the natural disaster. It is
difficult to predict such changes based on data that pertains to normal periods. Introducing
disaster management policies and applying appropriate levels of information technology and
equipment offer immense potential in enhancing the capabilities of disaster management
policies. In addition, the evolving trends have opened massive technological resources for
reducing disaster risks.
CHAPTER -2

SYSTEM ANALYSIS

2.1 EXISTING SYSTEM

Earthquakes have been one of the most hazardous but least predictable natural
disasters. The occurrence of catastrophic earthquakes results in casualties, massive damage to
the infrastructure, the vanquishing of societies in a flash and a sudden downfall in the
country’s economy. There are many geographical factors that may cause an earthquake,
including ground motion, heavy rainfall, rock bed material, regional tectonics and altitude.
There is a tremendous pressure on geologists and seismologists for the prediction of the time,
place and strength of earthquakes.

DISADVANTAGES:

 Fears of false alarms – no fail proof system in place.


 No concrete evidence to prove an earthquake is about to occur.
 Disaster may occur within a certain radius of the prediction and false preparation or
lower magnitude disaster could occur.
2.2 PROPOSED SYSTEM

In proposed work is aimed is to build an extremely accurate, easy to use application


that predicts when the next natural disaster in a particular location is going to take place. The
application can accurately predict most major natural disasters like earthquakes, cyclones,
tsunamis, avalanches, floods and droughts. This application cannot only be used by
government officials but can also be used by common citizens to take their own self care
measures apart from the ones the government takes for them. Our main aim for this
application named NatDisP is that it should be a wholesome application that can give early
warnings for all the major natural disasters at one place. This will not only make it easy for
the government officials but also give the citizens a sense of security and make them feel that
everything is under control and they will know that they will know if something is going to
happen. No disaster will hit them unexpectedly. Which will be of great relief for the citizens
of any place? Our application makes use of deep and machine learning algorithms for all the
models i.e., for the models of each natural disaster.

ADVANTAGES:

 Ability to prepare belongings and evacuate areas.


 Chance to disconnect gas, electricity and water.
 Allows for life to be saved – human and animal.
2.3 SYSTEM REQUIREMENTS

HARDWARE REQUIREMENTS

 System : Pentium IV 2.4 GHz.


 Hard Disk : 500 GB.
 Monitor : 15 VGA Colour.
 Mouse : Logitech.
 RAM : 4 GB.

SOFTWARE REQUIREMENTS

 Operating System : Windows-10/11 (64-bit).


 Language : Python 3.10
 IDE Tools : Visual Studio Code 1.7
CHAPTER- 3

SYSTEM IMPLEMENTATION

3.1 IMPLEMENTATION

Implementation is the stage of the project when the theoretical design is turned out
into a working system. Thus it can be considered to be the most critical stage in achieving a
successful new system and in giving the user, confidence that the new system will work and
be effective. The implementation stage involves careful planning, investigation of the
existing system and it’s constraints on implementation, designing of methods to achieve
changeover and evaluation of changeover methods.

3.2 MODULE

MODULES:

 Data Acquisition Module


 Data Filtering Module
 Event Detection Module
 Damage Assessment Module

MODULES DESCRIPTION:

DATA ACQUISITION MODULE:


The role of this module is very important because the system only operates on data
collected in this phase. Errors at this stage, especially regarding the loss of data, have to be
minimized since they will propagate throughout the system thus impairing the ability to
detect events. The data acquisition module must meet both data completeness and data
specificity requirements. This clearly represents a trade-o ff between the number of messages
gathered and their relevance to the earthquake detection and damage assessment tasks.
Although this module does not perform any analysis on collected data, it is possible to
overcome this trade-off by fine-tuning the keywords used to collect data. Among the methods
provided by Twitter for information extraction, the EARS system exploits the Streaming API
to open a persistent connection with a stream of tweets.
DATA FILTERING MODULE:
Using keywords to query Twitter makes it possible to gather messages potentially
related to an event. However, not all the messages gathered in this process relate to an on-
going earthquake. Some messages can be misleading for the event detection module and must
be filtered out as noise. By noise we refer to the messages containing the query key- words
but which are not related to the type of event to detect. In have identified two di fferent
sources of noise: (i) messages in which the keyword is used with a di fferent meaning from
the one related to the searched event and (ii) messages in which the keyword refers to a past
event. Excessive levels of noise in collected messages lead to false detections by the system.
However filtering too much may result in the loss of useful messages and thus in the
impossibility to detect important events.
EVENT DETECTION MODULE:

The detection of an event is triggered by an exceptional growth in the frequency of


the messages that have passed the filtering phase. The better the filtering phase the easier is
the task of event detection. Event detection in social media is a topic that has been widely
studied in literature. To accomplish these task researchers in exploit a temporal model based
on bayesian statistics, the use of peak detection algorithms is investigated. The work
discussed introduces the concept of Corrected Conditional Entropy (CCE) and shows how it
can be exploited to detect irregularity in time series. In our system we adopt a novel approach
based on a burst detection algorithm. A burst is defined as a large number of occurrences of a
phenomenon within a short time window. Burst detection techniques are commonly applied
to various fields such as the detection of topics in data streams. Our system triggers the
detection of a seismic event when it identifies a burst of messages referring to an earth-
quake.
DAMAGE ASSESSMENT MODULE:

Damage assessment (DA) is the process that allows emergency management


personnel to determine the impact and the consequences of an emergency on communities
and infrastructures. Typically, the DA process takes place in the aftermath of an emergency
and involves specialized personnel who assess the consequences by visiting the location of
the event. EARS exploits information shared by people directly involved in the event to
automatically perform this task without the need to transport personnel over the various
potentially damaged locations. Every new message collected after the detection of an
earthquake is associated to the event and contributes to the creation of a corpus of reports. As
the event unfolds, the system repeatedly analyzes the growing corpus of reports to extract
valuable information from it. Locations mentioned in the reports are most likely places struck
by the seismic event.
CHAPTER - 4
SOFTWARE DEVELOPMENT
4.1 SOFTWARE ENVIRONMENT

PYTHON:

Python is a very popular general-purpose interpreted, interactive, object-oriented, and


high-level programming language. Python is dynamically-typed and garbage-collected
programming language. It was created by Guido van Rossum during 1985- 1990. Like Perl,
Python source code is also available under the GNU General Public License (GPL). Python
supports multiple programming paradigms, including Procedural, Object Oriented and
Functional programming language. Python design philosophy emphasizes code readability
with the use of significant indentation.

WHY TO LEARN PYTHON?

Python is consistently rated as one of the world's most popular programming languages.
Python is fairly easy to learn, so if you are starting to learn any programming language then
Python could be your great choice. Today various Schools, Colleges and Universities are
teaching Python as their primary programming language. There are many other good reasons
which makes Python as the top choice of any programmer:

 Python is Open Source which means its available free of cost.


 Python is simple and so easy to learn
 Python is versatile and can be used to create many different things.
 Python has powerful development libraries include AI, ML etc.
 Python is much in demand and ensures high salary

Python is a MUST for students and working professionals to become a great Software
Engineer specially when they are working in Web Development Domain. I will list down
some of the key advantages of learning Python:

 Python is Interpreted − Python is processed at runtime by the interpreter. You do


not need to compile your program before executing it. This is similar to PERL and
PHP.
 Python is Interactive − You can actually sit at a Python prompt and interact with the
interpreter directly to write your programs.

 Python is Object-Oriented − Python supports Object-Oriented style or technique of


programming that encapsulates code within objects.

 Python is a Beginner's Language − Python is a great language for the beginner-level


programmers and supports the development of a wide range of applications from
simple text processing to WWW browsers to games.

CHARACTERISTICS OF PYTHON:

Following are important characteristics of Python Programming:-

 It supports functional and structured programming methods as well as OOP.


 It can be used as a scripting language or can be compiled to byte-code for building
large applications.
 It provides very high-level dynamic data types and supports dynamic type checking.
 It supports automatic garbage collection.
 It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.

APPLICATIONS OF PYTHON:

The latest release of Python is 3.x. As mentioned before, Python is one of the most widely
used language over the web. I'm going to list few of them here:

 Easy-to-learn − Python has few keywords, simple structure, and a clearly defined
syntax. This allows the student to pick up the language quickly.

 Easy-to-read − Python code is more clearly defined and visible to the eyes.

 Easy-to-maintain − Python's source code is fairly easy-to-maintain.

 A broad standard library − Python's bulk of the library is very portable and cross-
platform compatible on UNIX, Windows, and Macintosh.

 Interactive Mode − Python has support for an interactive mode which allows
interactive testing and debugging of snippets of code.
 Portable − Python can run on a wide variety of hardware platforms and has the same
interface on all platforms.

 Extendable − You can add low-level modules to the Python interpreter. These
modules enable programmers to add to or customize their tools to be more efficient.

 Databases − Python provides interfaces to all major commercial databases.

 GUI Programming − Python supports GUI applications that can be created and
ported to many system calls, libraries and windows systems, such as Windows MFC,
Macintosh, and the X Window system of Unix.

 Scalable − Python provides a better structure and support for large programs than
shell scripting.

PYTHON – OVERVIEW:

Python is a high-level, interpreted, interactive and object-oriented scripting language. Python


is designed to be highly readable. It uses English keywords frequently where as other
languages use punctuation, and it has fewer syntactical constructions than other languages.

 Python is Interpreted − Python is processed at runtime by the interpreter. You do


not need to compile your program before executing it. This is similar to PERL and
PHP.

 Python is Interactive − You can actually sit at a Python prompt and interact with the
interpreter directly to write your programs.

 Python is Object-Oriented − Python supports Object-Oriented style or technique of


programming that encapsulates code within objects.

 Python is a Beginner's Language − Python is a great language for the beginner-level


programmers and supports the development of a wide range of applications from
simple text processing to WWW browsers to games.

HISTORY OF PYTHON:

Python was developed by Guido van Rossum in the late eighties and early nineties at the
National Research Institute for Mathematics and Computer Science in the Netherlands.
Python is derived from many other languages, including ABC, Modula-3, C, C++, Algol-68,
SmallTalk, and Unix shell and other scripting languages.

Python is copyrighted. Like Perl, Python source code is now available under the GNU
General Public License (GPL).

PYTHON FEATURES:

Apart from the above-mentioned features, Python has a big list of good features, few are
listed below:

 It supports functional and structured programming methods as well as OOP.


 It can be used as a scripting language or can be compiled to byte-code for building
large applications.
 It provides very high-level dynamic data types and supports dynamic type checking.
 It supports automatic garbage collection.
 It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.

PYTHON - ENVIRONMENT SETUP:

As we learned in the previous Python Introduction article, python is a free, open-source, and
cross-platform language. So, the python can run on multiple OS platforms like Windows,
Linux, Mac, etc.

We will now learn how to install python or set up a Python development environment on
different OS platforms like Windows, Mac, and Linux machines.

DOWNLOAD AND INSTALL PYTHON:

Before you start python installation, first verify whether the python has already installed on
your machine or not. Nowadays, most of the devices are coming with preinstalled python.

To verify python installation, open the command prompt ([Link]) or Terminal and type the
command like python --version. If you found that python has not installed on your machine,
follow the below steps based on your OS version.

WINDOWS INSTALLATION:

Here are the steps to install Python on Windows machine.


 Open a Web browser and go to [Link]

 Follow the link for the Windows installer [Link] file where XYZ is the
version you need to install.

 To use this installer [Link], the Windows system must support Microsoft
Installer 2.0. Save the installer file to your local machine and then run it to find out if
your machine supports MSI.

 Run the downloaded file. This brings up the Python install wizard, which is really
easy to use. Just accept the default settings, wait until the install is finished, and you
are done.

SETTING UP PATH:

Programs and other executable files can be in many directories, so operating systems provide
a search path that lists the directories that the OS searches for executables.

The path is stored in an environment variable, which is a named string maintained by the
operating system. This variable contains information available to the command shell and
other programs.

The path variable is named as PATH in Unix or Path in Windows (Unix is case sensitive;
Windows is not).

To install Python on a Windows machine, visit download python Url to download and install
the latest python version. When you open the URL, it will automatically detect your OS and
display the download link as per your operating system like as shown below.
Fig.1 Python-Website

When you click on the Download Python 3.8.3 button, it will download the python-
[Link] file for a 32-bit version. If you want to download the 64-bit version, visit the python
for windows page and download the appropriate 64-bit installer.

Fig.2 Install Python

If you choose the Install Now option, it will install Python in the default installation folder
(C:\Users\{UserName}\AppData\Local\Programs\Python\Python38) with default settings. If
you want to customize the python installation folder location & features, you can choose
the Customize installation option. Select Add Python 3.8 to path option so that you can
execute the python from any path.

After completing the python installation, you will see the success message window like as
shown below, and click on the Close button to close the setup wizard.

Fig3. Complete Install

VERIFY THE INSTALLATION:

After completing python installation on your machine, you can verify it by opening the
command prompt and typing python --version command. If python is installed successfully, it
will display the version of python installed on your machine as shown below. To verify the
installation, you open the Run window and type cmd and press Enter:

Fig.4. Run CMD


In the Command Prompt, type python command as follows:

Fig.5. Command Prompt

SETTING PATH AT WINDOWS:

To add the Python directory to the path for a particular session in Windows

At the command prompt − type path %path%;C:\Python and press Enter.

Note − C:\Python is the path of the Python directory.

PYTHON ENVIRONMENT VARIABLES:

Here are important environment variables, which can be recognized by Python:

[Link]. Variable & Description

1 PYTHONPATH

It has a role similar to PATH. This variable tells the Python interpreter where to locate
the module files imported into a program. It should include the Python source library
directory and the directories containing Python source code. PYTHONPATH is
sometimes preset by the Python installer.
2 PYTHONSTARTUP

It contains the path of an initialization file containing Python source code. It is


executed every time you start the interpreter. It is named as .[Link] in Unix and it
contains commands that load utilities or modify PYTHONPATH.

3 PYTHONCASEOK

It is used in Windows to instruct Python to find the first case-insensitive match in an


import statement. Set this variable to any value to activate it.

4 PYTHONHOME

It is an alternative module search path. It is usually embedded in the


PYTHONSTARTUP or PYTHONPATH directories to make switching module
libraries easy.

INTEGRATED DEVELOPMENT ENVIRONMENT:

You can run Python from a Graphical User Interface (GUI) environment as well, if you have
a GUI application on your system that supports Python.

 Windows − PythonWin is the first Windows interface for Python and is an IDE with
a GUI.

If you are not able to set up the environment properly, then you can take help from your
system admin. Make sure the Python environment is properly set up and working perfectly
fine.

PYTHON - BASIC SYNTAX:

The Python syntax defines a set of rules that are used to create Python statements while
writing a Python Program. The Python Programming Language Syntax has many similarities
to Perl, C, and Java Programming Languages. However, there are some definite differences
between the languages.

FIRST PYTHON PROGRAM:


Let us execute a Python "Hello, World!" Programs in different modes of programming.
Python - Interactive Mode Programming
Python interpreter from command line by typing python at the command prompt as
following-

>>> print ("Hello, World!")

If you are running older version of Python, like Python 2.4.x, then you would need to use
print statement without parenthesis as in print "Hello, World!". However in Python version
3.x, this produces the following result.

Hello, World!
SETUP VISUAL STUDIO CODE FOR PYTHON:

Visual Studio Code is a lightweight source code editor. The Visual Studio Code is
often called VS Code. The VS Code runs on your desktop. It’s available for Windows,
macOS, and Linux. VS Code comes with many features such as IntelliSense, code editing,
and extensions that allow you to edit Python source code effectively. The best part is that the
VS Code is open-source and free. Be sides the desktop version, VS Code also has a browser
version that you can use directly in your web browser without installing it.

SETTING UP VISUAL STUDIO CODE:

To set up the VS Code, you follow these steps:


 First, navigate to the VS Code official website and download the VS code based on
your platform (Windows, macOS, or Linux).
 Second, launch the setup wizard and follow the steps.
Once the installation completes, you can launch the VS code application:
Fig.6. Visual Studio Code

Visual Studio Code is a lightweight but powerful source code editor which runs on your
desktop and is available for Windows, macOS and Linux. It comes with built-in support for
JavaScript, TypeScript and [Link] and has a rich ecosystem of extensions for other
languages and runtimes (such as C++, C#, Java, Python, PHP, Go, .NET). Begin your
journey with VS Code with these introductory videos.

EXTENSIONS:

VS Code extensions let third parties add support for additional:


 Languages - C++, C#, Go, Java, Python
 Tools - ESLint, JSHint , PowerShell
 Debuggers - PHP XDebug.
 Keymaps - Vim, Sublime Text, IntelliJ, Emacs, Atom, Brackets, Visual
Studio, Eclipse

INSTALL PYTHON EXTENSION:

To make the VS Code works with Python, you need to install the Python extension from the
Visual Studio Marketplace.
The following picture illustrates the steps:

Fig.7. Visual Studio Code to Python Extension

 First, click the Extensions tab and second, type the python keyword on the search
input.
 Third, click the Python extension. It’ll show detailed information on the right pane.
 Finally, click the Install button to install the Python extension.
INTRODUCTION TO TKINTER:

Graphical User Interface (GUI) is a form of user interface which allows users to interact
with computers through visual indicators using items such as icons, menus, windows, etc. It
has advantages over the Command Line Interface (CLI) where users interact with computers
by writing commands using keyboard only and whose usage is more difficult than GUI.

Modern computer applications are user-friendly. User interaction is not restricted to console-
based I/O. They have a more ergonomic graphical user interface (GUI) thanks to high speed
processors and powerful graphics hardware. These applications can receive inputs through
mouse clicks and can enable the user to choose from alternatives with the help of radio
buttons, dropdown lists, and other GUI elements (or widgets).

Such applications are developed using one of various graphics libraries available. A graphics
library is a software toolkit having a collection of classes that define a functionality of
various GUI elements. These graphics libraries are generally written in C/C++. Many of them
have been ported to Python in the form of importable modules.
What is Tkinter?

Tkinter is the inbuilt python module that is used to create GUI applications. It is one of the
most commonly used modules for creating GUI applications in Python as it is simple and
easy to work with. You don’t need to worry about the installation of the Tkinter module
separately as it comes with Python already. It gives an object-oriented interface to the Tk GUI
toolkit.
Some other Python Libraries available for creating our own GUI applications are,

 Kivy
 Python Qt
 wxPython

Among all Tkinter is most widely used


Here are some common use cases for Tkinter:
1. Creating windows and dialog boxes: Tkinter can be used to create windows and dialog
boxes that allow users to interact with your program. These can be used to display
information, gather input, or present options to the user.
2. Building a GUI for a desktop application: Tkinter can be used to create the interface for
a desktop application, including buttons, menus, and other interactive elements.
3. Adding a GUI to a command-line program: Tkinter can be used to add a GUI to a
command-line program, making it easier for users to interact with the program and
input arguments.
4. Creating custom widgets: Tkinter includes a variety of built-in widgets, such as buttons,
labels, and text boxes, but it also allows you to create your own custom widgets.
5. Prototyping a GUI: Tkinter can be used to quickly prototype a GUI, allowing you to test
and iterate on different design ideas before committing to a final implementation.

What are Widgets?

Widgets in Tkinter are the elements of GUI application which provides various controls
(such as Labels, Buttons, ComboBoxes, CheckBoxes, MenuBars, RadioButtons and many
more) to users to interact with the application.
Fig.8. Fundamental structure of tkinter program

BASIC TKINTER WIDGETS:

SNo. Operator & Description

1 Button
The Button widget is used to display buttons in your application.

2 Canvas
The Canvas widget is used to draw shapes, such as lines, ovals, polygons and rectangles,
in your application.

3 Checkbutton
The Checkbutton widget is used to display a number of options as checkboxes. The user
can select multiple options at a time.

4 Entry
The Entry widget is used to display a single-line text field for accepting values from a
user.

5 Frame
The Frame widget is used as a container widget to organize other widgets.
6 Label
The Label widget is used to provide a single-line caption for other widgets. It can also
contain images.

7 Listbox
The Listbox widget is used to provide a list of options to a user.

8 Menubutton
The Menubutton widget is used to display menus in your application.

9 Menu
The Menu widget is used to provide various commands to a user. These commands are
contained inside Menubutton.

10 Message
The Message widget is used to display multiline text fields for accepting values from a
user.

11 Radiobutton
The Radiobutton widget is used to display a number of options as radio buttons. The user
can select only one option at a time.

12 Scale
The Scale widget is used to provide a slider widget.

13 Scrollbar
The Scrollbar widget is used to add scrolling capability to various widgets, such as list
boxes.

14 Text
The Text widget is used to display text in multiple lines.

15 Toplevel
The Toplevel widget is used to provide a separate window container.

16 Spinbox
The Spinbox widget is a variant of the standard Tkinter Entry widget, which can be used
to select from a fixed number of values.

17 PanedWindow
A PanedWindow is a container widget that may contain any number of panes, arranged
horizontally or vertically.

18 LabelFrame
A labelframe is a simple container widget. Its primary purpose is to act as a spacer or
container for complex window layouts.

Tkinter PROGRAMMING:
Tkinter is the standard GUI library for Python. Python when combined with Tkinter
provides a fast and easy way to create GUI applications. Tkinter provides a powerful
object-oriented interface to the Tk GUI toolkit.
Creating a GUI application using Tkinter is an easy task. All you need to do is perform the
following steps-
 Import the Tkinter module.
 Create the GUI application main window.
 Add one or more of the above-mentioned widgets to the GUI application.
 Enter the main event loop to take action against each event triggered by the user.
EXAMPLE:
import Tkinter
top = [Link]()
# Code to add widgets will go here...
[Link]()
This would create a following window-
Fig.9 Simple Tkinter Windows

STANDARD ATTRIBUTES:
Let us take a look at how some of their common [Link] as sizes, colors and fonts
are specified.
 Dimensions
 Colors
 Fonts
 Anchors
 Relief styles
 Bitmaps
 Cursors
GEOMETRY MANAGEMENT:
All Tkinter widgets have access to specific geometry management methods, which have the
purpose of organizing widgets throughout the parent widget area. Tkinter exposes the
following geometry manager classes: pack, grid, and place.
 The pack() Method − This geometry manager organizes widgets in blocks before
placing them in the parent widget.
 The grid() Method − This geometry manager organizes widgets in a table-like
structure in the parent widget.
 The place() Method − This geometry manager organizes widgets by placing them
in a specific position in the parent widget.
Python - place() method in Tkinter:
The Place geometry manager is the simplest of the three general geometry managers
provided in Tkinter. It allows you explicitly set the position and size of a window, either in
absolute terms, or relative to another window. You can access the place manager through
the place() method which is available for all standard widgets. It is usually not a good idea
to use place() for ordinary window and dialog layouts; its simply too much work to get
things working as they should. Use the pack() or grid() managers for such purposes.

Syntax:
[Link](relx = 0.5, rely = 0.5, anchor = CENTER)
Python - grid() method in Tkinter:
The Grid geometry manager puts the widgets in a 2-dimensional table. The master widget is
split into a number of rows and columns, and each “cell” in the resulting table can hold a
widget. The grid manager is the most flexible of the geometry managers in Tkinter. If you
don’t want to learn how and when to use all three managers, you should at least make sure
to learn this one. Consider the following example-

Creating this layout using the pack manager is possible, but it takes a number of extra
frame widgets, and a lot of work to make things look good. If you use the grid manager
instead, you only need one call per widget to get everything laid out properly. Using
the grid manager is easy. Just create the widgets, and use the grid method to tell the
manager in which row and column to place them. You don’t have to specify the size of the
grid beforehand; the manager automatically determines that from the widgets in it.

Python-pack() method in Tkinter:

The Pack geometry manager packs widgets relative to the earlier widget. Tkinter literally
packs the entire widgets one after the other in a window. We can use options
like fill, expand, and side to control this geometry manager.

Compared to the grid manager, the pack manager is somewhat limited, but it’s much easier
to use in a few, but quite common situations:
 Put a widget inside a frame (or any other container widget), and have it fill the
entire frame
 Place a number of widgets on top of each other
 Place a number of widgets side by side
Python - Binding function in Tkinter:
Tkinter is a GUI (Graphical User Interface) module that is widely used in desktop
applications. It comes along with the Python, but you can also install it externally with the
help of pip command.
It provides a variety of Widget classes and functions with the help of which one can make
our GUI more attractive and user-friendly in terms of both looks and functionality.
The binding function is used to deal with the events. We can bind Python’s Functions and
methods to an event as well as we can bind these functions to any particular widget.
What is bind?
The basic definition of the word bind is stick together or cause to stick together in a single
mass. Similarly, Tkinter bind is used to connect an event passed in the widget along with
the event handler. The event handler is the function that gets invoked when the events take
place.
[Link](sequence=None, func=None, add=None)
The sequence the argument describes what event we expect, and the func argument is a
function to be called when that event happens to the widget. If there was already a binding
for that event for this widget, normally the old callback is replaced with func, but you can
preserve both callbacks by passing add='+'.
The events can be bonded to an event handler using the bind function at different levels.
1. Instance-level binding
One can bind an event to one specific widget. To bind an event of a widget, call
the .bind() method on that widget.
[Link](event, event handler)
 Event – occurrence caused by the user that might reflect changes.
 Event Handler – function in your application that gets invoked when the event
takes place.
 Bind – configuring an event handler (python function) that is called when an event
occurs to a widget.
2. Class-level binding
One can bind an event to all widgets of a class. For example, you might set up
all Button widgets to respond to middle mouse button clicks by changing back and forth
between English and Japanese labels. To bind an event to all widgets of a class, call
the .bind_class() method on any widget.
The “class” mentioned in bind_class refers to the internal class name used by the tk library,
not the python class name. bind_class is a method available to all widgets and simply calls
the Tk bind command again, however not with the instance name, but the widget class
name.
w.bind_class(className, sequence=None, func=None, add=None)
The basic working of .bind_class is the same as the .bind function.
3. Application-level binding
One can set up a binding so that a certain event calls a handler no matter what widget has
the focus or is under the mouse.
w.bind_all(sequence=None, func=None, add=None)
Like .bind(), but applies to all widgets in the entire application.
CHAPTER - 5
SYSTEM DESIGN
5.1 SYSTEM ARCHITECTURE
Load Damage
Data Filtering
Assessment

Data Acquisition
Machine Learning
Methods

View Real
Time Events View Earthquake
Report Prediction

View Need for


Supplied
5.2 DATA FLOW DIAGRAM:

1. The DFD is also called as bubble chart. It is a simple graphical formalism that can be
used to represent a system in terms of input data to the system, various processing
carried out on this data, and the output data is generated by this system.
2. The data flow diagram (DFD) is one of the most important modeling tools. It is used
to model the system components. These components are the system process, the data
used by the process, an external entity that interacts with the system and the
information flows in the system.
3. DFD shows how the information moves through the system and how it is modified by
a series of transformations. It is a graphical technique that depicts information flow
and the transformations that are applied as data moves from input to output.
4. DFD is also known as bubble chart. A DFD may be used to represent a system at any
level of abstraction. DFD may be partitioned into levels that represent increasing
information flow and functional detail.
Start

GUI System Access Add Disaster Report

Add General Report

Make Report Apply - Need Supplies

Earthquake Report

View System Data


Supply Request

Machine Learning
Methods

View Real Time


Data

Stop
USE CASE DIAGRAM:

A use case diagram in the Unified Modeling Language (UML) is a type of behavioral
diagram defined by and created from a Use-case analysis. Its purpose is to present a graphical
overview of the functionality provided by a system in terms of actors, their goals (represented
as use cases), and any dependencies between those use cases. The main purpose of a use case
diagram is to show what system functions are performed for which actor. Roles of the actors
in the system can be depicted.

Disaster
Make

Add Disaster
Report

View
System Data

Earthquake
Report
System
Machine
Learning

View Real Time


Data
ACTIVITY DIAGRAM:

Activity diagrams are graphical representations of workflows of stepwise activities


and actions with support for choice, iteration and concurrency. In the Unified Modeling
Language, activity diagrams can be used to describe the business and operational step-by-step
workflows of components in a system. An activity diagram shows the overall flow of control.
Start

Input Disaster
Data

No
Invalid Data

Yes

Feature
Extraction

No
Invalid Analysis

Yes

Big Data - ML

No
Invalid Model

Yes

View Real Time


Disaster
5.3 DATASET DESIGN

Disaster Dataset:

Supplies Dataset:
CHAPTER - 6

SYSTEM DEVELOPMENT

6.1 INPUT AND OUTPUT DESIGN

INPUT DESIGN

The input design is the link between the information system and the user. It comprises
the developing specification and procedures for data preparation and those steps are
necessary to put transaction data in to a usable form for processing can be achieved by
inspecting the computer to read data from a written or printed document or it can occur by
having people keying the data directly into the system. The design of input focuses on
controlling the amount of input required, controlling the errors, avoiding delay, avoiding
extra steps and keeping the process simple. The input is designed in such a way so that it
provides security and ease of use with retaining the privacy. Input Design considered the
following things:

 What data should be given as input?


 How the data should be arranged or coded?
 The dialog to guide the operating personnel in providing input.

OBJECTIVES

1. Input Design is the process of converting a user-oriented description of the input into a
computer-based system. This design is important to avoid errors in the data input process and
show the correct direction to the management for getting correct information from the
computerized system.

2. It is achieved by creating user-friendly screens for the data entry to handle large volume of
data. The goal of designing input is to make data entry easier and to be free from errors. The
data entry screen is designed in such a way that all the data manipulates can be performed. It
also provides record viewing facilities.

3. When the data is entered it will check for its validity. Data can be entered with the help of
screens. Appropriate messages are provided as when needed so that the user will not be in
maize of instant. Thus the objective of input design is to create an input layout that is easy to
follow.
OUTPUT DESIGN

A quality output is one, which meets the requirements of the end user and presents the
information clearly. In any system results of processing are communicated to the users and to
other system through outputs. In output design it is determined how the information is to be
displaced for immediate need and also the hard copy output. It is the most important and
direct source information to the user. Efficient and intelligent output design improves the
system’s relationship to help user decision-making.

1. Designing computer output should proceed in an organized, well thought out manner; the
right output must be developed while ensuring that each output element is designed so that
people will find the system can use easily and effectively. When analysis design computer
output, they should Identify the specific output that is needed to meet the requirements.

2. Select methods for presenting information.

3. Create document, report, or other formats that contain information produced by the system.

The output form of an information system should accomplish one or more of the following
objectives.

 Convey information about past activities, current status or projections of the Future.
 Signal important events, opportunities, problems, or warnings.
 Trigger an action.
 Confirm an action.
6.2 SYSTEM STUDY

FEASIBILITY STUDY:-

The feasibility of the project is analyzed in this phase and business proposal is put
forth with a very general plan for the project and some cost estimates. During system analysis
the feasibility study of the proposed system is to be carried out. This is to ensure that the
proposed system is not a burden to the company. For feasibility analysis, some
understanding of the major requirements for the system is essential. Three key considerations
involved in the feasibility analysis are
 Economical Feasibility
 Technical Feasibility
 Social Feasibility
ECONOMICAL FEASIBILITY:-

This study is carried out to check the economic impact that the system will have on
the organization. The amount of fund that the company can pour into the research and
development of the system is limited. The expenditures must be justified. Thus the developed
system as well within the budget and this was achieved because most of the technologies
used are freely available. Only the customized products had to be purchased.

TECHNICAL FEASIBILITY:-

This study is carried out to check the technical feasibility, that is, the technical
requirements of the system. Any system developed must not have a high demand on the
available technical resources. This will lead to high demands on the available technical
resources. This will lead to high demands being placed on the client. The developed system
must have a modest requirement, as only minimal or null changes are required for
implementing this system.
SOCIAL FEASIBILITY:-

The aspect of study is to check the level of acceptance of the system by the user. This
includes the process of training the user to use the system efficiently. The user must not feel
threatened by the system, instead must accept it as a necessity. The level of acceptance by the
users solely depends on the methods that are employed to educate the user about the system
and to make him familiar with it. His level of confidence must be raised so that he is also able
to make some constructive criticism, which is welcomed, as he is the final user of the system.
6.3 SYSTEM TESTING

The purpose of testing is to discover errors. Testing is the process of trying to discover
every conceivable fault or weakness in a work product. It provides a way to check the
functionality of components, sub assemblies, assemblies and/or a finished product it is the
process of exercising software with the intent of ensuring that the Software system meets its
requirements and user expectations and does not fail in an unacceptable manner. There are
various types of test. Each test type addresses a specific testing requirement.

TYPES OF TESTS:-

UNIT TESTING:-

Unit testing involves the design of test cases that validate that the internal program logic is
functioning properly, and that program inputs produce valid outputs. All decision branches and
internal code flow should be validated. It is the testing of individual software units of the
application .it is done after the completion of an individual unit before integration. This is a
structural testing, that relies on knowledge of its construction and is invasive. Unit tests perform
basic tests at component level and test a specific business process, application, and/or system
configuration. Unit tests ensure that each unique path of a business process performs accurately
to the documented specifications and contains clearly defined inputs and expected results.

INTEGRATION TESTING:-

Integration tests are designed to test integrated software components to determine if they
actually run as one program. Testing is event driven and is more concerned with the basic
outcome of screens or fields. Integration tests demonstrate that although the components were
individually satisfaction, as shown by successfully unit testing, the combination of components
is correct and consistent. Integration testing is specifically aimed at exposing the problems that
arise from the combination of components.

FUNCTIONAL TEST:-
Functional tests provide systematic demonstrations that functions tested are available as
specified by the business and technical requirements, system documentation, and user manuals.
Functional testing is centered on the following items:

Valid Input : identified classes of valid input must be accepted.


Invalid Input : identified classes of invalid input must be rejected.
Functions : identified functions must be exercised.
Output : identified classes of application outputs must be exercised.
Systems/Procedures : interfacing systems or procedures must be invoked.

Organization and preparation of functional tests is focused on requirements, key


functions, or special test cases. In addition, systematic coverage pertaining to identify Business
process flows; data fields, predefined processes, and successive processes must be considered for
testing. Before functional testing is complete, additional tests are identified and the effective
value of current tests is determined.

SYSTEM TEST

System testing ensures that the entire integrated software system meets requirements. It
tests a configuration to ensure known and predictable results. An example of system testing is the
configuration oriented system integration test. System testing is based on process descriptions
and flows, emphasizing pre-driven process links and integration points.

WHITE BOX TESTING

White Box Testing is a testing in which in which the software tester has knowledge of the
inner workings, structure and language of the software, or at least its purpose. It is purpose. It is
used to test areas that cannot be reached from a black box level.

BLACK BOX TESTING

Black Box Testing is testing the software without any knowledge of the inner workings,
structure or language of the module being tested. Black box tests, as most other kinds of tests,
must be written from a definitive source document, such as specification or requirements
document, such as specification or requirements document. It is a testing in which the software
under test is treated, as a black box .you cannot “see” into it. The test provides inputs and
responds to outputs without considering how the software works.

Unit Testing:
Unit testing is usually conducted as part of a combined code and unit test phase of the
software lifecycle, although it is not uncommon for coding and unit testing to be conducted as
two distinct phases.
Test Strategy and Approach
Field testing will be performed manually and functional tests will be written in detail.

Test objectives
 All field entries must work properly.
 Pages must be activated from the identified link.
 The entry screen, messages and responses must not be delayed.

Features to be tested
 Verify that the entries are of the correct format
 No duplicate entries should be allowed
 All links should take the user to the correct page.

Integration Testing:
Software integration testing is the incremental integration testing of two or more
integrated software components on a single platform to produce failures caused by interface
defects. The task of the integration test is to check that components or software applications, e.g.
components in a software system or - one step up - software applications at the company level -
interact without error.

Test Results: All the test cases mentioned above passed successfully. No defects encountered.

Acceptance Testing:
User Acceptance Testing is a critical phase of any project and requires significant
participation by the end user. It also ensures that the system meets the functional requirements.

Test Results: All the test cases mentioned above passed successfully. No defects encountered.
CHAPTER - 7

APPENDICES

7.1 SCREENSHOT

Run: python [Link]

Home Window:
Add Report:

Add Disaster Report:


After View Code Check:

Apply on Need for Supplies:


View System Information:

View Earthquake Report:


View Need for Supply Report:

View Real time Data:


View Result Prediction:
7.2 SOURCE CODE

[Link]:

import pandas as pd
import csv
import random
import [Link] as plt
from [Link].backend_tkagg import FigureCanvasTkAgg
import requests
import tkinter as tk
from tkinter import ttk
from PIL import Image, ImageTk
from io import BytesIO
from datetime import datetime
from sys import exit

def main_menu():
window = [Link]() #create a window
[Link]("-fullscreen", True)
[Link]("NATURAL DISASTER APPLICATION")

title_label = [Link](window, text="NATURAL DISASTER APPLICATION",


font=("Courier", 35, "bold"),bg="light gray",fg="black") #attributes of the opened window
title_label.pack(pady=200) #show the created label on window, attribute "pady" leaves
some space between elements

options_frame = [Link](window) # create a frame for options,just like div in CSS


options_frame.place(relx=0.5, rely=0.5, anchor=[Link]) #center the frame

admin_btn = [Link](options_frame, text="View System Data", command=admin_menu,


width=30, height=2, bg="light yellow")
admin_btn.pack(pady=5)

report_btn = [Link](options_frame, text="Make a Report", command=user_menu,


width=30, height=2, bg="light yellow")
report_btn.pack(pady=5)

view_btn = [Link](options_frame, text="View Recent Earthquakes",


command=recent_earthquakes, width=30, height=2, bg="light yellow")
view_btn.pack(pady=5)

button = [Link](options_frame, text="Exit", command=exit, width=20,


height=2,bg="red")
[Link](pady=5)

[Link]() #run the window

#User Menu Functions


def user_menu():
window = [Link]()
[Link]("-fullscreen", True)
[Link]("User Menu")

title_label = [Link](window, text="---Make a Report---", font=("Arial", 25,


"bold"),bg="light gray",fg="black")
title_label.pack(pady=200)

options_frame = [Link](window)
options_frame.place(relx=0.5, rely=0.5, anchor=[Link])

button1 = [Link](options_frame, text="Add Disaster Report", command=under_rubble,


width=30, height=2,bg="light blue")
[Link](pady=5)

button2 = [Link](options_frame, text="Add General Report",


command=reporting_debris, width=30, height=2,bg="light blue")
[Link](pady=5)

button3 = [Link](options_frame, text="Apply for Need Supplies", command=supplies,


width=30, height=2,bg="light blue")
[Link](pady=5)

button4 = [Link](options_frame, text="Return Main Menu", command=main_menu,


width=20, height=2,bg="crimson")
[Link](pady=5)

[Link]()

list_of_codes=[]
def under_rubble():
def submit_report():
global health_condition
province = (province_entry.get()).capitalize() #get the entries and assign them to a
variable(see line 102 for where we get the entry)
district = (district_entry.get()).capitalize()
street_name = (street_entry.get()).capitalize()
apartment_name = (apartment_entry.get()).capitalize()
health_condition = health_condition_combo.get()
code = code_entry.get()

list_of_codes.append([province, district, street_name, apartment_name,code])

if not (province and district and street_name and apartment_name and health_condition
and code):
result_label.config(text="Please fill in all fields.", fg="red")

elif len(code)!=4:
result_label.config(text="Verification code must be 4 digits long.", fg="red")
else:
if (apartment_name in pd.read_csv("[Link]")["APARTMENT
NAME"].tolist()) and (province in pd.read_csv("[Link]")["PROVINCE"].tolist())
and (district in pd.read_csv("[Link]")["DISTRICT"].tolist()) and (street_name in
pd.read_csv("[Link]")["STREET NAME"].tolist()):
result_label.config(text="A report has already been made for this apartment.",
fg="red")
else:
report = [province, district, street_name, apartment_name, health_condition,"NO
HELP YET"]
with open("[Link]", "a", newline='', encoding='utf-8') as ea:
writer = [Link](ea)
[Link](report)

result_label.config(text="REPORT SUBMITTED\n\n YOU MUST GIVE THE


CODE "+ code + " TO THE RESCUERS", fg="green") # display text on window,result_label
is initialized as an empty text in line 141

window = [Link]()
[Link]("-fullscreen", True)
[Link]("I am trapped under rubble")

province_label = [Link](window, text="Province:", font=("Arial", 12))


province_label.pack(pady=10)

province_entry = [Link](window, width=30) # .Entry command has the same logic as


input()
province_entry.pack()

district_label = [Link](window, text="District:", font=("Arial", 12))


district_label.pack(pady=10)

district_entry = [Link](window, width=30)


district_entry.pack()

street_label = [Link](window, text="Street Name:", font=("Arial", 12))


street_label.pack(pady=10)

street_entry = [Link](window, width=30)


street_entry.pack()

apartment_label = [Link](window, text="Apartment Name:", font=("Arial", 12))


apartment_label.pack(pady=10)

apartment_entry = [Link](window, width=30)


apartment_entry.pack()

health_condition_label = [Link](window, text="Health Condition:", font=("Arial", 12))


health_condition_label.pack(pady=10)

health_condition_combo = [Link](window, values=["Heavily Injured", "Injured",


"No Injuries"], width=30) #.Combobox enables you to make options to your input
health_condition_combo.pack()

code_label = [Link](window, text="Set a 4 digit code for help-arrived verification later:",


font=("Arial", 12))
code_label.pack(pady=10)

code_entry = [Link](window, width=30)


code_entry.pack()

submit_button = [Link](window, text="Submit", command=submit_report,


width=15,bg="green")
submit_button.pack(pady=20)

button1 = [Link](window, text="Return Upper Menu", command=user_menu,


width=30, height=2,bg="crimson")
[Link](pady=5)

result_label = [Link](window, text="", font=("Arial", 12))


result_label.pack()

[Link]()

def reporting_debris():
def submit_rprt():
province = (province_entry.get()).capitalize()
district = (district_entry.get()).capitalize()
street_name = (street_entry.get()).capitalize()
apartment_name = (apartment_entry.get()).capitalize()
code = code_entry.get()

list_of_codes.append([province, district, street_name, apartment_name,code])

if not (province and district and street_name and apartment_name and code):
result_label.config(text="Please fill in all fields.", fg="red")
elif len(code)!=4:
result_label.config(text="Verification code must be 4 digits long.", fg="red")
else:

if (apartment_name in pd.read_csv("[Link]")["APARTMENT
NAME"].tolist()) and (province in pd.read_csv("[Link]")["PROVINCE"].tolist())
and (district in pd.read_csv("[Link]")["DISTRICT"].tolist()) and (street_name in
pd.read_csv("[Link]")["STREET NAME"].tolist()):
result_label.config(text="A report has already been made for this apartment.",
fg="red")
else:
report = [province, district, street_name, apartment_name] + ["Not Under Rubble"]
+ ["NO HELP YET"]
with open("[Link]", "a", newline='', encoding='utf-8') as ea:
writer = [Link](ea)
[Link](report)

result_label.config(text="REPORT SUBMITTED\n\n YOU MUST GIVE THE


CODE "+ code + " TO THE RESCUERS", fg="green")

window = [Link]()
[Link]("-fullscreen", True)
[Link]("Report A Debris")

province_label = [Link](window, text="Province:", font=("Arial", 12))


province_label.pack(pady=10)

province_entry = [Link](window, width=30)


province_entry.pack()

district_label = [Link](window, text="District:", font=("Arial", 12))


district_label.pack(pady=10)
district_entry = [Link](window, width=30)
district_entry.pack()

street_label = [Link](window, text="Street Name:", font=("Arial", 12))


street_label.pack(pady=10)

street_entry = [Link](window, width=30)


street_entry.pack()

apartment_label = [Link](window, text="Apartment Name:", font=("Arial", 12))


apartment_label.pack(pady=10)

apartment_entry = [Link](window, width=30)


apartment_entry.pack()

code_label = [Link](window, text="Set a 4 digit code for help-arrived verification later:",


font=("Arial", 12))
code_label.pack(pady=10)

code_entry = [Link](window, width=30)


code_entry.pack()

submit_button = [Link](window, text="Submit", command=submit_rprt,


width=15,bg="green")
submit_button.pack(pady=20)

button1 = [Link](window, text="Return Upper Menu", command=user_menu,


width=30, height=2, bg="red")
[Link](pady=5)

result_label = [Link](window, text="", font=("Arial", 12))


result_label.pack()

[Link]()

def supplies():
supplies_list = []

def add_supply():
supply = (supply_entry.get()).capitalize()
if supply:
supplies_list.append(supply)
supply_entry.delete(0, [Link]) #delete the previous text from index 0 to [Link] for
adding more supplies
def submit_supply():
province = (province_entry.get()).capitalize()
district = (district_entry.get()).capitalize()

for supply in supplies_list:


supply_report = [province, district, supply]
with open("[Link]", "a", newline='', encoding='utf-8') as s:
writer = [Link](s)
[Link](supply_report)

result_label.config(text="REPORT SUBMITTED")

window = [Link]()
[Link]("-fullscreen", True)
[Link]("Supply Request")

province_label = [Link](window, text="Province:", font=("Arial", 12))


province_label.pack(pady=10)

province_entry = [Link](window, width=30)


province_entry.pack()

district_label = [Link](window, text="District:", font=("Arial", 12))


district_label.pack(pady=10)

district_entry = [Link](window, width=30)


district_entry.pack()

supply_label = [Link](window, text="Supply:", font=("Arial", 12))


supply_label.pack(pady=10)

supply_entry = [Link](window, width=30)


supply_entry.pack()

add_button = [Link](window, text="Add More Supply +1", command=add_supply,


width=17)
add_button.pack(pady=5)

submit_button = [Link](window, text="Submit", command=submit_supply,


width=15,bg="green")
submit_button.pack(pady=20)
button1 = [Link](window, text="Return Upper Menu", command=user_menu,
width=30, height=2,bg="crimson")
[Link](pady=5)

result_label = [Link](window, text="", font=("Arial", 12))


result_label.pack()

[Link]()

#Admin Menu Functions


def admin_menu():
window = [Link]()
[Link]("-fullscreen", True)
[Link]("Admin Menu")

title_label = [Link](window, text="---View System Data---", font=("Arial", 25,


"bold"),bg="light gray",fg="black")
title_label.pack(pady=200)

options_frame = [Link](window)
options_frame.place(relx=0.5, rely=0.5, anchor="center")

button1 = [Link](options_frame, text="View Earthquake Reports",


command=show_report_table, width=35, height=2,bg="light blue")
[Link](pady=5)

button2 = [Link](options_frame, text="View Supply Requests",


command=show_supply_table, width=35, height=2,bg="light blue")
[Link](pady=5)

#button3 = [Link](options_frame, text="View General Data Reports", command=report,


width=35, height=2,bg="light blue")
#[Link](pady=5)

button4 = [Link](options_frame, text="Return To Main Menu", command=main_menu,


width=25, height=2,bg="crimson")
[Link](pady=5)

[Link]()

def report():
def show_most_requested_supplies():
supply_dict = {}
for supply in pd.read_csv("[Link]")["NEEDED SUPPLY"]:
supply_dict[supply] = supply_dict.get(supply, 0) + 1 #supply_dict.get(supply, 0) if
supply key does not exist, assign 0

#matplotlib functions above


[Link]()
[Link](list(supply_dict.keys()), list(supply_dict.values()))
[Link]("Most Requested Supplies")
[Link]("COUNT")
[Link]("SUPPLY NAME")
[Link]()

def show_report_distribution_by_city():
province_dict = {}
for province in pd.read_csv("[Link]")["PROVINCE"]:
province_dict[province] = province_dict.get(province, 0) + 1

#matplotlib functions above


[Link]()
[Link](province_dict.values(), labels=province_dict.keys(), autopct="%1.1f%%")
#autopct shows the percentage of each province, 1.1f means 1 digit before and after the
decimal point,%% means show the percentage sign
[Link]("Report Distribution By City")
[Link]()

window = [Link]()
[Link]("-fullscreen", True)
[Link]("Report Menu")

label = [Link](window, text="Select a Report Option:", font=("Arial", 20,


"bold"),bg="light gray",fg="black")
[Link](pady=10)

button_frame = [Link](window)
button_frame.pack()

button1 = [Link](button_frame, text="View Most Requested Supplies",


command=show_most_requested_supplies, width=30, height=2, bg="blue", fg="white")
[Link](side=[Link], padx=5) #side=[Link] means the button will be placed on
the left side of the frame

button2 = [Link](button_frame, text="View Report Distribution By City",


command=show_report_distribution_by_city, width=30, height=2, bg="green", fg="white")
[Link](side=[Link], padx=5)
#showing matplotlib graphs on tkinter
fig = [Link](figsize=(10, 6))
canvas = FigureCanvasTkAgg(fig, master=window)
canvas.get_tk_widget().pack()

return_button = [Link](window, text="Return to Upper Menu",


command=admin_menu, width=30, height=2, bg="crimson")
return_button.pack(pady=10)

[Link]()

def show_report_table():
#it is better to print and see how these look like, so you can understand the code better
dict_of_file = pd.read_csv("[Link]").to_dict("list")
list_of_status = dict_of_file["REPORT STATUS"]

for i in range(len(list_of_status)):
if list_of_status[i] != "HELP ARRIVED" :

if dict_of_file["HEALTH CONDITION"][i] == "Injured":


list_of_status[i] = [Link](["HELP ARRIVED","HELP ARRIVED","NO
HELP YET","NO HELP YET" ,"NO HELP YET"])

if dict_of_file["HEALTH CONDITION"][i] == "Heavily Injured":


list_of_status[i] = [Link](["HELP ARRIVED","HELP ARRIVED","HELP
ARRIVED","NO HELP YET","NO HELP YET"])

else:
list_of_status[i] = [Link](["HELP ARRIVED","NO HELP YET","NO
HELP YET","NO HELP YET","NO HELP YET"]) # increasing the probability of "No Help
Yet" to make the program more realistic

dict_of_file["REPORT STATUS"] = list_of_status


[Link].from_dict(dict_of_file).to_csv("[Link]", index=False) #saving
the changes to the csv file

def help_code():
global help_code_window

selected_item = [Link]() #selected item in the treeview


if selected_item:
help_code_window = [Link]()
help_code_window.eval('tk::PlaceWindow . center')
help_code_window.title("Help Code")
help_code_window.geometry("300x300")

help_code_label = [Link](help_code_window, text="Enter The Report Code To\


nVerify Help Arrival", font=("Arial", 12))
help_code_label.pack(pady=10)

help_code_entry = [Link](help_code_window, font=("Arial", 12),show="*")


help_code_entry.pack(pady=10)

submit_button = [Link](help_code_window, text="Submit", command=lambda:


submit_help_code(help_code_entry.get(),result_label), font=("Arial", 12)) #lambda is used to
pass arguments to the function
submit_button.pack(pady=10)

result_label=[Link](help_code_window,text="",font=("Arial",12))
result_label.pack(pady=10)

def submit_help_code(help_code_entry,result_label):

selected_item = [Link]()
item_text = [str(e) for e in [Link](selected_item)["values"]] #integers in the
treeview are converted to strings

for location in list_of_codes:


if location[0:4] == item_text[0:4]:

if len(help_code_entry) != 4:
result_label.config(text="The verification code must be 4 digits.", fg="red")

elif help_code_entry == location[4]:


result_label.config(text="The verification code is correct.\n Refresh the page to
see the updated data.", fg="green")
item_index = [Link](selected_item)
list_of_status[item_index] = "HELP ARRIVED" #changing the status of the
report to "HELP ARRIVED" because the help code is correct
[Link].from_dict(dict_of_file).to_csv("[Link]", index=False)

else:
result_label.config(text="The verification code is incorrect.", fg="red")

def show_in_map():
selected_item = [Link]()
if selected_item:
item_text = [Link](selected_item)["values"]
location = f"{item_text[0]}, {item_text[1]}, {item_text[2]}"
show_map(location) #calling the function to show the map

def show_map(location):
api_key = "AIzaSyDZVEC3l5lA53c2JyVdEYmziytllm8f-s4"
url = f"[Link]
center={location}&zoom=13&size=400x300&markers=color:red
%7C{location}&key={api_key}"

#converting the response to an image


response = [Link](url)
image = [Link](BytesIO([Link]))
map_image = [Link](image)
[Link](image=map_image) #showing the image on the label
[Link] = map_image

def on_item_select(event):
selected_item = [Link]()
if selected_item:
item_text = [Link](selected_item)["values"]
if item_text[5] == "HELP ARRIVED":
#[Link](state=[Link])
help_button.config(state=[Link]) #the help button is disabled because the
help has already arrived
else:
#[Link](state=[Link])
help_button.config(state=[Link])

window = [Link]()
[Link]("-fullscreen", True)
[Link]("NATURAL DISASTER APPLICATION")

treeview = [Link](window)
[Link](fill="both", expand=True)

data = pd.read_csv("[Link]")

treeview["columns"] = list([Link])
[Link]("#0", text="Index", anchor="w") #"w" means west so heading is left
aligned

for column in [Link]:


[Link](column, text=column, anchor="w")
index = 1
for _, row in [Link](): #"_" is used for ignoring the index column
values = [Link]()
[Link]("", "end", text=index, values=values) #inserting the values in the
treeview
index += 1

[Link]("<<TreeviewSelect>>", on_item_select) #calls on_item_select function


when an item is selected

button_frame = [Link](window)
button_frame.pack(pady=10)

#button = [Link](button_frame, text="Show in Map", command=show_in_map,


width=30, height=2, state=[Link])
#[Link](padx=5, side=[Link])

help_button=[Link](button_frame,text="Verify Help
Code",command=help_code,width=30,height=2,state=[Link])
help_button.pack(padx=5,side=[Link])

return_button = [Link](button_frame, text="Return to Upper Menu",


command=admin_menu, width=30, height=2, bg="crimson")
return_button.pack(padx=5, side=[Link])

label = [Link](window, text="")


[Link]()

[Link]()

def show_supply_table():
window = [Link]()
[Link]("-fullscreen", True)
[Link]("Supply Report Data")

treeview = [Link](window)
[Link](fill="both", expand=True)

data = pd.read_csv("[Link]")

treeview["columns"] = list([Link])
[Link]("#0", text="Index", anchor="w")
button = [Link](window, text="Return To Upper Menu", command=admin_menu,
width=30, height=2, bg="crimson")
[Link](pady=5)

for column in [Link]:


[Link](column, text=column, anchor="w")

index = 1
for _, row in [Link]():
values = [Link]()
[Link]("", "end", text=index, values=values)
index += 1

[Link]()
#------------------------#
earthquake_data = []
def recent_earthquakes():

def fetch_earthquake_data():
global earthquake_data

url = "[Link]
infos = {
"format": "geojson",
"minmagnitude": "2.5",
"limit": "5",
#coordinates of Delhi
"minlatitude": "33.15",
"maxlatitude": "35.0",
"minlongitude": "78.82",
"maxlongitude": "85.0"
}

response = [Link](url, params=infos)


data = [Link]() #converting the response to json format

for veri in data["features"]:


place = "PLACE: " + str(veri["properties"]["place"])
magnitude = "MAGNITUDE: " + str(veri["properties"]["mag"])
time_str = "TIME: " + str([Link](veri["properties"]["time"] /
1000.0))
earthquake_data.append(place + "\n" + magnitude + "\n" + time_str + "\n\n")
data_text.delete('1.0', [Link]) #deleting the previous data

for data in earthquake_data:


data_text.insert([Link], data) #inserting the new data
data_text.tag_configure("center", justify="center")
data_text.tag_add("center", "1.0", "end") #centering the data

window = [Link]()
[Link]("-fullscreen", True)
[Link]("Real-Time Earthquake Data")
data_text = [Link](window, font=("Courier New", 12))
data_text.pack(fill=[Link], expand=True) #filling the whole window

fetch_button = [Link](window, text="Get Real-Time Data",


command=fetch_earthquake_data, bg="green", fg="white", width=20, height=2)
fetch_button.pack(pady=5)
button = [Link](window, text="Return To Main Menu", command=main_menu,
width=30, height=2, bg="crimson")
[Link](pady=10)
[Link]()

#initialize the files


with open('[Link]','w', newline='',encoding='utf-8') as file2:
debris_data = [
["PROVINCE", "DISTRICT", "STREET NAME", "APARTMENT NAME", "HEALTH
CONDITION", "REPORT STATUS"],
["Assam", "Goalpara", "Goalpara-II", "Babu's complex", "Heavily Injured", "NO HELP
YET"]]
writer = [Link](file2)
[Link](debris_data)

for x in debris_data:
if x == debris_data[0]:
continue
else:
list_of_codes.append(x[0:4]+["1234"])
with open('[Link]','w', newline='',encoding='utf-8') as file1:
supply_data = [['PROVINCE', 'DISTRICT', 'NEEDED SUPPLY'],
['Assam', 'Goalpara', 'Food']]
writer = [Link](file1)
[Link](supply_data)

main_menu()
CHAPTER - 8

CONCLUSION

In analyzing the recent achievements associated with leveraging Big Data to disaster
management, this paper has presented the findings of several researchers on varied scientific
and technological perspectives that have a bearing on the efficacy of big data in facilitating
disaster management. It has become apparent that in the present age of information
technology, a major objective of scientists is to analyze the varied aspects of big data and find
ways of making the best of the available technologies in storing the available information in
well-integrated structures and using it for the welfare of human societies, particularly in the
context of using bid data to effectively deal with natural disasters. The paper has analyzed
major big data sources that are valuable in disaster management. A detailed analysis has been
conducted to highlight the significance of different big data sources in various disaster
management phases. The main challenges pertain to effectively dealing with data collection
and management technologies and developing efficient systems of mitigating the adversities
associated with natural disasters and managing disasters in ways that result in minimum
losses to human lives and property. Other challenges pertain to developing algorithms by way
of systems that can be used in resolving operational issues and attaining greater accuracy in
predicting disasters. The paper has highlighted the need for further research on big data
applications in enhancing the efficiency of the public sector in further developing technology
to mitigate the adverse effects of natural disasters. Overall, further research efforts need to be
made to look into the challenges emerging from Big Sensing Data, particularly in the context
of the emerging data volume of streaming videos, including efficient data management, fast
data transfer, and intuitive data visualization.
CHAPTER - 9

FUTURE WORK

According to researchers the standardization and application of IoT, data formats and
data specifications, big data management and accessibility with information systems, which
are subjects of further research in the near future. Some authors even concluded that future
development will include system enhancement with more sensor numbers, improved fog
layer computing and actual cloud virtual instance data deployment.
CHAPTER - 10

REFERENCE

[1] “Number of reported disasters by type.” [Online]. Available:


[Link]

[2] Tuswadi and T. Hayashi, “Disaster Prevention Education in Merapi Volcano Area
Primary Schools: Focusing on Students’ Perception and Teachers’ Performance,” Procedia
Environ. Sci., vol. 20, pp. 668–677, 2021.

[3] “2015_43291_Sendaiframeworkfordrren_Disaster Reducton 2015-2030,” 2022.

[4] S. Goswami, S. Chakraborty, S. Ghosh, A. Chakrabarti, and B. Chakraborty, “A review


on application of data mining techniques to combat natural disasters,” Ain Shams Eng. J.,
vol. 9, no. 3, pp. 365–378, 2020.

[5] I. A. T. Hashem, I. Yaqoob, N. B. Anuar, S. Mokhtar, A. Gani, and S. Ullah Khan, “The
rise of ‘big data’ on cloud computing: Review and open research issues,” Inf. Syst., vol. 47,
pp. 98–115, 2021.

[6] M. Yu, C. Yang, and Y. Li, “Big Data in Natural Disaster Management: A Review,”
Geosciences, vol. 8, no. 5, p. 165, 2020.

[7] P. Sciences, “science direct,” 2019. [Online]. Available: [Link]

[8] Springer, “springeropen,” Technolo, 2021. [Online]. Available:


[Link]

[9] IEEE, “IEEE,” 2020. [Online]. Available: [Link]

[10] Google Scholar, “Google Scholar,” 2019. [Online]. Available:


[Link]

[11] L. Connect, “ResearchGate,” 2019. [Online]. Available: [Link]

[12] B. Supriyadi, A. P. Windarto, T. Soemartono, and . M., “Classification of Natural


Disaster Prone Areas in Indonesia using K-Means,” Int. J. Grid Distrib. Comput., vol. 11, no.
8, pp. 87–98, 2022.

You might also like