update all
update all

--- a/rivers_QA/check_river.sh
+++ b/rivers_QA/check_river.sh
@@ -1,4 +1,6 @@
 #!/bin/bash
+
+source settings.sh
 
 python3 check_river.py $1 >> errors.csv
 rm $1

--- a/rivers_QA/export_all_rivers.sh
+++ b/rivers_QA/export_all_rivers.sh
@@ -1,9 +1,9 @@
 #!/bin/bash
 
+source settings.sh
 
-OSM_BIN=/media/ssd/osm-3s_v0.7.52/bin
-BULKUTILS=../bulkupload
 
+> $TMP_BUF_UPDATE
 
 ODIR=out/
 
@@ -14,8 +14,8 @@
 rm -rf $ODIR/*
 #rm -rf $ODIROSC/*
 
-YFROM=36
-YTO=70
+YFROM=-66
+YTO=66
 TSTEP=2
 for Y in `seq $YFROM $TSTEP $YTO`; do
 	for X in `seq -180 $TSTEP 180`; do
@@ -43,12 +43,11 @@
 EOF
 		fsize=$(wc -c <"$EXNAME")
 		if [ $fsize -gt 251 ]; then
-			./check_river.sh $EXNAME >> errors.csv
-		else
-			rm $EXNAME
+			./check_river.py $EXNAME >> $TMP_BUF_UPDATE
 		fi
+		rm $EXNAME
 	done
-	cat errors.csv | sort -h | uniq > uniq_errors.csv
+	cat $TMP_BUF_UPDATE | sort -h | uniq > $ERRORS_FILE
 	./generate_html.sh
 	echo "Progress: $Y/$YTO"
 done

--- a/rivers_QA/generate_html.sh
+++ b/rivers_QA/generate_html.sh
@@ -1,5 +1,8 @@
 #!/bin/bash
-cat header.html > ../results/rivers.html
-python3 disp_html.py >> ../results/rivers.html
-cat footer.html >> ../results/rivers.html
+source settings.sh
 
+cat header.html > $HTML_OUT
+python3 disp_html.py >> $HTML_OUT
+echo "Last update: $(date -u)<br>" >> $HTML_OUT
+cat footer.html >> $HTML_OUT
+

--- /dev/null
+++ b/rivers_QA/settings.sh
@@ -1,1 +1,8 @@
+#!/bin/bash
 
+OSM_BIN=/media/ssd/osm-3s_v0.7.52/bin
+
+HTML_OUT=../results/rivers.html
+TMP_BUF_UPDATE=updated.csv
+ERRORS_FILE=uniq_errors.csv
+

--- a/rivers_QA/update_river.sh
+++ b/rivers_QA/update_river.sh
@@ -1,8 +1,10 @@
 #!/bin/bash
+
+source settings.sh
+
 riverid=$1
 echo my riverid is $riverid
 
-OSM_BIN=/media/ssd/osm-3s_v0.7.52/bin
 ODIR=out/
 OFILE=updated.csv
 
@@ -14,7 +16,7 @@
 >;
 out meta;
 EOF
-python3 check_river.py $EXNAME >> $OFILE
+python3 check_river.py $EXNAME >> $TMP_BUF_UPDATE
 rm $EXNAME
 
 

--- a/rivers_QA/update_rivers.sh
+++ b/rivers_QA/update_rivers.sh
@@ -1,27 +1,17 @@
 #!/bin/bash
+
+source settings.sh
 
 
 IFILE=errors.csv
 OFILE=updated.csv
 
-> $OFILE
+> $TMP_BUF_UPDATE
 
-#for line in `cat $IFILE | sort -h | uniq`; do
-#	river_way=$(echo $line | cut -d, -f1)
-#	EXNAME=$ODIR$river_way.osm
-#	echo $EXNAME
-#	$OSM_BIN/osm3s_query > $EXNAME 2>/dev/null << EOF
-#	way($river_way);
-#	out meta;
-#	>;
-#	out meta;
-#EOF
-##	cat $EXNAME
-#	python3 check_river.py $EXNAME >> $OFILE
-#	rm $EXNAME
-#done
 
-cat $IFILE | sort -h | uniq | cut -d, -f1 | parallel ./update_river.sh
+cat $ERRORS_FILE | sort -h | uniq | cut -d',' -f1 | parallel ./update_river.sh
+
+mv $TMP_BUF_UPDATE $ERRORS_FILE
 
 exit
 

file:b/update_all.sh (new)
--- /dev/null
+++ b/update_all.sh
@@ -1,1 +1,5 @@
+#!/bin/bash
 
+./nclakes/update_lakes.sh
+./rivers_QA/update_rivers.sh
+