project:bioosm:start
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
project:bioosm:start [2018/06/07 21:02] – sumie-dh | project:bioosm:start [2018/08/27 23:04] – sachy | ||
---|---|---|---|
Line 4: | Line 4: | ||
name=Biologicke zbrane ve vasem okoli| | name=Biologicke zbrane ve vasem okoli| | ||
image= bioosm: | image= bioosm: | ||
- | founder=[[user: | + | founder=[[user: |
- | interested=[[user: | + | interested=[[user: |
- | sw=CC| | + | sw=CC-BY-SA| |
hw=N/A| | hw=N/A| | ||
status=active}} | status=active}} | ||
Line 18: | Line 18: | ||
==== K cemu to je ==== | ==== K cemu to je ==== | ||
- | * interaktivni mapa vhodna k zobrazovani vetsiho mnozstvi fotek, brmlabi wiki, sluzby typu phtagr a soup se zdaly nevhodne k publikaci tohoto typu obsahu, wiki by byla prilis obludna, na beznych sdilecich obrazkovych sluzbach se neda nic pohodlne dohledavat a davat tam biologicky | + | * interaktivni mapa vhodna k zobrazovani vetsiho mnozstvi fotek, brmlabi wiki, sluzby typu phtagr a soup se zdaly nevhodne k publikaci tohoto typu obsahu, wiki by byla prilis obludna, na beznych sdilecich obrazkovych sluzbach se neda nic pohodlne dohledavat a davat tam biologicky |
* monitoring zivocichu a rostlin podle zajmu prispevovatelu | * monitoring zivocichu a rostlin podle zajmu prispevovatelu | ||
* snadne klikaci katalogovani nalezu skrze Tellico nevyzadujici coding skills | * snadne klikaci katalogovani nalezu skrze Tellico nevyzadujici coding skills | ||
* TODO - jednoduche selekce zajmoveho okruhu subjektu [napr. podle rodu, biotopu, datumu] na mape | * TODO - jednoduche selekce zajmoveho okruhu subjektu [napr. podle rodu, biotopu, datumu] na mape | ||
+ | * procvicovani temne magie commandu grep, sed a regexpu | ||
==== Jak to funguje ==== | ==== Jak to funguje ==== | ||
Line 27: | Line 28: | ||
Podklad jsou [[https:// | Podklad jsou [[https:// | ||
- | Jednotliva pozorovani jsou v databazi [[http:// | + | Jednotliva pozorovani jsou v databazi [[http:// |
+ | |||
+ | Pro nadsence je vygenerovany taky prehled prispevku plainlog.htm serazeny dle data pridani do databaze. | ||
Obrazky v plnem rozliseni jsou v podadresari " | Obrazky v plnem rozliseni jsou v podadresari " | ||
- | Pozorovani ktera se v mape zobrazi lze filtrovat dle prislusnosti k radu (bakterie, zvirata, rostliny, | + | Pozorovani ktera se v mape zobrazi lze filtrovat dle prislusnosti k radu (bakterie, zvirata, rostliny, |
=== Tellico sample database === | === Tellico sample database === | ||
Line 96: | Line 99: | ||
==== parse_tellico.sh ==== | ==== parse_tellico.sh ==== | ||
- | <code bash> | + | <code bash parse_tellico.sh> |
#!/bin/bash | #!/bin/bash | ||
# Parse Tellico database to BioOSM index.htm | # Parse Tellico database to BioOSM index.htm | ||
Line 102: | Line 105: | ||
# Print result to stdout | # Print result to stdout | ||
# | # | ||
- | # Generate minis in simg folder | ||
# find ./ -type f -exec mogrify -verbose -layers Dispose -resize 128\> | # find ./ -type f -exec mogrify -verbose -layers Dispose -resize 128\> | ||
# | # | ||
+ | # // vectorLayer.removeFeatures(atol) | ||
+ | # // map.removeLayer(vectorLayer) | ||
# | # | ||
# | # | ||
Line 114: | Line 118: | ||
rm -rfv " | rm -rfv " | ||
mkdir -p " | mkdir -p " | ||
- | #cat "./index_head.htm" | + | |
+ | ICON_animalia=" | ||
+ | ICON_bacteria=" | ||
+ | ICON_fungi=" | ||
+ | ICON_chromista=" | ||
+ | ICON_plantae=" | ||
+ | ICON_plostenkoid=" | ||
+ | ICON_protista=" | ||
+ | ICON_biohazard=" | ||
+ | |||
+ | json="" | ||
+ | |||
+ | # Return icon by Regnum | ||
+ | function geticon () { | ||
+ | case "$1" in | ||
+ | " | ||
+ | echo " | ||
+ | " | ||
+ | echo " | ||
+ | " | ||
+ | echo " | ||
+ | " | ||
+ | echo " | ||
+ | " | ||
+ | echo " | ||
+ | " | ||
+ | echo " | ||
+ | *) | ||
+ | echo " | ||
+ | esac | ||
+ | } | ||
+ | |||
+ | function safehtml () { | ||
+ | echo " | ||
+ | } | ||
+ | |||
+ | i=1 # GLOBAL increment must persist multiple spagety() calls; incremented to infinity | ||
+ | # Core function generating entries matching selection criteria (ie Kingdom) | ||
+ | # !!! BEZ ODSAZENI !!! | ||
+ | # $1 = list of entries | ||
+ | # $2 = layer name | ||
+ | # $3 = icon of the points | ||
+ | function spagety () { | ||
+ | |||
+ | bylo="" | ||
+ | sam="" | ||
+ | osam="" | ||
+ | spoj="" | ||
+ | ospoj="" | ||
+ | ox="" | ||
+ | oy="" | ||
+ | datelog="" | ||
+ | json=" | ||
+ | |||
+ | while IFS='' | ||
+ | co=$(echo " | ||
+ | co=$(safehtml " | ||
+ | obr=$(echo " | ||
+ | obr=$(safehtml " | ||
+ | kde=$(echo " | ||
+ | kde=$(safehtml " | ||
+ | kdex=$(echo " | ||
+ | kdex=$(safehtml " | ||
+ | kdey=$(echo " | ||
+ | kdey=$(safehtml " | ||
+ | kdy=$(echo " | ||
+ | kdy=$(safehtml " | ||
+ | skop_typ=$(echo " | ||
+ | skop_typ=$(safehtml " | ||
+ | skop=$(echo " | ||
+ | skop=$(safehtml " | ||
+ | imp=$(echo " | ||
+ | imp=$(safehtml " | ||
+ | reg=$(echo " | ||
+ | reg=$(safehtml " | ||
+ | phy=$(echo " | ||
+ | phy=$(safehtml " | ||
+ | cla=$(echo " | ||
+ | cla=$(safehtml " | ||
+ | ord=$(echo " | ||
+ | ord=$(safehtml " | ||
+ | fam=$(echo " | ||
+ | fam=$(safehtml " | ||
+ | gen=$(echo " | ||
+ | gen=$(safehtml " | ||
+ | spe=$(echo " | ||
+ | spe=$(safehtml " | ||
+ | loc=$(echo " | ||
+ | loc=$(safehtml " | ||
+ | des=$(echo " | ||
+ | des=$(safehtml " | ||
+ | vid=$(echo " | ||
+ | vid=$(safehtml " | ||
+ | bio=$(echo " | ||
+ | bio=$(safehtml " | ||
+ | eng=$(echo " | ||
+ | eng=$(safehtml " | ||
+ | obs=$(echo " | ||
+ | obs=$(safehtml " | ||
+ | lnk=$(echo " | ||
+ | lnk=$(safehtml " | ||
+ | detid=$(echo " | ||
+ | |||
+ | if [[ " | ||
+ | >& | ||
+ | continue; | ||
+ | fi | ||
+ | zkurvenetellico=$(echo " | ||
+ | if [[ " | ||
+ | >& | ||
+ | continue; | ||
+ | fi | ||
+ | |||
+ | if [[ " | ||
+ | wikisp=" | ||
+ | else | ||
+ | wikisp=" | ||
+ | fi | ||
+ | |||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | json=" | ||
+ | |||
+ | |||
+ | # Generate detail page | ||
+ | detid=$(echo " | ||
+ | detpg="< | ||
+ | detpg=" | ||
+ | detpg=" | ||
+ | detpg=" | ||
+ | detpg=" | ||
+ | detpg=" | ||
+ | detpg=" | ||
+ | if [[ " | ||
+ | detpg=" | ||
+ | fi | ||
+ | if [[ " | ||
+ | detpg=" | ||
+ | fi | ||
+ | if [[ " | ||
+ | detpg=" | ||
+ | fi | ||
+ | if [[ " | ||
+ | detpg=" | ||
+ | fi | ||
+ | if [[ " | ||
+ | detpg=" | ||
+ | fi | ||
+ | if [[ " | ||
+ | detpg=" | ||
+ | fi | ||
+ | if [[ " | ||
+ | detpg=" | ||
+ | fi | ||
+ | if [[ " | ||
+ | detpg=" | ||
+ | fi | ||
+ | detpg=" | ||
+ | if [[ " | ||
+ | detpg=" | ||
+ | fi | ||
+ | if [[ " | ||
+ | loc="< | ||
+ | fi | ||
+ | detpg=" | ||
+ | if [[ " | ||
+ | detpg=" | ||
+ | fi | ||
+ | if [[ " | ||
+ | detpg=" | ||
+ | fi | ||
+ | detpg=" | ||
+ | if [[ " | ||
+ | detpg=" | ||
+ | fi | ||
+ | if [[ " | ||
+ | detpg=" | ||
+ | fi | ||
+ | detpg=" | ||
+ | if [[ " | ||
+ | detpg=" | ||
+ | fi | ||
+ | if [[ " | ||
+ | detpg=" | ||
+ | fi | ||
+ | detpg=" | ||
+ | if [[ " | ||
+ | detpg=" | ||
+ | else | ||
+ | if [[ " | ||
+ | detyt=$(echo " | ||
+ | detpg=" | ||
+ | else | ||
+ | detpg=" | ||
+ | fi | ||
+ | fi | ||
+ | detpg=" | ||
+ | detpg=" | ||
+ | echo " | ||
+ | |||
+ | # Plain log of entries | ||
+ | datelog=" | ||
+ | |||
+ | >& | ||
+ | |||
+ | ox=" | ||
+ | oy=" | ||
+ | |||
+ | i=$(($i+1)) | ||
+ | |||
+ | done <<< | ||
+ | echo " | ||
+ | echo " | ||
+ | |||
+ | } # KONEC FCE SPAGETY | ||
+ | |||
# Parse Tellico file to list of entries | # Parse Tellico file to list of entries | ||
Line 121: | Line 364: | ||
# Sorted unique Kingdoms (to be passed as selection criteria) | # Sorted unique Kingdoms (to be passed as selection criteria) | ||
kingdoms=$(echo " | kingdoms=$(echo " | ||
- | |||
echo '< | echo '< | ||
Line 127: | Line 369: | ||
echo '< | echo '< | ||
echo ' | echo ' | ||
- | echo ' | + | echo ' |
echo ' | echo ' | ||
+ | echo ' | ||
echo ' | echo ' | ||
echo '</ | echo '</ | ||
+ | echo '< | ||
+ | # Generate select | ||
+ | echo "< | ||
+ | echo "< | ||
+ | ksel="< | ||
+ | ksel=" | ||
+ | while IFS='' | ||
+ | ksel=" | ||
+ | done <<< | ||
+ | ksel=" | ||
+ | echo " | ||
- | echo "<body>" | + | echo "Phylum: |
- | echo "<h1 id='title'>BioOSM - armis biologica in tuis vicinia</h1>" | + | echo "Classis: |
- | + | echo "Ordo: <select id='ord' onChange=' | |
- | # Generate select | + | echo "Familia: |
- | ksel="< | + | echo " |
- | ksel="$ksel<option value='ALL' | + | echo "Specie: <select id=' |
- | while IFS='' | + | echo "< |
- | ksel=" | + | #echo "< |
- | done <<< | + | echo "< |
- | ksel="$ksel</ | + | echo "< |
- | echo "Regnum: $ksel | " | + | echo "This site is owned by members of the <a href=' |
- | echo "< | + | |
- | + | ||
- | echo "<div id=' | + | |
echo "</ | echo "</ | ||
- | echo '< | + | echo "< |
echo 'map = new OpenLayers.Map(" | echo 'map = new OpenLayers.Map(" | ||
echo ' | echo ' | ||
Line 165: | Line 415: | ||
echo ' new OpenLayers.Geometry.Point(14.41876, | echo ' new OpenLayers.Geometry.Point(14.41876, | ||
echo ' | echo ' | ||
- | echo ' | + | echo ' |
echo ' | echo ' | ||
echo ' | echo ' | ||
Line 171: | Line 421: | ||
echo " | echo " | ||
+ | spagety " | ||
+ | echo '</ | ||
+ | echo '< | ||
+ | echo "</ | ||
- | i=1 # GLOBAL increment must persist multiple spagety() calls; incremented to infinity | + | # Create plaintext log |
- | # Core function generating entries matching selection criteria (ie Kingdom) | + | dateloghtm="< |
- | # !!! BEZ ODSAZENI !!! | + | dateloghtm=" |
- | # $1 = list of entries | + | dateloghtm=" |
- | # $2 = layer name | + | dateloghtm=" |
- | # $3 = icon of the points | + | dateloghtm=" |
- | function spagety | + | datelogsort=$(echo -e " |
+ | dateloghtm=" | ||
+ | dateloghtm=" | ||
+ | echo " | ||
+ | </ | ||
- | bylo="" | + | ==== bioosm.js ==== |
- | sam="" | + | |
- | osam="" | + | |
- | spoj="" | + | |
- | ospoj="" | + | |
- | ox="" | + | |
- | oy="" | + | |
- | while IFS='' | + | <code javascript bioosm.js> |
+ | var blob=JSON.parse(data) | ||
+ | var arma=blob.arma | ||
- | co=$(echo " | + | var vectorLayerDynamic |
- | obr=$(echo " | + | map.addLayer(vectorLayerDynamic); |
- | kde=$(echo " | + | |
- | kdex=$(echo " | + | |
- | kdey=$(echo " | + | |
- | kdy=$(echo " | + | |
- | skop_typ=$(echo | + | |
- | skop=$(echo " | + | |
- | imp=$(echo | + | |
- | reg=$(echo " | + | |
- | phy=$(echo " | + | |
- | cla=$(echo " | + | |
- | ord=$(echo " | + | |
- | fam=$(echo " | + | |
- | gen=$(echo " | + | |
- | spe=$(echo " | + | |
- | loc=$(echo " | + | |
- | des=$(echo " | + | |
- | vid=$(echo " | + | |
- | bio=$(echo " | + | |
- | eng=$(echo " | + | |
- | obs=$(echo " | + | |
+ | var regsel=document.getElementById(" | ||
+ | var physel=document.getElementById(" | ||
+ | var clasel=document.getElementById(" | ||
+ | var ordsel=document.getElementById(" | ||
+ | var famsel=document.getElementById(" | ||
+ | var gensel=document.getElementById(" | ||
+ | var spesel=document.getElementById(" | ||
- | if [[ "$kdex" = "" | + | var ICON_animalia="animalia.png" |
- | >&2 echo $(echo " | + | var ICON_bacteria="bacteria.png" |
- | continue; | + | var ICON_fungi="fungi.png" |
- | fi | + | var ICON_chromista="chromista.png" |
- | zkurvenetellico=$(echo | + | var ICON_plantae="plantae.svg" |
- | if [[ "$zkurvenetellico" = ".jpeg" | + | var ICON_plostenkoid="plostenkoid.png" |
- | >&2 echo "$obr $co" | + | var ICON_protista="protista.png" |
- | continue; | + | var ICON_biohazard=" |
- | fi | + | |
- | + | // Return icon by Regnum | |
- | # Generate detail page | + | function geticon |
- | detid=$(echo " | + | { |
- | detpg="< | + | var r="" |
- | detpg="$detpg< | + | if(document.getElementById(" |
- | detpg=" | + | r=document.getElementById("reg").value |
- | detpg=" | + | |
- | detpg=" | + | |
- | detpg=" | + | |
- | detpg=" | + | |
- | if [[ " | + | |
- | detpg=" | + | |
- | fi | + | |
- | if [[ "$reg" | + | |
- | detpg=" | + | |
- | fi | + | |
- | if [[ " | + | |
- | detpg=" | + | |
- | fi | + | |
- | if [[ " | + | |
- | detpg=" | + | |
- | fi | + | |
- | if [[ " | + | |
- | detpg=" | + | |
- | fi | + | |
- | if [[ " | + | |
- | detpg=" | + | |
- | fi | + | |
- | if [[ " | + | |
- | detpg=" | + | |
- | fi | + | |
- | if [[ " | + | |
- | detpg=" | + | |
- | fi | + | |
- | detpg=" | + | |
- | if [[ " | + | |
- | detpg=" | + | |
- | fi | + | |
- | detpg=" | + | |
- | if [[ " | + | |
- | detpg=" | + | |
- | fi | + | |
- | if [[ " | + | |
- | detpg=" | + | |
- | fi | + | |
- | detpg=" | + | |
- | if [[ " | + | |
- | detpg=" | + | |
- | fi | + | |
- | if [[ " | + | |
- | detpg=" | + | |
- | fi | + | |
- | detpg=" | + | |
- | if [[ " | + | |
- | detpg=" | + | |
- | fi | + | |
- | if [[ " | + | |
- | detpg=" | + | |
- | fi | + | |
- | detpg=" | + | |
- | if [[ " | + | |
- | detpg=" | + | |
else | else | ||
- | if [[ " | + | { |
- | detyt=$(echo " | + | r=a[i].regnum |
- | detpg="$detpg< | + | for(var e=i;e>=0 && a[e].locus==a[i].locus;e--) |
- | else | + | if(a[e].regnum!=a[i].regnum) |
- | detpg=" | + | { |
- | fi | + | r="ALL"; |
- | fi | + | break; |
- | detpg=" | + | } |
- | detpg=" | + | } |
- | echo " | + | |
- | # Pokracujem v hadovi | + | switch (r) |
- | if [[ " | + | { |
- | sam=""; | + | case "Animalia": |
- | spoj="$spoj< | + | return ICON_animalia; |
- | if [[ "$obr" | + | case "Bacteria": |
- | spoj=" | + | return ICON_bacteria; |
- | else | + | case "Fungi": |
- | spoj="$spoj< | + | return ICON_fungi; |
- | fi | + | case "Chromista": |
- | spoj="$spoj< | + | return ICON_chromista; |
- | spoj=" | + | case "Plantae": |
- | ox="$kdex" | + | return ICON_plantae; |
- | oy=" | + | case "Protista": |
- | continue; | + | return ICON_protista; |
- | fi | + | default: |
+ | return ICON_biohazard | ||
+ | } | ||
+ | } | ||
- | # Bud prvni zaznam, nebo zmena pozice | + | function genphy() { |
+ | physel.innerHTML="< | ||
+ | clasel.innerHTML="< | ||
+ | ordsel.innerHTML="< | ||
+ | famsel.innerHTML="< | ||
+ | gensel.innerHTML="< | ||
+ | spesel.innerHTML="< | ||
- | # Predchozi pozice jen 1 zaznam? | + | var phyarr=[] |
- | if [[ " | + | for (var i=0; |
- | echo "var n$i = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point($ox, | + | { |
- | echo " | + | if(regsel.value==arma[i].regnum && arma[i].phynum!="" |
- | spoj="" | + | phyarr.push(arma[i].phylum) |
- | sam="" | + | } |
- | fi # ELSE vytvori prazdny radek | + | phyarr.sort() |
- | # Predchozi pozice vic zaznamu? | + | for (var i=0; |
- | if [[ " | + | { |
- | echo "var n$i = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point($ox, | + | if(i==0) |
- | echo " | + | { |
- | spoj="" | + | physel.innerHTML+="< |
- | sam="" | + | continue |
- | fi | + | } |
+ | if(phyarr[i]!=phyarr[i-1]) | ||
+ | physel.innerHTML+="<option>"+phyarr[i]+"</option>" | ||
+ | } | ||
+ | armageddon() // Populate the map with monsters... | ||
+ | } | ||
- | bylo=" | + | function gencla() { |
- | spoj="<tr><td><a href=\" | + | clasel.innerHTML="<option>ALL</option>" |
- | if [[ " | + | ordsel.innerHTML="<option>ALL</option>" |
- | spoj=" | + | famsel.innerHTML="<option>ALL</option>" |
- | else | + | gensel.innerHTML="<option>ALL</option>" |
- | spoj=" | + | spesel.innerHTML="< |
- | fi | + | |
- | spoj="$spoj<td>$co< | + | |
- | spoj="$spoj</tr>" | + | |
- | sam="<a href=\" | + | var claarr=[] |
- | sam=" | + | for (var i=0;i<arma.length-1; |
- | if [[ " | + | { |
- | sam="$sam<b> | + | if(physel.value==arma[i].phylum && arma.classis!="" |
- | fi | + | claarr.push(arma[i].classis) |
- | if [[ " | + | } |
- | sam=" | + | claarr.sort() |
- | fi | + | for (var i=0;i<claarr.length;i++) |
- | if [[ " | + | { |
- | sam=" | + | if(i==0) |
- | fi | + | { |
- | if [[ " | + | clasel.innerHTML+="<option>"+claarr[0]+"</option>" |
- | sam=" | + | continue |
- | fi | + | } |
- | if [[ " | + | if(claarr[i]!=claarr[i-1]) |
- | sam=" | + | clasel.innerHTML+="<option>"+claarr[i]+"</option>" |
- | fi | + | } |
- | if [[ " | + | armageddon() |
- | sam=" | + | } |
- | fi | + | |
- | if [[ " | + | |
- | sam=" | + | |
- | fi | + | |
- | if [[ " | + | |
- | sam=" | + | |
- | fi | + | |
- | if [[ " | + | |
- | sam=" | + | |
- | fi | + | |
- | if [[ " | + | |
- | sam=" | + | |
- | fi | + | |
- | sam="$sam<b> | + | |
- | if [[ " | + | |
- | sam="$sam< | + | |
- | fi | + | |
- | if [[ " | + | |
- | sam=" | + | |
- | fi | + | |
- | if [[ " | + | |
- | sam="$sam<b> | + | |
- | fi | + | |
- | # if [[ " | + | |
- | # sam="$sam< | + | |
- | # fi | + | |
- | if [[ " | + | |
- | sam=" | + | |
- | fi | + | |
- | sam=" | + | |
- | #>&2 echo "$sam" | + | function genord() { |
- | >&2 echo "$co $obs" | + | ordsel.innerHTML="< |
+ | famsel.innerHTML="< | ||
+ | gensel.innerHTML="< | ||
+ | spesel.innerHTML="< | ||
+ | var ordarr=[] | ||
+ | for (var i=0; | ||
+ | { | ||
+ | if(clasel.value==arma[i].classis | ||
+ | ordarr.push(arma[i].ordo) | ||
+ | } | ||
+ | ordarr.sort() | ||
+ | for (var i=0; | ||
+ | { | ||
+ | if(i==0) | ||
+ | { | ||
+ | ordsel.innerHTML+="< | ||
+ | continue | ||
+ | } | ||
+ | if(ordarr[i]!=ordarr[i-1]) | ||
+ | ordsel.innerHTML+="< | ||
+ | } | ||
+ | armageddon() // Populate the map with monsters... | ||
+ | } | ||
+ | function genfam() { | ||
+ | famsel.innerHTML="< | ||
+ | gensel.innerHTML="< | ||
+ | spesel.innerHTML="< | ||
+ | var famarr=[] | ||
+ | for (var i=0; | ||
+ | { | ||
+ | if(ordsel.value==arma[i].ordo && arma[i].familia!="" | ||
+ | famarr.push(arma[i].familia) | ||
+ | } | ||
+ | famarr.sort() | ||
+ | for (var i=0; | ||
+ | { | ||
+ | if(i==0) | ||
+ | { | ||
+ | famsel.innerHTML+="< | ||
+ | continue | ||
+ | } | ||
+ | if(famarr[i]!=famarr[i-1]) | ||
+ | famsel.innerHTML+="< | ||
+ | } | ||
+ | armageddon() // Populate the map with monsters... | ||
+ | } | ||
- | ox="$kdex" | + | function gengen() { |
- | oy="$kdey" | + | gensel.innerHTML="< |
+ | spesel.innerHTML="< | ||
+ | var genarr=[] | ||
+ | for (var i=0; | ||
+ | { | ||
+ | if(famsel.value==arma[i].familia && arma[i].genus!="" | ||
+ | genarr.push(arma[i].genus) | ||
+ | } | ||
+ | genarr.sort() | ||
+ | for (var i=0; | ||
+ | { | ||
+ | if(i==0) | ||
+ | { | ||
+ | gensel.innerHTML+="< | ||
+ | continue | ||
+ | } | ||
+ | if(genarr[i]!=genarr[i-1]) | ||
+ | gensel.innerHTML+="< | ||
+ | } | ||
+ | //genspe() // ...and here we go | ||
+ | armageddon() // Populate the map with monsters... | ||
+ | } | ||
+ | function genspe() | ||
+ | { | ||
+ | spesel.innerHTML="< | ||
+ | var spearr=[] | ||
+ | for (var i=0; | ||
+ | { | ||
+ | if(gensel.value==arma[i].genus && arma[i].specie!="" | ||
+ | spearr.push(arma[i].specie) | ||
+ | } | ||
+ | spearr.sort() | ||
+ | for (var i=0; | ||
+ | { | ||
+ | if(i==0) | ||
+ | { | ||
+ | spesel.innerHTML+="< | ||
+ | continue | ||
+ | } | ||
+ | if(spearr[i]!=spearr[i-1]) | ||
+ | spesel.innerHTML+="< | ||
+ | } | ||
+ | armageddon() // Populate the map with monsters... | ||
+ | } | ||
- | i=$(($i+1)) | + | function armageddon() |
+ | { | ||
+ | var speval=document.getElementById(" | ||
+ | var genval=document.getElementById(" | ||
+ | var famval=document.getElementById(" | ||
+ | var ordval=document.getElementById(" | ||
+ | var claval=document.getElementById(" | ||
+ | var phyval=document.getElementById(" | ||
+ | var regval=document.getElementById(" | ||
+ | var a=[] | ||
- | # Precti XML, vyfiltruj jen to co ma prijit do mapy a serad to dle umisteni | + | if(speval!=" |
- | # Umisteni je razene kvuli vic vzorkum z jednoho mista | + | { |
+ | for(var i=0; | ||
+ | if(arma[i].specie==speval && arma[i].genus==genval) // Check genus because of unknown " | ||
+ | a.push(arma[i]) | ||
+ | } | ||
+ | else if(genval!=" | ||
+ | { | ||
+ | for(var i=0; | ||
+ | if(arma[i].genus==genval) | ||
+ | a.push(arma[i]) | ||
+ | } | ||
+ | else if(famval!=" | ||
+ | { | ||
+ | for(var i=0; | ||
+ | if(arma[i].familia==famval) | ||
+ | a.push(arma[i]) | ||
+ | } | ||
+ | else if(ordval!=" | ||
+ | { | ||
+ | for(var i=0; | ||
+ | if(arma[i].ordo==ordval) | ||
+ | a.push(arma[i]) | ||
+ | } | ||
+ | else if(claval!=" | ||
+ | { | ||
+ | for(var i=0; | ||
+ | if(arma[i].classis==claval) | ||
+ | a.push(arma[i]) | ||
+ | } | ||
+ | else if(phyval!=" | ||
+ | { | ||
+ | for(var i=0; | ||
+ | if(arma[i].phylum==phyval) | ||
+ | a.push(arma[i]) | ||
+ | } | ||
+ | else if(regval!=" | ||
+ | { | ||
+ | for(var i=0; | ||
+ | if(arma[i].regnum==regval) | ||
+ | a.push(arma[i]) | ||
+ | } | ||
+ | else // Regnum: ALL | ||
+ | { | ||
+ | for(var i=0; | ||
+ | a.push(arma[i]) | ||
+ | } | ||
- | done <<< | + | icongeddon(a) |
+ | } | ||
- | # Do not forget to print last line when WHILE ends! | + | function buggy() |
- | if [[ "$sam" = "" | + | { |
- | sam="< | + | var p=[] |
- | fi | + | for(var i=0; |
- | echo "var n$i = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point($kdex, | + | { |
- | echo "$2.addFeatures(n$i);" | + | if(arma[i].regnum=="" |
+ | | ||
+ | | ||
+ | arma[i].ordo=="" | ||
+ | | ||
+ | | ||
+ | p.push(arma[i]) | ||
+ | } | ||
+ | icongeddon(p) | ||
+ | } | ||
- | } # KONEC FCE SPAGETY !!! | + | function plostenkoidy() |
+ | { | ||
+ | var p=[] | ||
+ | for(var i=0; | ||
+ | { | ||
+ | if(arma[i].phylum==" | ||
+ | p.push(arma[i]) | ||
+ | } | ||
+ | icongeddon(p) | ||
+ | } | ||
- | echo "var ALL = new OpenLayers.Layer.Vector(' | + | function icongeddon(a) |
- | spagety " | + | { |
- | echo "map.addLayer(ALL);" | + | //alert(a.length) |
+ | while(map.popups.length) | ||
+ | map.removePopup(map.popups[0]) | ||
+ | vectorLayerDynamic.destroyFeatures() | ||
- | echo "var laycon | + | var bylo="" |
- | while IFS='' | + | var sam="" |
- | echo "var $spag = new OpenLayers.Layer.Vector(' | + | var osam="" |
- | spg=$(echo | + | var spoj="" |
- | case "$spag" in | + | var ospoj="" |
- | "Animalia") | + | var ox="" |
- | icon="animalia.png";; | + | var oy="" |
- | "Bacteria") | + | var datelog="" |
- | icon="bacteria.png";; | + | var i=0 // Iterator over a[] (needed after FOR) |
- | "Fungi") | + | var n=[] // New points in the layer |
- | icon=" | + | var muchicons=0 // How much Regnum' |
- | " | + | var samicon=ICON_biohazard // Icon |
- | icon=" | + | var spojicon=ICON_biohazard // Icon |
- | " | + | |
- | icon=" | + | |
- | " | + | |
- | icon=" | + | |
- | *) | + | |
- | icon=" | + | |
- | esac | + | |
- | spagety | + | for(; |
- | echo "laycon.push($spag);" | + | { |
- | done <<< | + | // Pokracujem v hadovi |
+ | if(a[i].locus == bylo) | ||
+ | { | ||
+ | sam="" | ||
+ | spoj+="< | ||
+ | spoj+='< | ||
+ | if(a[i].obr != "" | ||
+ | spoj+='< | ||
+ | else | ||
+ | spoj+=' | ||
+ | spoj+="<td>"+a[i].qualis+"< | ||
+ | spoj+="</ | ||
+ | ox=a[i].x | ||
+ | oy=a[i].y | ||
+ | continue; | ||
+ | } | ||
- | # Plostenky | + | if(a[i].specie=="sp.") |
- | spg=$(echo | + | wikisp="https://en.wikipedia.org/ |
- | echo "var Platyhelminthes = new OpenLayers.Layer.Vector(' | + | else |
- | spagety " | + | wikisp="https://en.wikipedia.org/wiki/" |
- | echo "laycon.push(Platyhelminthes)" | + | |
+ | // Bud prvni zaznam, nebo zmena pozice | ||
- | echo "var controls | + | // Predchozi pozice jen 1 zaznam? |
- | echo " selector: | + | if(sam != "" |
- | echo "};" | + | { |
- | echo "map.addControl(controls[' | + | samicon=geticon(a, |
- | echo "controls['selector'].activate();" | + | n[i] = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(ox, |
+ | vectorLayerDynamic.addFeatures(n[i]); | ||
+ | spoj=" | ||
+ | sam="" | ||
+ | } // ELSE vytvori prazdny radek | ||
+ | // Predchozi pozice vic zaznamu? | ||
+ | if(spoj!="" | ||
+ | { | ||
+ | spojicon=geticon(a, | ||
+ | n[i] = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(ox, | ||
+ | vectorLayerDynamic.addFeatures(n[i]); | ||
+ | spoj="" | ||
+ | sam="" | ||
+ | } | ||
+ | bylo=a[i].locus | ||
+ | spoj='< | ||
+ | if(a[i].obr != "" | ||
+ | spoj+='< | ||
+ | else | ||
+ | spoj+='< | ||
+ | spoj+='< | ||
+ | spoj+="</ | ||
+ | sam='< | ||
+ | sam+='< | ||
+ | sam+='< | ||
+ | if(a[i].imperium != "" | ||
+ | sam+='< | ||
+ | if(a[i].regnum != "" | ||
+ | sam+='< | ||
+ | if(a[i].phylum != "" | ||
+ | sam+='< | ||
+ | if(a[i].classis != "" | ||
+ | sam+='< | ||
+ | if(a[i].ordo != "" | ||
+ | sam+='< | ||
+ | if(a[i].familia != "" | ||
+ | sam+='< | ||
+ | if(a[i].genus != "" | ||
+ | sam+='< | ||
+ | if(a[i].specie != "" | ||
+ | sam+='< | ||
+ | if(a[i].bio != "" | ||
+ | sam+="< | ||
+ | if(a[i].quando != "" | ||
+ | sam+="< | ||
+ | sam+="< | ||
+ | if(a[i].spec != "" | ||
+ | | ||
+ | if(a[i].micro != "" | ||
+ | sam+="< | ||
+ | if(a[i].amp != "" | ||
+ | sam+="< | ||
+ | /* if [[ " | ||
+ | # | ||
+ | # fi */ | ||
+ | if(a[i].vid != "" | ||
+ | sam+='< | ||
+ | sam+="</ | ||
+ | ox=a[i].x | ||
+ | oy=a[i].y | ||
+ | } // Konec prochazeni a[] | ||
- | echo " | + | // Do not forget to print last line when FOR ends! |
- | echo " | + | samicon=geticon(a,i-1) |
- | echo " | + | if(sam == "" |
- | echo " | + | sam='<table style="hadtbl">' |
- | echo " '<div class=\"markerContent\">' | + | |
- | echo " | + | |
- | echo " | + | |
- | echo " | + | |
- | echo " | + | |
- | echo " | + | |
- | echo " | + | |
- | echo " | + | |
- | echo " | + | n[i]=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(a[i-1].x, |
- | echo " | + | vectorLayerDynamic.addFeatures(n[i]); |
- | echo " feature.popup = null;" | + | |
- | echo "}" | + | |
+ | } // Konec armageddonu | ||
- | echo " | + | var laycon |
- | echo " | + | |
- | echo " | + | |
- | echo " for (var i = map.layers.length - 1; i >= 1; i--) {" | + | |
- | echo " | + | |
- | echo " | + | |
- | echo " | + | |
- | echo " | + | |
- | echo " | + | var controls |
- | echo " for (var i=map.layers.length-1;i> | + | map.addControl(controls[' |
- | echo " map.removeLayer(map.layers[i]);" | + | controls[' |
- | echo " | + | |
- | echo " map.addLayer(Platyhelminthes)" | + | |
- | echo " | + | |
+ | function createPopup(feature) | ||
+ | { | ||
+ | feature.popup = new OpenLayers.Popup.FramedCloud(' | ||
+ | feature.geometry.getBounds().getCenterLonLat(), | ||
+ | null, | ||
+ | '< | ||
+ | null, | ||
+ | false, // Close button? | ||
+ | function() { controls[' | ||
+ | ); | ||
+ | // | ||
+ | map.addPopup(feature.popup); | ||
+ | } | ||
- | echo "</script>" | + | function destroyPopup(feature) { |
- | echo "</html>" | + | feature.popup.destroy(); |
+ | feature.popup = null; | ||
+ | } | ||
+ | |||
+ | // Run armageddon on initial load | ||
+ | armageddon() | ||
+ | </code> | ||
+ | |||
+ | ==== Taxonomie dle rodoveho jmena ==== | ||
+ | |||
+ | Script bere jako jediny parametr rodove jmeno a z wikipedie vyparsuje zbytek taxonomie. | ||
+ | <code bash tax.sh> | ||
+ | # | ||
+ | |||
+ | wat=$(wget -q -O - "https:// | ||
+ | |||
+ | echo $(echo " | ||
+ | echo $(echo " | ||
+ | echo $(echo " | ||
+ | echo $(echo " | ||
+ | echo $(echo " | ||
+ | echo $(echo " | ||
+ | echo $(echo " | ||
</ | </ |
project/bioosm/start.txt · Last modified: 2023/09/21 12:15 by sachy