Created
December 20, 2016 13:05
-
-
Save perrygeo/3fd95031033f6f34dfaaac4524e47bae to your computer and use it in GitHub Desktop.
Geocode coordinates in `lat/lon` format for Mapbox web URIs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function coords-for { | |
if [ $# -lt 1 ]; then | |
echo "Usage: coords-for LOCATION" | |
fi | |
local location=$1 | |
mapbox geocoding "$location" --features --limit 1 \ | |
| jq -c ".center|[.[1],.[0]]" \ | |
| sed 's/\[//g' | sed 's/\]//g' | sed 's/,/\//g' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment