Skip to content

Atharv1patil/Crop-data-api

Repository files navigation

Crop Recommendation System

This project provides crop recommendations based on soil, weather, and location data using APIs such as Tomorrow.io for weather and Google Earth Engine for soil data.

Features

  • Reverse geocoding with OpenStreetMap (Nominatim)
  • Real-time weather data from Tomorrow.io
  • Soil properties using Google Earth Engine (EE)
  • Crop recommendation logic

Setup Instructions

1. Clone the repository

git clone  https://github.com/Atharv1patil/Crop-data-api.git
cd crop-recommendation-system

2. Create and activate a virtual environment

python -m venv venv
venv\Scripts\activate   # On Windows
source venv/bin/activate  # On Linux/Mac

3. Set up environment variables

Create a .env file in the root directory and add your API keys: I have already gave it to (env file)

TOMORROW_API_KEY=your_tomorrow_io_api_key
GOOGLE_APPLICATION_CREDENTIALS=path_to_your_service_account.json

4. Authenticate Google Earth Engine

Run the following once to authenticate:

import ee
ee.Authenticate() # only this 
ee.Initialize() # before this line not this one 

5. Run the project

python aa.py

Notes

  • Make sure you have access to Google Earth Engine and have enabled necessary APIs in your Google Cloud project.
  • First-time users must run ee.Authenticate() to link their Google account.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages