Weather Forecasting & Crop Recommendation

Download Full-Text PDF Cite this Publication

Text Only Version

Weather Forecasting & Crop Recommendation

Prof. Anil Hulsure

Dept. of Computer Science & Engg Dr. D. Y. Patil Institute of Engineering, Management & Research, Pune, India

Aditya Kalekar

Dept. of Computer Science & Engg Dr. D. Y. Patil Institute of Engineering, Management & Research, Pune, India

Yogesh Kale

Dept. of Computer Science & Engg Dr. D. Y. Patil Institute of Engineering, Management & Research, Pune, India

Vijay Ganesh

Dept. of Computer Science & Engg Dr. D. Y. Patil Institute of Engineering, Management & Research, Pune, India

Nandini Banswani

Dept. of Computer Science & Engg

Dr. D. Y. Patil Institute of Engineering, Management & Research, Pune, India

Abstract Weather Forecasting is the application of science and technology to predict the atmosphere of a location. Usually, for forecasting of weather, we usually record the pattern of weather of past days and then predict the future weather. Farmers can plan their farming activities according to the forecast. Here, we are creating a web application of weather forecasting using JSP, Servlet and API. This application mostly uses API, so we will be determining how to use API, and how API calls are made. This application gives information about the future weather so that people can plan activities in day-to-day life. Also, this application gives information about air quality in a particular area where the people can determine how clean or polluted the air is, and what will be the health issues if we breathe polluted air. This application will also focus on concepts like JSP, Servlet. Also using maps to display the weather of any area in images format. Graphs are provided to give visual representation of weather parameters like temperature, humidity, wind speed, etc. For crop prediction, we use collaborative filtering which is used for prediction of user preferences in item selection according to the ratings of user items in the present data.

Keywords Weather Forecasting, JSP, Servlet, API, HTML, CSS, Js, MySQL, Collaborative Filtering


    Weather Forecasting is used to predict the atmosphere of a location[4][5]. This web application is used to provide the same with some more additional activities, like current weather of a particular area, historical weather of past days, air quality index and maps supporting the current weather[2]. There are many methods for which we can predict the weather, which start from looking up at the sky(which was used anciently) to complexed computerized models. Nowadays, Data Science is growing and with that technology, we can also predict the weather. For this web application specifically, we are using APIs to access data,. Before getting straight to the API calls, this project is made in Java, JSP, Servlet and MySQL.

    JSP is Java Server Pages which are used to create dynamic, platform independent function for web-based applications. It is a server side technology[3].

    A servlet works within the server and it is a small Java program. Clients request to servlets and the servlets receive the request and give appropriate response,

    API is Application Programming Interface, as it says it is an interface, which allows to talk between the two application. Here the API, the web application is using it. OpenWeatherMap API is powered by ML technologies[7], which provides all necessary business weather information for any location of the globe. The AirPollution API provides access to location based air pollution data via simple RESTful web interface[2][13]. GoogleMaps API is used for geographical nature of the application which helps to show weather in maps form.

    Fig 1. Air Qualtiy Index

    Air pollution is also one of the major impacts on human because air contains oxygen and we need oxygen for breathing[1].

    Here is image of table containing the classification of air quality index :

    Collaborative filtering is basically a combination of two words

    collection of preference of users(collaborative) and making predictions automatically(filtering)[10]. Here we make use of this by comparing the weather and according to it predicting which crop is best for growth in that particular weather. Also based on the user, we shuffle the crops and recommend the best one to be sown[8].

    Here we use of collaborative filtering for recommending the best crop suited for the weather condition present on that particular location.


    Nowadays, Weather plays a very important role in humans daily life. Weather makes human to plan his/her day to day activities. This project proposes a web application to display current, future and historical weather according to the given location with the help of API and with crop recommendation for the users (farmers basically) with the help of collaborative filtering.


    1. A Web API and Web application development for dissemination of Air Quality Information (Kevser Sahin, Umid Isikdag)

      In this paper the agenda of study is to make a web service for air quality for checking the quality of air for preventing a dangerous situation. This paper is basically proposed a system for Air Qualtiy Management in Turkey and also shown the limitations of previous methods used. Here they have also used the visualization methods for showing the air quality based on the map of the region.

      Basically they have shown how the basic RESTful Web API development works.

    2. Development for REST API for obtaining Site-specific historical and near-future weather data in EPQ Format (Hu du, Eva Lucas Segarra, Carlos Bandera)

      This paper shows how to get real-time current and forecast weather in QPW format using online toolchain which further can be used as an API for building simulation community.

    3. Java based Webcentric Approach for Weather Prediction Using the ARPS Model (Gopal Racherla, Adwait Sathye, Anindya Das)

      The agenda of this paper is to create a tool to use computers for science rather than to use computer as an platform and this Java for the ARPS is a step in the same direction and how this helps in the weather prediction for a particular location.

    4. Survey on Weather Forecasting using Data Mining(Christy Kunjumon, Sreelekshmi Nair, Deepa Rajan, L. Padma Suresh, Preetha S L)

      The main purpose of this paper is to show how data mining is used for weather forecasting and the different types of data mining algorithms like naïve bayes are used for obtaining more accurate results on the same.

    5. Weather Forecasting Using Sliding Window Algorithm(Piyush Kapoor, Sarabjeet Singh Bedi)

      This paper shows how the variations in the weather conditions in the past years be utilized for predicting the future weather to get more accuracy and efficiency of the weather forecast.

    6. Weather Forecast Prediction: An Integrated Approach for Analyzing and Measuring Weather Data (Munmun Biswas, Tanni Dhoom, Sayantanu barua)

      This paper deals with the weather prediction using chi square and naïve bayes algorithms where the current weather data is taken into the dataset and extracted to get useful information for prediction.

    7. Weather Forecasting using Machine Learning Algorithms (Nitin Singh, Saurabh Chaturvedi, Shamim Akhter)

      This paper presents a model in which raspberry pie 3 B is used for using ML Algorithms and then predicting the weather, also some of the hardware like barometer pressure sensor for calculating the air pressure .

    8. Improvement of Crop Production Using recomender system by Weather Forecasts (S Bangaru Kamatchi, R Parvathi)

      The paper proposes a system for best crop recommendation by using weather conditions and ANN as algorithm showing improvements that can be suitable for the crop considering the current, historical and future weather.

    9. Collaborative Filtering System for Agriculture Sector (Sapna Jaiswal, Tejaswi Kharade, Nikita Kotambe, Shilpa Shinde)

    The agenda of this paper is to use collaborative filtering for giving the best accurate information to the farmers about the agriculture sector which includes updating farmers on the recent trends in crop production, government schemes and programs


We have created a simple web application using JSP, Servlet and MySQL for weather forecasting and displaying various weather parameters. We have also used APIs for collecting data and displaying it in the web application for accurate conditions and to make the application reliable.

Basically three APIs have come across this web application, OpenWeatherMap API, Airpollutionapi and GoogleMaps API. Weather data in this application includes the current weather, weather forecast of 5 days, historical weather of 5 days, air pollution data, i.e. the air quality index. We can also see the weather on different location where we have given a search option of city in current weather, and latitude and longitudes for weather forecast, historical weather and air quality index. For crop recommendation, we have used collaborative filtering which takes the data from the combination of user data and weather data and gives efficient prediction on the future crop to be grown so that it helps farmers to prevent their land and produce a healthy crop in his/her land without any damage or any destruction to the land and the crop.

  1. Login System

    Fig. 2 System Architecture

    project provides better accuracy of weather and is more efficient.

    We can say that weather is one of the most important factors for human. And how the future weather can make human plan his day-to-day life. Also, we have used crop recommendation as one of the applications of weather forecast to show how weather impacts the crops and which crop is suitable for which condition.


    We would like to express my special gratitude to our guide, Mr. Anil Hulsure, Professor at Dr. D. Y. Patil Institute of Engineering, Research and Management who gave us a golden opportunity to work on this wonderful project on Weather Forecasting and also guiding for the same. Also we would like to thank all of the team members of our group,

    This is a basic login system where the user can create a new account or use existing account for logging in to see the weather conditions. For creating an account user has to enter basic information like name, email id, mobile number

    , password, etc to save his data into the database.

  2. Weather components

    1. Current Weather

      This is the welcome page after you log in. This will show the current weather data according to the device location in which you have logged in. It has parameters like the city name, temperature, etc. We can also extract the weather conditions of any city according to our choice using the search box which takes input as city name and this data is fetched from the API called OpenWeatherMap API.

    2. Historical weather

      This is another tab where you can switch from which shows the historical data, i.e. the weather conditions for the past few days. We can also see weather conditions in another city using the latitude and longitude of the particular location and we can track the weather there also.

    3. Weather Forecast

      This is the main component where we can see the future weather conditions of the next coming days. Here also the option of latitude and longitude is given for the user to track weather forecast of any location.

    4. Air quality

      This component takes air as the parameter of weather to check the air quality. Same as historical weather and weather forecast, we can use the latitude and longitude.

    5. Google Maps Images

      Here, we show google maps and clicking on a particular point on the map will show a window which will tell display the user the current weather condition there.

    6. Crop recommendation

