1 |
11351
|
aaronmk
|
#!/bin/bash -e
|
2 |
|
|
# exports the geoscrub table
|
3 |
11592
|
aaronmk
|
. "$(dirname "${BASH_SOURCE[0]}")"/../../../lib/runscripts/import.run
|
4 |
11351
|
aaronmk
|
.rel ../../../lib/sh/local.sh
|
5 |
|
|
|
6 |
|
|
if self_not_included; then
|
7 |
|
|
|
8 |
11592
|
aaronmk
|
export_() # usage: rm=1 .../self.run export_
|
9 |
11351
|
aaronmk
|
{
|
10 |
11781
|
aaronmk
|
echo_func
|
11 |
11364
|
aaronmk
|
local_export database=geoscrub table=geoscrub \
|
12 |
|
|
cols='decimallatitude,decimallongitude,country,stateprovince,county,countrystd'\
|
13 |
|
|
',stateprovincestd,countystd,latlonvalidity,countryvalidity,'\
|
14 |
|
|
'stateprovincevalidity,countyvalidity' # str b/c env vars don't support arrays
|
15 |
11785
|
aaronmk
|
to_top_file pg_export # runtime: 25 s ("0m24.464s")
|
16 |
11351
|
aaronmk
|
}
|
17 |
|
|
|
18 |
11592
|
aaronmk
|
make() # usage: rm=1 .../self.run make
|
19 |
|
|
{
|
20 |
|
|
echo_func
|
21 |
11593
|
aaronmk
|
local input_path="$(canon_rel_path "$root_dir/exports/geoscrub_input.csv")"
|
22 |
|
|
DATAFILE="$(basename "$input_path")" command \
|
23 |
|
|
"$root_dir/derived/biengeo/geoscrub.sh" \
|
24 |
|
|
--geoscrub-input="$(dirname "$input_path")"
|
25 |
11782
|
aaronmk
|
# runtime: 2.5 h ("21:24:02" - "19:04:58")
|
26 |
11592
|
aaronmk
|
export_
|
27 |
|
|
}
|
28 |
|
|
|
29 |
11786
|
aaronmk
|
# upload time: 30 s ("0:00:29")
|
30 |
11364
|
aaronmk
|
|
31 |
11351
|
aaronmk
|
all() # usage: rm=1 .../self.run
|
32 |
|
|
{
|
33 |
|
|
echo_func
|
34 |
|
|
make
|
35 |
|
|
}
|
36 |
|
|
|
37 |
|
|
fi
|