]> git.street.me.uk Git - andy/viking.git/blame - tools/timezone-lookup-create.sh
Some spelling fixes in a comment
[andy/viking.git] / tools / timezone-lookup-create.sh
CommitLineData
fe559ece
RN
1#!/bin/bash
2#
3# Get location and timezone information from Geonames
4#
5# Then simplify & mash it up into the minimal format for our usage.
6
7# ~23K entries in 4.5M file (when uncompressed)
8export CITIES=cities15000.zip
9if [ ! -e $CITIES ]; then
10 wget http://download.geonames.org/export/dump/$CITIES
11fi
12
13# Simplify the info - just want lat, lon and TZ id
14unzip -p $CITIES | awk -F "\t" '{print $5, $6, $18}' > latlontz.txt
15# Result is a ~750K file
16
17# Store in the data directory
18mv latlontz.txt ../data