Skip to content

Spring-Boot based microservice to obtain weather data of a location based on it's name or pincode from OpenWeatherMap.

Notifications You must be signed in to change notification settings

superuserdevelopment/WeatherMicroservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WeatherMicroservice

A Spring Boot project for Open Weather Map API to find weather of a location based on location name or pin code or geographic co-ordinates.
Made with ♥ in Java

Steps to excution:

  1. Execute the DemoApplication.java file
  2. An Tomcat server instance will be started at port: 8080.
  3. Access this server through your browser using localhost:8080.
  4. To use the API enter the following in the url:
    1. Location Name based(Plain String Output): http://localhost:8080/weather/name/{place}
      Replace {place} with the location name you want the weather of

    2. Location Name based(JSON Output): http://localhost:8080/weather/name/json/{place}
      Replace {place} with the location name you want the weather of

    3. Pin-code based(Plain String Output): http://localhost:8080/weather/pin/{pincode}
      Replace {pincode} with the Pin-code you want the weather of(Only Indian Pin-codes)

    4. Pin-code based(JSON Output): http://localhost:8080/weather/pin/json/{pincode}
      Replace {pincode} with the Pin-code you want the weather of(Only Indian Pin-codes)

    5. Geographic Co-ordinates based(Plain String Output): http://localhost:8080/weather/coord/lon={lon}&lat={lat}
      Replace {lon} and {lat} with the respective longitude and latitude co-ordinates of the location you want to find the weather of

    6. Geographic Co-ordinates based(JSON Output): http://localhost:8080/weather/coord/json/lon={lon}&lat={lat}
      Replace {lon} and {lat} with the respective longitude and latitude co-ordinates of the location you want to find the weather of
  5. Get output.

Output Format

  1. JSON String
    Sample input: http://localhost:8080/weather/name/json/thane
    {
     "Status": "OK",
     "temp": 31.0,
     "temp_min": 31.0,
     "weather": "Haze",
     "humidity": 79.0,
     "location": "Thāne",
     "lon": 72.97,
     "pressure": 1005.0,
     "feels_like": 35.45,
     "temp_max": 31.0,
     "lat": 19.2
    }
  2. Plain String
    Sample input: http://localhost:8080/weather/name/thane
    Weather at: Thāne
    Coordinates are
    Longitude: 72.97
    Latitude: 19.2
    Weather: Haze
    Temperature: 31.0
    Feels like: 35.45
    Maximum Temperature: 31.0
    Minimum Temperature: 31.0
    Pressure: 1005.0
    Humidity: 79.0
    

GoogleDistanceMatrixAPIMicroservice

A Spring Boot project for Google Distance Matrix API to find road distance between two points based on location name or pin code.
Made with ♥ in Java

Steps to excution:

  1. Execute the DemoApplication.java file
  2. An Tomcat server instance will be started at port: 8080.
  3. Access this server through your browser using localhost:8080.
  4. To use the API enter the following in the url:
    1. JSON String: http://localhost:8080/distance/json/{start}to{end}
      Replace {start} and {end} with respective places/pin-codes.
    2. Plain String: http://localhost:8080/distance/{start}to{end}
      Replace {start} and {end} with respective places/pin-codes.
  5. Get output.

Output Format

  1. JSON String
    Sample input: http://localhost:8080/distance/json/MumbaitoThane
    {
       "Starting Location":"Mumbai, Maharashtra, India",
       "Duration":"32 mins",
       "Ending Location":"Thane, Maharashtra, India",
       "Distance":"22.7 km"
    }
  2. Plain String
    Sample input: http://localhost:8080/distance/MumbaitoThane
    Distance is: 22.7 km
    Duration is: 32 mins
    Starting Location: Mumbai, Maharashtra, India
    Ending Location: Thane, Maharashtra, India
    

About

Spring-Boot based microservice to obtain weather data of a location based on it's name or pincode from OpenWeatherMap.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages