Project

General

Profile

1 10707 aaronmk
BIEN geovalidation notes
2
========================
3
4 11347 psarando
Dependencies:
5
The only dependencies for running these scripts are PostgreSQL 9.1, postgis 2.0,
6
and unzip.
7
Installing these packages on Ubuntu 13.04 should be as simple as these commands:
8
sudo apt-get install postgresql
9
sudo apt-get install postgresql-client
10
sudo apt-get install postgresql-client-common
11
sudo apt-get install postgis
12
sudo apt-get install postgresql-9.1-postgis-2.0
13
sudo apt-get install unzip
14
15 10707 aaronmk
[Also see comments embedded in specific scripts in this directory.]
16
17
The bash and SQL statements contained in the files as ordered below
18
should be applied to carry out geographic name scrubbing and
19
geovalidation on a given corpus of BIEN location records.
20
21
That said, given the tight deadline under which this was done in order
22
to produced a geovalidated BIEN3 corpus in advance of the Nov 2013
23
working group meeting, and the corresponding manner in which much of
24
this was actually executed piecemeal in an iterative and interactive
25
fashion within a bash shell and psql session, I can't guarantee that the
26
code in its current state could be run end-to-end without intervention.
27
It's close, but probably not bulletproof.
28
29
1. geovalidate.sh
30
   - creates postgis DB and loads GADM2 data
31
2. geonames.sh
32
   - loads geonames.org data and adds some custom mapping logic
33
3. geonames-to-gadm.sql
34
   - contains SQL statements that build linkages between geonames.org
35
     names and GADM2 names
36
4. load-geoscrub-input.sh
37
   - dumps geoscrub_input from vegbien and loads it into the geoscrub db
38
5. geonames.sql
39
   - contains SQL statements that scrub asserted names and (to the
40
     extent possible) map them to GADM2
41
6. geovalidate.sql
42
   - contains (postgis-extended) SQL statements that score the validity
43
     of GADM2-scrubbed names against given point coordinates
44
45
The resulting 'geoscrub' table is what contains the scrubbed (i.e.,
46
GADM2-matched) names and various geovalidation scores.
47
48
Notes/Caveats/Todos:
49
* Clearly the SQL statements used in this procedure suffer from a lot of
50
  redundancy, and it might be worth trying to refactor once we're happy
51
  with the particular approach taken.
52
* Need to pull out more known notes/caveats/todos and highlight them :)