Project

General

Profile

1
BIEN geovalidation notes
2
========================
3

    
4
***** install 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
***** initialize the DB:
16
1. geovalidate.sh
17
   - creates postgis DB and loads GADM2 data
18
2. geonames.sh
19
   - loads geonames.org data and adds some custom mapping logic
20
3. geonames-to-gadm.sql
21
   - contains SQL statements that build linkages between geonames.org
22
     names and GADM2 names
23

    
24
***** geoscrub new data:
25
4. load-geoscrub-input.sh
26
   - dumps geoscrub_input from vegbien and loads it into the geoscrub db
27
5. geonames.sql
28
   - contains SQL statements that scrub asserted names and (to the
29
     extent possible) map them to GADM2
30
6. geovalidate.sql
31
   - contains (postgis-extended) SQL statements that score the validity
32
     of GADM2-scrubbed names against given point coordinates
33

    
34
[Also see comments embedded in specific scripts in this directory.]
35

    
36
The bash and SQL statements contained in the files as ordered below
37
should be applied to carry out geographic name scrubbing and
38
geovalidation on a given corpus of BIEN location records.
39

    
40
That said, given the tight deadline under which this was done in order
41
to produced a geovalidated BIEN3 corpus in advance of the Nov 2013
42
working group meeting, and the corresponding manner in which much of
43
this was actually executed piecemeal in an iterative and interactive
44
fashion within a bash shell and psql session, I can't guarantee that the
45
code in its current state could be run end-to-end without intervention.
46
It's close, but probably not bulletproof.
47

    
48
The resulting 'geoscrub' table is what contains the scrubbed (i.e.,
49
GADM2-matched) names and various geovalidation scores.
50

    
51
Notes/Caveats/Todos:
52
* Clearly the SQL statements used in this procedure suffer from a lot of
53
  redundancy, and it might be worth trying to refactor once we're happy
54
  with the particular approach taken.
55
* Need to pull out more known notes/caveats/todos and highlight them :)
(2-2/13)