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