1
|
#!/bin/bash -e
|
2
|
# exports the geoscrub table
|
3
|
. "$(dirname "${BASH_SOURCE[0]}")"/../../../lib/runscripts/import.run
|
4
|
.rel ../../../lib/sh/local.sh
|
5
|
|
6
|
if self_not_included; then
|
7
|
|
8
|
export_() # usage: rm=1 .../self.run export_
|
9
|
{
|
10
|
echo_func; require_remote
|
11
|
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
|
to_top_file pg_as_root pg_export # runtime: 30 s ("0m30.352s")
|
16
|
}
|
17
|
|
18
|
make() # usage: rm=1 .../self.run make
|
19
|
{
|
20
|
echo_func
|
21
|
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
|
export_
|
26
|
}
|
27
|
|
28
|
# upload time: 1.5 min ("0:01:17")
|
29
|
|
30
|
all() # usage: rm=1 .../self.run
|
31
|
{
|
32
|
echo_func
|
33
|
make
|
34
|
}
|
35
|
|
36
|
fi
|