HOW IT WORKS :
Today we’ll use the very popular Google Map’s Directions API to generate instructions to navigate between two cities using PowerShell.
Just to show you how it work, please go to the below mentioned URL by passing the required parameters.
You’ll reach to an XML page with all the necessary data. Now just we need some Data Mining from this page using Powershell and we have the information we need.
URL :
WHAT IS GOOGLE MAP DIRECTION API ?
API – Application Programming Interface is a set of functions and procedures that allow the creation of applications which access the features or data of an operating system, application, or other service.
The Google Maps Directions API is a service that calculates directions between locations using an HTTP request.
You can search for directions for several modes of transportation, include transit, driving, walking or cycling. Directions may specify origins, destinations and waypoints either as text strings (e.g. “Chicago, IL” or “Darwin, NT, Australia”) or as latitude/longitude coordinates. The Directions API can return multi-part directions using a series of waypoints.
GET THE SCRIPT : Click here to go to my GitHub gist to get the code.
HOW TO USE IT :
Just provide Origin, Destination and you will get the directions. The script will choose the Transportation mode as ‘Driving‘ By default, like in the screenshot below.
If you want to change the unit into miles use the switch -InMiles and distance would be converted into Miles
Also, You’ll find Three Modes of transport(‘Driving’,’Bicycling’,’Walking’) available in the function for which you can opt to get the directions
If in the case Google map doesn’t find any results (ZERO_RESULTS) for the values you passed in the Parameters, the Function will prompt you the same.
WHAT NEXT?
In my next post, I will show you, how to play with this information and make your computer give you Voice enabled Instructions using the Speech API (SAPI). So stay tuned fellas !
Thank you for Stopping by 🙂
Prateek Singh
Related posts
0 Comments
Leave a Reply to icCancel reply
Categories
Author of Books
Awards
Open Sourced Projects
Author at
Blog Roll
Mike F RobbinsDamien Van Robaeys
Stéphane van Gulick
Kevin Marquette
Adam Bertram
Stephanos Constantinou
Francois-Xavier Cat
Ravikanth Chaganti
Roman Levchenko
Blog Stats
- 1,133,180 People Reached
This is really neat. It works very fast!
Thank You Someone 🙂 ( Wish I had a name to refer :P)
I don’t normally comment…. But this is really neat and geeky. Thanks for sharing!
Thank you for the appreciation 🙂
Pretty epic, put it in my $profile, endless directions
[…] PowerShell : Get Directions using Google Map API […]
Very nice!