Skip to content

Instantly share code, notes, and snippets.

@ybonnel
Created May 28, 2018 08:59
Show Gist options
  • Save ybonnel/d926f312d3c2b76b60ab0e1f34082d35 to your computer and use it in GitHub Desktop.
Save ybonnel/d926f312d3c2b76b60ab0e1f34082d35 to your computer and use it in GitHub Desktop.
Just a little script to get bounds of GTFS file
unzip -p *.gtfs.zip stops.txt |
tr -d '"' |
tail -n+2 |
awk -F "," 'BEGIN{minLat=100; maxLat=-100; minLon=100; maxLon=-100 }{ if ( $5 > maxLat ) maxLat=$5; if ( $5 < minLat ) minLat =$5; if ($6 < minLon) minLon=$6; if ($6 > maxLon) maxLon = $6 }END {print minLat" "minLon" "maxLat" "maxLon}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment