# islands/makefile -- island geographic and population comparisons # Copyright : http://www.fsf.org/copyleft/gpl.html # Author : Dan Jacobson -- http://jidanni.org/geo/islands/ # Created On : Fri May 21 03:24:58 2004 # Last Modified On: Sat Jan 28 08:17:10 2006 # Update Count : 78 # Sloppy Makefile used on GNU/Linux # How big is Taiwan compared to other islands of the world? TI=/tmp/islands $(TI): lynx -width=333 -dump -nolist http://islands.unep.ch/Tiarea.htm>$@ i_perecent:$(TI) echo % --- Taiwan is % as big as perl -wne 'if(s{^\s+([0-9.]+)\s+sq\.km\.\s+(.*)}\ {(sprintf"%.0f",3450660/$$1)." ".$$2}e){s/ +/ /g;print}' $?|tac i_perecent2:$(TI) echo % --- island is % as big as Taiwan perl -wne 'if(s{^\s+([0-9.]+)\s+sq\.km\.\s+(.*)}\ {(sprintf"%.0f",$$1/345.066)." ".$$2}e){s/ +/ /g;print}' $?|tac i_perecent3:$(TI) #GOOD, as quoted on my web page echo X --- island is X times as big as Taiwan perl -wne 'if(s{^\s+([0-9.]+)\s+sq\.km\.\s+(.*)}\ {(sprintf"%.2f",$$1/34506.6)." ".$$2}e){s/ +/ /g;print}' $?|tac #World island population related; R=s/Java/Jawa/;s/Sumatra/Sumatera/;s/Celebes/Sulawesi/;s/Sicily/Sicilia/;\ s/Sardinia/Sardegna/;s/_Dao$$//;s/_I\.$$// i_by_areaC:#C=Calder #note, jcalder stuff now on http://www.worldislandinfo.com/ ... lynx -nolist -dump http://users.erols.com/jcalder/LARGESTV1.html|\ perl -nlwe 's/^ +//;next unless/^\d/;if(/^\d+\. /)$(\ ){s/,.*//;s/^\d+\. //;s/ /_/g;$R;$$name=$$_;$$c=-1;next}$(\ )else{$$c++;next unless $$c;s/,//g}print "$$_ $$name"'|sort -k 2 >$@ manual='79.2 Hong_Kong\n521 Montreal_Ile\n3629 Long_Island\n57 Manhattan\n\ 1585 Dakhin_Shahbazpur\n16 Zhongchan\n436 Salsette' #manual but still most from Calder i_by_area: $(TI) perl -wne 'if(/Flores/&&!/Indonesia/){next}$(\ )if(s{^\s+([0-9.]+)\s+sq\.km\.\s+(.*)}$(\ ){$$1 $$2}){s/ ?\(.*//;s/ /_/g;s/_/ /;$(\ )s/_Dao//;s/Formosa/Taiwan/;print}' $(TI)|{ cat;echo -e $(manual);}|\ tee /tmp/o|sort -k 2 >$@ i_by_population: #he uses >1 million, so will we. #Note: jcalder stuff now on http://www.worldislandinfo.com/ lynx -nolist -dump http://users.erols.com/jcalder/POPULATV2.htm|\ perl -nlwe 's/,//g;s/^ +//;if(s/^\d+\. //)$(\ ){s/ +\(.*//;s/ /_/g;$R;$(\ )$$name=$$_}elsif(/\d+$$/)$(\ ){print "$$_ $$name"}exit if/MENU/'|sort -k 2 >$@ population_density.txt: i_by_area i_by_population #GOOD echo Population density of islands with over 1 million people on them,>$@ echo ranked by persons per square kilometer>>$@ join -j 2 $^|perl -nawe 'printf "%3.0f %s\n",$$F[2]/$$F[1],$$F[0]'|\ sort -nr>>$@ >>$@ echo Flimsy attempt by DJ, http://jidanni.org/geo/islands/ \ `date +%Y-%m-%d` check: i_by_area i_by_population join -j 2 $^|perl -nawe 'printf "%3.0f %.0f %.0f %s\n",$(\ )$$F[2]/$$F[1],$$F[1],$$F[2],$$F[0]'|sort -nr i_by_densityC: i_by_areaC i_by_population join -j 2 $^|perl -nawe 'printf "%3.0f %s\n",$$F[2]/$$F[1],$$F[0]'|\ sort -nr i_unmatched: i_by_population i_by_area join -j 2 -v 1 $^|sort i_unmatchedC: i_by_population i_by_areaC join -j 2 -v 1 $^|sort i_unmatchedCx: i_by_population i_by_area join -j 2 -v 1 -v 2 $^|sort all_area: $(TI) i_by_areaC sort -rbn $^ #http://www.worldislandinfo.com/ #http://home.comcast.net/~igpl/Landmasses.html #At one time I thought population**2/area might be a useful statistic: i_by_density_product: i_by_area i_by_population join -j 2 $^|perl -nawe 'printf "%.0f %s\n",$$F[2]**2/$$F[1],$$F[0]'|\ sort -nr W=$$HOME/jidanni.org/geo/islands update_makefile_etc: $W/programs/makefile $W/population_density.txt $W/programs/makefile:makefile cp -v $? $@ $W/population_density.txt:population_density.txt cp -v $? $@ clean: rm i_by_area i_by_population population_density.txt #2004.11: Furthest point from any land and islands swim: # pscoast -R-88/88/-180/180 -Jw180/0.01i -W33p -P > swim.ps pscoast -R-60/60/-180/180 -M -Dc -W1 > coastlines.d grdmath -R-60/60/-180/180 -I1 -fg -V coastlines.d LDIST = dist_in_km.grd # convert $@.ps $@.pdf # xpdf $@.pdf # gv $@.ps #not finished #http://wegener.mechanik.tu-darmstadt.de/GMT-Help/Archiv/7920.html