This page shows the user which crop to use for the weather condition according to the location of users will. Here collaborative filtering is used to collect data from all other users and checking the crops for the suitable weather.


After looking at the previous works that have been done to forecast weather, including the study of the papers and planning the project implementation, we can say that the

who made this application possible with their willingness and research on this particular topic and the tools and technologies used. Also we would lastly thank our HOD of Computer Mrs. Pratiksha Shevtakar mam for providing us to embark on this project.


  1. Kevser Sahin, Umid Isikdag (2017 November) A Web API and Web application development for dissemination of Air Quality Information. link : 373-2017

  2. Hu du, Eva Lucas Segarra, Carlos Fernandez(2020). Development Of a Rest API for Obtaining Site-Specific Historical and Near- Future Weather Data in EQW format UK 11-12.

  3. G. Racherla, A. Sathye and A. Das, "Java based webcentric approach for weather prediction using the ARPS model," Proceedings of the IEEE 1997 National Aerospace and Electronics Conference. NAECON 1997, 1997, pp. 271-278 vol.1, doi: 10.1109/NAECON.1997.618090.

  4. C. Kunjumon, S. S. Nair, D. Rajan S., P. Suresh and S. L. Preetha, "Survey on Weather Forecasting Using Data Mining," 2018 Conference on Emerging Devices and Smart Systems (ICEDSS), 2018, pp. 262-264, doi: 10.1109/ICEDSS.2018.8544326.

  5. Kapoor, Piyush & Bedi, Sarabjeet. (2013). Weather Forecasting Using Sliding Window Algorithm. ISRN Signal Processing. 2013. 1-5. 10.1155/2013/156540.

  6. Biswas, Munmun & Dhoom, Tanni & Barua, Sayantanu. (2018). Weather Forecast Prediction: An Integrated Approach for Analyzing and Measuring Weather Data. International Journal of Computer Applications. 182. 20-24. 10.5120/ijca2018918265.

  7. N. Singh, S. Chaturvedi and S. Akhter, "Weather Forecasting Using Machine Learning Algorithm," 2019 International Conference on Signal Processing and Communication (ICSC), 2019, pp. 171-174, doi: 10.1109/ICSC45622.2019.8938211.

  8. Kamatchi, S. & Parvathi, R.. (2019). Improvement of Crop Production Using Recommender System by Weather Forecasts. Procedia Computer Science. 165. 724-732. 10.1016/j.procs.2020.01.023.

  9. Sapna Jaiswal, Tejaswi Kharade, Nikita Kotambe, Shilpa Shinde(2019) Improvement of Crop Production Using recommender system by Weather Forecasts

  10. Qing Li, Byeong Man Kim, An Approach for Combining Content – based and Collaborative Filters, ( This work was supported by Korea Research Foundation Grant ( KRF-2002-041- D00459 )).

  11. Deboshree Ghosh, Pratap Parida (October 2015). Air Pollution And India pp. 22194-22196

  12. Kuanr, M., Kesari Rath, B., & Nandan Mohanty, S. (2018). Crop Recommender System for the Farmers using Mamdani Fuzzy Inference Model. International Journal of Engineering & Technology, 7(4.15), 277-280.


  13. A. Neumann, N. Laranjeiro and J. Bernardino, "An Analysis of Public REST Web Service APIs," in IEEE Transactions on Services Computing, doi: 10.1109/TSC.2018.2847344.

Leave a Reply

Your email address will not be published. Required fields are marked *