weather forecasting-3
weather forecasting-3
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE AND ENGINEERING
Submitted By
T .MEGHASHYAM: 22WJ8A6753
CERTIFICATE
ACKNOWLEDGEMENT
We wish to express our sincere thanks to Vice-Chancellor Sardar
G.S.Kohli of Guru Nanak Institutions for providing us all necessary
facilities, resources and infrastructure for completing this project work.
DECLARATION
I, T. MEGHASHYAM(22WJ8A6753) hereby declare that the project report
entitled “WEATHER FORECASTING SYSTEM” under the esteemed
guidance of Mr. Manik Rao Patil, Assistant Professor, Department of
Information Technology submitted in partial fulfilment of the requirements
for the award of the degree of Bachelor of Technology in Computer
Science & Engineering (Internet of Things). This is a record of bona fide
work carried out by us and the results embodied in this project report
have not been submitted to any other University or Institute for the award
of Degree or Diploma.
Date :
Place : GNITC
T. MEGHASHYAM : 22WJ8A6753
CONTENTS
Chapter Page
No. Title No.
ABSTRACT iv
LIST OF FIGURE vi
1 INTRODUCTION 1
1.1 Overview of the Project 1
2 LITERATURE SURVEY 3
3 AIM AND SCOPE OF THE PROJECT 5
3.1 Aim of the Project 5
3.2 Scope of the Project 5
4 MATERIALS AND METHODS USED 6
4.1 System Requirements 6
4.1.1 Hardware Requirements 6
4.1.2 Software Requirements 6
4.1.2.1 Front-End Part 6
4.1.2.2 Back-End Part 6
4.1.3 Python Language 7
4.1.3.1 Python Libraries and Frameworks 7
4.1.3.2 Versatility, Efficiency, Reliability 8
and Speed
4.1.3.3 Visual Studio Code 8
4.1.4 Django 9
4.1.4.1 Complete 10
4.1.4.2 Versatile 10
4.1.4.3 Maintainable 10
4.1.4.4 Portable 11
4.1.5 Bootstrap 11
4.1.5.1 Features 12
4.1.6 Java Script 12
Chapter Page
No. Title No.
4.1.7 HTML 13
4.2 Design Methodology 16
4.2.1 Existing System 16
4.2.2 Proposed System 16
4.3 Module Description 17
4.3.1 Module 1: Interactive Web Application 17
4.3.2 Module 2: Location Based Prediction 17
4.3.3 Module 3: Graphical Representation 17
4.4 System Implementation 17
4.4.1 Architecture Explanation 18
4.4.2 Data Flow Explanation 20
5 RESULTS AND DISCUSSIONS 21
5.1 Home Page 21
5.2 Result Page 1 22
5.3 Result Page 2 23
6 CONCLUSION AND FUTURE SCOPE 24
6.1 Conclusion 24
6.2 Future Work 24
REFERENCES 25
APPENDIX 28
ABSTRACT
v
LIST OF ABBREVIATIONS
Abbreviation Expansion
RAM Random Access Memory
HTML Hyper Text Markup Language
CSS Cascading Style Sheets
SQL Structured Query Language
JSON Java Script Object Notation
API Application Programming Interface
LIST OF FIGURES
vi
CHAPTER - 1
INTRODUCTION
The scientists are been trying to forecast the meteorological data using
a big set of methods, some of them more accurate than others. Weather
forecasting is an essential application in meteorology and has been one of the
most scientifically challenging problems around the world. Weather condition
is a state of atmosphere at given time and the weather parameters are
temperature, humidity, and wind speed. The accuracy of the prediction
depends on knowledge of prevailing weather condition over large areas.
Weather is the non-linear and dynamic process as it varies day to day even
minute to minute; the big challenge of weather is data intensive and the
frenzied nature.
Weather forecasting means predicting the weather and telling how the
weather changes with change in time. Change in weather occurs due to
movement or transfer of energy. Many meteorological patterns and features
like anticyclones, depressions, thunderstorms, hurricanes and tornadoes
occur due to the physical transfer of heat and moisture by convective process.
Clouds are formed by evaporation of water vapour. As the water cycle keeps
on evolving the water content in the clouds increases which in turn leads to
precipitation.
vii
It is also possible to identify the different types of cloud associated with
different patterns of weather. These patterns help in predicting the weather
forecast. We are always with or around a weather forecast; we always carry it
with us and never want to be away from it.
Weather forecasts are issued to protect life and property, save life and
tell us what changes to except in the atmosphere. They provide vital
information to a wide range of categories: agriculture, aviation, commerce,
marine, advisories, etc. Forecasting can also significantly influence decision
and policymaking, construction planning, productivity and environmental risk
management. People can also know and be aware of atmospheric changes
through variables such as temperature, wind speed and direction, cloudiness
and precipitation.
CHAPTER – 2
LITERATURE SURVEY
2
also facilitates decision making in day to day life. It can yield better results
when applied to cleaner and larger datasets.
Aditya Grover, Ashish Kapoor and Eric Horvitz in their work made a
weather prediction model that predicts by considering the joint influence of key
weather variables. They also made a kernel and showed that interpolation of
space can be done by using GPS with such a kernel, taking into account
various weather phenomena like turbulence. They also performed temporal
analysis withina learner based on gradient tree and augmented the system
using deep neural network.
Muthulakshmi A, ME (SE), Dr. S Baghavathi Priya (2015) in their work
proposed a methodology that aims at providing an efficient and accurate
weather forecasting models to predict and monitor the weather datasets to
predict rainfall. In the past, the parameters of weather were recorded only for
the present time. But in the future, work will be done to make a working model
of selection that can be used for classifying the framework for continuous
monitoring of the climatic attributes.
Divya Chauhan and Jawahar Thakur (2013) made a comparison in their
paper, which shows that the algorithms such as k-mean clustering and
decision trees are well suited for mining data to predict future weather
conditions. If we increase the size of the training set, the accuracy at first
increases but then it slowly decreases after a particular period of time,
depending on the size of the dataset.
3
Siddharth S. Bhatkande, Roopa G. Hubballi(2016) In their work the
authors have used data mining technique and Decision tree algorithm as a
means to classify weather parameters like maximum temperature, minimum
temperature in terms of day, month and year.
CHAPTER - 3
People can get accurate weather information is the main aim of this
application. The important issue faced in our country is climatic changes and
that can be resolved by our application “WEATHER FORECASTING
SYSTEM”. The goal of weather prediction is to provide information. People
and organizations can use to reduce weather related loses and enhanced
societal benefits, including protection of life and property, public health and
support of economic prosperity and quality of life.
4
humidity and wind) and using understanding of atmospheric processes
(through meteorology) to determine how the atmosphere evolves in the future.
CHAPTER - 4
MATERIALS AND METHODS USED
1. Python
2. Visual Studio Code
3. Windows / Mac
6
Due to its corporate sponsorship and big supportive community of
python, python has excellent libraries that you can be use to select and save
your time and effort on the initial cycle of development. There are also lots of
cloud media services that offer cross-platform support through libraries- like
tools, which can be extremely beneficial.
Libraries with specific focus are also available like nltk for natural
language processing or scikit-learn for machine learning application.
There are many frameworks and libraries are available for python
language, such as:
Ask any python developer, and they will wholeheartedly agree that the
python language is efficient, reliable, and much faster than most modern
languages. Python can be used in nearly any kind of environment, and one
will not face any kind of performance loss issue irrespective of the platform
one is working.
One more best thing about versatility of python language is that it can be used
in many varieties of environments such as mobile applications, desktop
applications, web development, hardware programming, and many more. The
versatility of python makes it more attractive to use due to its high number of
applications.
Visual studio code is a source-code editor that can be used with a variety
of programming languages, including Java, JavaScript, Go, Node.js, Python
and C++. It is based on the Electron framework, which is used to develop
7
Node.js Web application that run on the Blink layout engine. Visual studio
code employs the same editor component used in Azure DevOps.
Out of the box, visual studio code includes basic support for most
common programming languages. This basic support includes syntax
highlighting, bracket matching, code folding, and configuring snippets. Visual
studio code also ships with intelliSense for Java script, TypeScript, JSON,
CSS, and HTML, as well as debugging support for Node.js. support for
additional languages can be provided by freely available extensions on the VS
code Marketplace.
Visual Studio Code collets usage data and sends it to Microsoft, although
this can be disabled. However, because of the open-source nature of the
application, the telemetry code is accessible to the public, who can see exactly
what is collected.
4.1.4 Django
8
Library: Django includes dozens of extras you can use to handle common web
development tasks. Django takes care of user authentication content
administration, site map, RSS feeds, and many tasks- right out of the box.
Security: Django takes security seriously and helps developers avoid many
common security mistakes, such as SQL injection, cross-site scripting,
crosssite request forgery and click jacking. Its user authentication system
provides a secure way to manage user accounts and passwords.
Scale: Django uses a component-based “shared-nothing” architecture (each
part of the architecture is independent of the others, and can hence be
replaced or changed if needed). Having a clear separation between the
different parts means that it can scale for increased traffic by adding hardware
at any level: catching services, database servers, or application servers. Some
of the busiest sites have successful scaled Django to meet their demand (e.g.
Instagram and Disqus, to name just two).
4.1.4.1 Complete
4.1.4.2 Versatile
Django can be (and has been) used to build almost any type of website
from content management systems and wikis, though to social networks and
news sites. It can work with any client-side framework, and can deliver content
in almost any format (including HTML, RSS feed, JSON, XML, etc). The site
you are currently reading is built with Django!
Internally, while it provides choices for almost any functionally you might
want (e.g. several popular database, templating engines, etc.), it can also be
extended to use other components if needed.
4.1.4.3 Maintainable
9
Django code is written using design principles and patterns that
encourage the creation of maintainable and reusable code. In particular, it
makes use of the Don’t Repeat Yourself (DRY) principle so there is no
unnecessary duplication, reducing the amount of code. Django also promotes
the grouping of related functionally into reusable “applications” and, at a lower
level, groups related code into modules (along the lines of the Model view
controller (MVC) pattern).
4.1.4.4 Portable
4.1.5 Bootstrap
Bootstrap provides basic style definitions for all HTML elements. The
result is a uniform appearance for prose, tables and form elements across
web browsers. In additional, developers can take advantage of CSS classes
define in Bootstrap to further customize the appearance of their contents. For
example, Bootstrap has provisioned for light and dark colored tables, page
headings, more prominent pull quotes, and text with a highlight.
10
4.1.5.1 Features
• Navigation bars
• Dropdowns
• Progress bars
• Thumbnails
Bootstrap comes with its own code for automatically resizing images
based on the current screen size. Just add the .img-responsive class to your
images, and the predefined CSS rules take of the rest. No more spending
hours coding your own grid-Bootstrap come with its own grid system
predefined.
1
1
• Client-side validation,
• Dynamic drop-down menus,
• Displaying date and time,
• Displaying pop-up window and dialog boxes (like an alert dialog
box, confirm dialog box and prompt dialog box),
• Displaying clocks etc.
4.1.7 HTML
HTML elements are the building blocks of HTML pages. With HTML
constructs, images and other objects such as interactive forms may be
12
embedded into the rendered page. HTML provides a means to create
structured documents by denoting structural semantics for text such as
heading, paragraphs, lists, links, quotes and other items. HTML elements are
delineated by tags written using angle brackets. Tags such as <img/> and
<input/> directly introduce content into the page. Other tags such as <p>
surround and provide information about document text and may include other
tags as sub-elements. Browsers do not display the HTML tags but use them to
interpret the content of the page.
Originally, HTML was developed with the intent of defining the structure of
documents like headings, paragraphs, lists, and so forth to facilitate the
sharing of scientific information between researches. Now, HTML is being
widely used to format web pages with the help of different tags available in
HTML language.
14
4.2 Design Methodology
1
5
An interactive website is essentially an internet page that uses different
kinds of software to create a rich, interactive experience for the user. The
Django framework and bootstrap present themes gives the web application a
pleasant look to interact with, it provides a simple and yet sophisticated look to
the user every time they into the web application.
Where the user will be naming the location for which he wants to know
the weather updates. After entering the city name, this model gives the
weather forecast for the city entered by the user by providing details like Date,
Time Maximum Temperature, Minimum Temperature and picture describing
rainfall or sunshine. It also predicts the future of weather in maximum and
minimum temperature with accuracy.
The user can also view the same result in graphical representation
module which the amount of rainfall in centimeters and the amount of
sunshine in degrees.
16
the weather forecast in graphical method. The application has a neat user
interface for better interaction and it works smoothly.
The architecture diagram Fig 4.1 explains the entire flow of the
proposed system. Normally, every state has a weather department (e.g.) Tamil
Nadu, Andhra Pradesh etc. In that weather department they have an antenna
called automatic weather station, with the help of that antenna we can predict
the climate whether the rain has come or not. So, this is weather data
gathering tool. In this place gathering information are stored in the processed
weather data storage. Our web application gets weather information in that
data storage. The processed weather data will go to user authentic for
forecast which means user have a subscription based plans like SMS or E-
mail they have means, automatically they get weather information through
web browsing not even to type places. Other than that, initially the user will be
requested to enter the location for which he wishes to know the weather
forecasting. After the user enters the location, it will go to web service system.
Web service split the information comes from the data storage, the server
configuration identifiers the location using geographical locator to get accurate
data what actually end user wants. Once the location has been identified, the
corresponding weather forecasted will be presented within fraction of seconds
to the end user.
1
7
Figure 4.1 Architecture Diagram
18
Figure 4.2 Data Flow Diagram
When the end user request the weather forecasting information from the
web application and it will directly go the API call. API call is the process of a user
application submitting a request to an API and that API retrieving the requested
data from the external server or program and delivering it back to the client. After
API call it will go to the cloud database in which all the weather data information
are saved in a database. From database it will go into JSON data. JSON data is an
open standard file format and data interchange format that uses human-readable
text to store and transmit data objects consisting of attribute value pairs and
arrays. It is a common data format with diverse uses in electronic data interchange.
1
9
CHAPTER - 5
RESUTS AND PERFORMANCE ANALYSIS
5.1 Home Page
20
5.2 Result Page 1
When you enter the city name and find weather forecast it will show the
accurate weather forecasting information of your city. It will also show you
minimum temperaute, maximum temperature, cloud precipitation, wind speed,
humidity and sunshine. It will give you accurate weather predicitons for every three
hours.
2
1
5.3 Result Page 2
In this Graphical result module you can see your weather information in
graphical method. There are two types of graph one is bar graph and another one
is area graph. In this two types of graph it will update weather time to time and
celsius also.
CHAPTER - 6
CONCLUSION AND FUTURE ENHANCEMENTS
6.1 Conclusion
The website we created in this project can be futher developed into a mobile
application so that it can give timely weather updates. These updates will be
received in the form of notification in the user’s mobile based on the location they
are present in. So the users don’t even have to get into that particular application
to know the weather and it saves their valuable time.
REFERENCES:
[1] Holmstrom, M., Liu, D., & Vo, C. (2016). Machine learning applied to weather
forecasting. Meteorol. Appl, 1-5.
[2] Gupta, S., Indumathy, K., & Singhal, G. (2016). Weather prediction using normal
equation method and linear regression techniques. IJCSIT) International Journal
of Computer Science and Information Technologies, 7(3), 1490-1493.
[3] Grover, A., Kapoor, A., & Horvitz, E. (2015, August). A deep hybrid model for
weather forecasting. In Proceedings of the 21th ACM SIGKDD international
conference on knowledge discovery and data mining (pp. 379-386).
[4] Priya, S. B. A survey on weather forecasting to predict rainfall using big data
analytics.
[5] Chauhan, D., & Thakur, J. (2014). Data mining techniques for weather prediction:
A review. International Journal on Recent and Innovation Trends in Computing
and Communication, 2(8), 2184-2189.
[6] Kapoor, P., & Bedi, S. S. (2013). Weather forecasting using sliding window
algorithm. International Scholarly Research Notices, 2013.
2
3
[7] Vasantha, B., & Tamilkodi, R. (2019, March). Rainfall pattern prediction using real
time global climate parameters through machine learning. In 2019 International
Conference on Vision Towards Emerging Trends in Communication and Networking
(ViTECoN) (pp. 1-4). IEEE.
[8] Bhatkande, S. S., & Hubballi, R. G. (2016). Weather prediction based on decision
tree algorithm using data mining techniques. International Journal of Advanced
Research in Computer and Communication Engineering, 5(5), 483-487.
[9] Ms. Ashwini Mandale, Mrs. Jadhawar B.A, “Weather Forecast Prediction: A Data
Mining Application”, International Journal of Engineering Research and General
Science Volume 3, Issue 2, MarchApril, 2015, ISSN 2091-2730.
[10] Ankita Joshi, Bhagyashri Kamble, Vaibhavi Joshi, Komal Kajale, Nutan Dhange,
“Weather Forecasting And Climate Changing Using Data Mining Application”,
International Journal Of Advanced Research In Computer And Communication
Engineering,Vol. 4, Issue 3, March 2015.
[11] M. Viswambari, Dr. R. Anbu Selvi, “Data Mining Techniques To Predict Weather: A
Survey”, ISSN 2348 – 7968, IJISET- International Journal Of Innovative Science,
Engineering & Technology, Vol. 1 Issue 4, June 2014.
[12] Divya Chauhan, Jawahar Thakur, “Data Mining Techniques for Weather
Prediction: A Review”, International Journal On Recent and Innovation Trends In
Computing And Communication ISSN: 2321- 8169 Volume: 2 Issue: 8, 2014.
[13] T V Rajini Kanth, V V Sss Balaram And N.Rajasekhar,”Analysis Of Indian
Weather Data Sets Using Data Mining Techniques”, Pp. 89– 94, 2014. © Cs & It-
Cscp 2014.
[14] Pinky Saikia Dutta, Hitesh Tahbilder,”Prediction Of Rainfall Using Data Mining
Technique Over Assam”, Pinky Saikia Dutta et.al / Indian Journal Of Computer Science
And Engineering (IJCSE), ISSN: 0976-5166 Vol. 5 No.2 Apr-May 2014.
[15] Nikhil Sethi, Dr.Kanwal Garg,”Exploiting Data Mining Technique For Rainfall
Prediction”, Nikhil Sethi Et Al, / (IJCSIT) International Journal Of Computer Science And
Information Technologies, Vol. 5 (3), 2014, 3982-3984.
[16] Manisha Kharola and Dinesh Kumar, “Efficient Weather Prediction by Back-
Propagation Algorithm”, IOSRJournal of Computer Engineering (IOSR-JCE) E-ISSN:
2278-0661, PISSN: 2278-8727volume 16, Issue 3, Ver. IV (May-Jun. 2014), Pp 55-58.
24
[17] R.K. Pal, V.K. Sehgal, A.K. Misra, K. Ghosh, U.C. Mohanty and R.S.
Rana,”Application Of Seasonal Temperature And Rainfall Forecast For Wheat
Yield
Prediction For Palampur”, Himachal Pradesh, International Journal Of Agriculture And
Food Science Technology. ISSN: 2249-3050, Volume 4, Number 5, Pp. 453-460
(2013).
[18] Duncan Waga And Kefa Rabah, “Environmental Conditions’ Big Data
Management
And Cloud Computing Analytics For Sustainable Agriculture”, Prime Research On
Education (Pre) ISSN: 2251-1251, Vol. 3(8), Pp. 605-614, November 30th, 2013.
[19] R. Usha Rani, Dr. T.K Rama Krishna Rao,”An Enhanced Support Vector
Regression Model For Weather Forecasting”, IOSR Journal Of Computer Engineering
(IOSRJce) E-ISSN: 2278-0661, P-ISSN: 2278-8727volume 12, Issue 2 IOSR Journal
Of Computer Engineering (IOSR-JCE) E-ISSN: 2278-0661, PISSN: 2278-8727volume
12, Issue 2, Pp 21-24,(May. - Jun. 2013).
[20] Meghali A. Kalyankar, Prof. S. J. Alaspurkar,”Data Mining Technique To Analyze
The Metrological Data”, International Journal Of Advanced Research In Computer
Science And Software Engineering, ISSN: 2277 128x, Volume 3, Issue 2, February
2013.
[21] Piyush Kapoor And Sarabjeet Singh Bedi, “Weather Forecasting Using Sliding
Window Algorithm” Hindawi Publishing Corporation ISRN Signal Processing Volume
2013.
2
5
[25] Sanjay D. Sawaitul, Prof. K. P. Wagh, Dr. P. N. Chatur,”Classification And
Prediction Of Future Weather By Using Back Propagation Algorithm-An
Approach”,
International Journal Of Emerging Technology And Advanced Engineering, ISSN
22502459, Volume 2, Issue 1, January 2012.
APPENDIX:
from django.shortcuts import render, redirect
from weather.key import api_key import
requests import math from
rest_framework.views import APIView
from rest_framework.response import Response
class ChartData(APIView):
authentication_classes = []
permission_classes = []
labels = [
w_dataset['list'][1]["dt_txt"].split()[1],
w_dataset['list'][2]["dt_txt"].split()[1],
w_dataset['list'][3]["dt_txt"].split()[1],
w_dataset['list'][4]["dt_txt"].split()[1],
w_dataset['list'][5]["dt_txt"].split()[1],
w_dataset['list'][6]["dt_txt"].split()[1],
]
chartLabel = "Weather Forecast - " + w_dataset['list'][1]["dt_txt"].split()[0]
chartdata = [ math.floor(w_dataset["list"][1]["main"]["temp_min"] -
273.0), math.floor(w_dataset["list"][2]["main"]["temp_min"] -273.0),
math.floor(w_dataset["list"][3]["main"]["temp_min"] -273.0),
math.floor(w_dataset["list"][4]["main"]["temp_min"] -273.0),
math.floor(w_dataset["list"][5]["main"]["temp_min"] -273.0),
math.floor(w_dataset["list"][6]["main"]["temp_min"] -273.0),
]
data ={
"labels":labels,
"chartLabel":chartLabel,
"chartdata":chartdata,
}
return Response(data)
def result(request):
if request.method == "POST":
city_name = request.POST["city"].lower()
# print(api_key)
url =
f"http://api.openweathermap.org/data/2.5/forecast?
q={city_name}&appid={api_key}"
# print(url) w_dataset =
requests.get(url).json() try:
context = {
"city_name":w_dataset["city"]["name"],
"city_country":w_dataset["city"]["country"],
"wind":w_dataset['list'][0]['wind']['speed'],
"degree":w_dataset['list'][0]['wind']['deg'],
"status":w_dataset['list'][0]['weather'][0]['description'],
2
7
"cloud":w_dataset['list'][0]['clouds']['all'],
'date':w_dataset['list'][0]["dt_txt"],
'date1':w_dataset['list'][1]["dt_txt"],
'date2':w_dataset['list'][2]["dt_txt"],
'date3':w_dataset['list'][3]["dt_txt"],
'date4':w_dataset['list'][4]["dt_txt"],
'date5':w_dataset['list'][5]["dt_txt"],
'date6':w_dataset['list'][6]["dt_txt"],
"pressure":w_dataset["list"][0]["main"]["pressure"],
"humidity":w_dataset["list"][0]["main"]["humidity"],
"sea_level":w_dataset["list"][0]["main"]["sea_level"],
"weather":w_dataset["list"][1]["weather"][0]["main"],
"description":w_dataset["list"][1]["weather"][0]["description"],
"icon":w_dataset["list"][0]["weather"][0]["icon"],
"icon1":w_dataset["list"][1]["weather"][0]["icon"],
"icon2":w_dataset["list"][2]["weather"][0]["icon"],
"icon3":w_dataset["list"][3]["weather"][0]["icon"],
"icon4":w_dataset["list"][4]["weather"][0]["icon"],
"icon5":w_dataset["list"][5]["weather"][0]["icon"],
"icon6":w_dataset["list"][6]["weather"][0]["icon"],
}
except:
context = {
2
9
"pressure":w_dataset["list"][0]["main"]["pressure"],
"humidity":w_dataset["list"][0]["main"]["humidity"],
"sea_level":w_dataset["list"][0]["main"]["sea_level"],
"weather":w_dataset["list"][1]["weather"][0]["main"],
"description":w_dataset["list"][1]["weather"][0]["description"],
"icon":w_dataset["list"][0]["weather"][0]["icon"],
"icon1":w_dataset["list"][1]["weather"][0]["icon"],
"icon2":w_dataset["list"][2]["weather"][0]["icon"],
"icon3":w_dataset["list"][3]["weather"][0]["icon"],
"icon4":w_dataset["list"][4]["weather"][0]["icon"],
"icon5":w_dataset["list"][5]["weather"][0]["icon"],
"icon6":w_dataset["list"][6]["weather"][0]["icon"],
}
except:
context = {
30