aboutsummaryrefslogtreecommitdiff
path: root/data_tol_old/genTestImgs.sh
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-04-25 01:33:08 +1000
committerTerry Truong <terry06890@gmail.com>2022-04-25 01:33:08 +1000
commit2ab48497797441164e7f57fca2660097d93398ca (patch)
treea6f22d3edff60d182de454359bc40beda82fb5d8 /data_tol_old/genTestImgs.sh
parent23436a9ad4c2a710c7f0d49a07a720e0153d8225 (diff)
Adapt to handle open-tree-of-life data
Added data_otol/ with script that converts data from 'Open Tree of Life' release 13.4 into a JSON form. Moved old tree-of-life data and images into data_tol_old/. Added TolMap type to tol.ts, changed TolNode, and adapted other code to handle it. Temporarily disabling tile images until image data is added.
Diffstat (limited to 'data_tol_old/genTestImgs.sh')
-rwxr-xr-xdata_tol_old/genTestImgs.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/data_tol_old/genTestImgs.sh b/data_tol_old/genTestImgs.sh
new file mode 100755
index 0000000..21b001b
--- /dev/null
+++ b/data_tol_old/genTestImgs.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -e
+
+#generate tol.json from tol.txt
+cat tolData.txt | ./txtTreeToJSON.py > tolData.json
+
+#reads through tolData.json, gets names, and generates image for each name
+cat tolData.json | \
+ gawk 'match ($0, /"name"\s*:\s*"([^"]*)"/, arr) {print arr[1]}' | \
+ while read; do
+ convert -size 200x200 xc:khaki +repage \
+ -size 150x150 -fill black -background None \
+ -font Ubuntu-Mono -gravity center caption:"$REPLY" +repage \
+ -gravity Center -composite -strip ../public/img/"$REPLY".png
+ done
+