Shell Script for Linux that implements Google's Geolocation API.
Get an API key from Google. Replace the "api_key" variable in the script. Execute the script with root permissions ( root permissions are required because of iw ). The script will return a Google Maps URL with the latitude and longitude that was returned from the API.
The script is fairly well documented so feel free to take it apart and use in something else.
https://developers.google.com/maps/documentation/geolocation/intro