Using gsod data for weather, working on importing
This commit is contained in:
parent
1593c21031
commit
65d5bae610
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/postgresql/tutorial/weather/data/
|
0
postgresql/tutorial/weather/data/.gitkeep
Normal file
0
postgresql/tutorial/weather/data/.gitkeep
Normal file
25
postgresql/tutorial/weather/import-data
Executable file
25
postgresql/tutorial/weather/import-data
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
FTP_BASE='ftp://ftp.ncdc.noaa.gov/pub/data/gsod'
|
||||||
|
|
||||||
|
pushd $(dirname $(readlink -f $0))
|
||||||
|
|
||||||
|
pushd ./data
|
||||||
|
if [[ ! -f ish-history.csv ]]
|
||||||
|
then
|
||||||
|
curl -O $FTP_BASE/ish-history.csv
|
||||||
|
fi
|
||||||
|
|
||||||
|
for year in 1950 1960 1970 1980 1990 2000 2010
|
||||||
|
do
|
||||||
|
tarname=gsod_$year.tar
|
||||||
|
if [[ ! -f $tarname ]]
|
||||||
|
then
|
||||||
|
curl -O $FTP_BASE/$year/$tarname
|
||||||
|
fi
|
||||||
|
tar xf $tarname
|
||||||
|
for gzfile in *-$year.op.gz
|
||||||
|
do
|
||||||
|
:
|
||||||
|
done
|
||||||
|
done
|
Loading…
x
Reference in New Issue
Block a user