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