User Tools

Site Tools


project:bioosm:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
project:bioosm:start [2018/06/07 19:40] sumie-dhproject:bioosm:start [2018/07/12 09:51] – Ruzne ikony i pro celkovou mapu sachy
Line 3: Line 3:
 {{template>:project:infobox| {{template>:project:infobox|
 name=Biologicke zbrane ve vasem okoli| name=Biologicke zbrane ve vasem okoli|
-image= bioosm:bioosm.jpg?200 |+image= bioosm:bioosm.jpg?400 |
 founder=[[user:sachy:start]]| founder=[[user:sachy:start]]|
-interested=[[user:sumie]]|+interested=[[user:sumie-dh]]|
 sw=CC| sw=CC|
 hw=N/A| hw=N/A|
Line 15: Line 15:
  
 [[http://brmlab.s0c4.net/bioosm/|BioOSM]] je mapa vyskytu mikroorganismu (ras, bakterii, plostenek, ...) a do budoucna i dalsich prirodnin (mineralu, ...). [[http://brmlab.s0c4.net/bioosm/|BioOSM]] je mapa vyskytu mikroorganismu (ras, bakterii, plostenek, ...) a do budoucna i dalsich prirodnin (mineralu, ...).
 +
 +==== 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 smysluplne a prehledne popisky
 +  *  monitoring zivocichu a rostlin podle zajmu prispevovatelu 
 +  *  snadne klikaci katalogovani nalezu skrze Tellico nevyzadujici coding skills
 +  *  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 89: Line 97:
  
 ==== 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 95: Line 103:
 # Print result to stdout # Print result to stdout
 # #
-# Generate minis in simg folder 
 # find ./ -type f -exec mogrify -verbose -layers Dispose -resize 128\>x128\> -quality 100% {} + # find ./ -type f -exec mogrify -verbose -layers Dispose -resize 128\>x128\> -quality 100% {} +
 # #
 +# // vectorLayer.removeFeatures(atol)
 +# // map.removeLayer(vectorLayer)
 # #
 # #
Line 104: Line 113:
 #   ./det/ID.htm details of each and every entry #   ./det/ID.htm details of each and every entry
 # #
 +
 +ICON_animalia="animalia.png"
 +ICON_bacteria="bacteria.png"
 +ICON_fungi="fungi.png"
 +ICON_chromista="chromista.png"
 +ICON_plantae="plantae.svg"
 +ICON_plostenkoid="plostenkoid.png"
 +ICON_protista="protista.png"
 +ICON_biohazard="biohazard.svg"
 +
 +# Return icon by Regnum
 +function geticon () {
 + case "$1" in
 + "Animalia")
 + echo $ICON_animalia;;
 + "Bacteria")
 + echo $ICON_bacteria;;
 + "Fungi")
 + echo $ICON_fungi;;
 + "Chromista")
 + echo $ICON_chromista;;
 + "Plantae")
 + echo $ICON_plantae;;
 + "Protista")
 + echo $ICON_protista;;
 + *)
 + echo $ICON_biohazard;;
 + esac
 +}
 +
  
 rm -rfv "./det/*" rm -rfv "./det/*"
Line 120: Line 159:
 echo '<head>' echo '<head>'
 echo ' <meta http-equiv="Content-Type" content="text/html; charset=utf-8">' echo ' <meta http-equiv="Content-Type" content="text/html; charset=utf-8">'
-echo ' <title>BioOSM</title>'+echo ' <title>brmlab - BioOSM</title>'
 echo ' <link rel="stylesheet" href="./style.css" type="text/css">' echo ' <link rel="stylesheet" href="./style.css" type="text/css">'
 +echo ' <link rel="favicon" href="./'$ICON_biohazard'">'
 echo ' <script src="./OpenLayers.js"></script>' echo ' <script src="./OpenLayers.js"></script>'
 echo '</head>' echo '</head>'
  
 echo "<body>" echo "<body>"
- echo "<h1 id='title'>BioOSM - armis biologica in tuis vicinia</h1>"+ echo "<h1 id='title'>BioOSM - arma biologica in tuis vicinia</h1>"
  
  # Generate select  # Generate select
Line 277: Line 317:
  detpg="$detpg<b>Video:</b> <a href=\"$vid\" target=\"_blank\">$vid</a><br>"  detpg="$detpg<b>Video:</b> <a href=\"$vid\" target=\"_blank\">$vid</a><br>"
  fi  fi
- detpg="$detpg</td><td>"+ detpg="$detpg</td><td style='min-width:66%'>"
  if [[ "$obr" != "" ]]; then  if [[ "$obr" != "" ]]; then
  detpg="$detpg<a href=\"../img/$obr\"><img src=\"../img/$obr\" alt=\"$co\" class='detimg'></a>"  detpg="$detpg<a href=\"../img/$obr\"><img src=\"../img/$obr\" alt=\"$co\" class='detimg'></a>"
Line 302: Line 342:
  fi  fi
  spoj="$spoj<td>$co<br>$kdy</td>"  spoj="$spoj<td>$co<br>$kdy</td>"
 + spoj="$spoj<!-- $reg -->"
  spoj="$spoj</tr>"  spoj="$spoj</tr>"
  ox="$kdex"  ox="$kdex"
Line 312: Line 353:
  # Predchozi pozice jen 1 zaznam?  # Predchozi pozice jen 1 zaznam?
  if [[ "$sam" != "" ]]; then  if [[ "$sam" != "" ]]; then
- echo "var n$i = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point($ox,$oy).transform(epsg4326,projectTo),{description:'"$sam"'},{externalGraphic:'./$3',graphicHeight:24,graphicWidth:24,graphicXOffset:-12,graphicYOffset:-12});"+ samicon=$(geticon $(echo "$sam" | grep -oPe "<b>Regnum:</b> [a-zA-Z0-9]*" | grep -oPe "[a-zA-Z0-9]*$")) 
 + >&2 echo "$samicon" 
 + 
 + echo "var n$i = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point($ox,$oy).transform(epsg4326,projectTo),{description:'"$sam"'},{externalGraphic:'./$samicon',graphicHeight:24,graphicWidth:24,graphicXOffset:-12,graphicYOffset:-12});"
  echo "$2.addFeatures(n$i);"  echo "$2.addFeatures(n$i);"
  spoj=""  spoj=""
Line 319: Line 363:
  # Predchozi pozice vic zaznamu?  # Predchozi pozice vic zaznamu?
  if [[ "$spoj" != "" ]]; then  if [[ "$spoj" != "" ]]; then
- echo "var n$i = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point($ox,$oy).transform(epsg4326,projectTo),{description:'<table class=\"hadtbl\">"$spoj"</table>'},{externalGraphic:'./$3',graphicHeight:24,graphicWidth:24,graphicXOffset:-12,graphicYOffset:-12});"+ muchicons=$(echo "$spoj" | grep -oPe "<!-- [a-zA-Z0-9]* -->" | grep -oPe "[a-zA-Z0-9]*" | sort | uniq | wc -l) 
 + #>&2 echo "*** $muchicons" 
 + if [[ "$muchicons" == "1" ]]; then 
 + spojicon=$(geticon $(echo "$spoj" | grep -oPe "<!-- [a-zA-Z0-9]* -->" | grep -oPe "[a-zA-Z0-9]*" | sort | uniq)) 
 + #>&2 echo "*** $spojicon" 
 + else 
 + spojicon=$ICON_biohazard 
 + fi 
 + echo "var n$i = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point($ox,$oy).transform(epsg4326,projectTo),{description:'<table class=\"hadtbl\">"$spoj"</table>'},{externalGraphic:'./$spojicon',graphicHeight:24,graphicWidth:24,graphicXOffset:-12,graphicYOffset:-12});"
     echo "$2.addFeatures(n$i);"     echo "$2.addFeatures(n$i);"
  spoj=""  spoj=""
Line 333: Line 385:
  fi  fi
  spoj="$spoj<td>$co<br>$kdy</td>"  spoj="$spoj<td>$co<br>$kdy</td>"
 + spoj="$spoj<!-- $reg -->" # Metadata pyco
  spoj="$spoj</tr>"  spoj="$spoj</tr>"
  
Line 402: Line 455:
 # Do not forget to print last line when WHILE ends! # Do not forget to print last line when WHILE ends!
 if [[ "$sam" = "" ]]; then if [[ "$sam" = "" ]]; then
 + muchicons=$(echo "$spoj" | grep -oPe "<!-- [a-zA-Z0-9]* -->" | grep -oPe "[a-zA-Z0-9]*" | sort | uniq | wc -l)
 + if [[ "$muchicons" == "1" ]]; then
 + samicon=$(geticon $(echo "$spoj" | grep -oPe "<!-- [a-zA-Z0-9]* -->" | grep -oPe "[a-zA-Z0-9]*" | sort | uniq))
 + else
 + samicon=$ICON_biohazard
 + fi
  sam="<table style=\"hadtbl\">$spoj</table>"  sam="<table style=\"hadtbl\">$spoj</table>"
 +else
 + samicon=$(geticon $(echo "$sam" | grep -oPe "<b>Regnum:</b> [a-zA-Z0-9]*" | grep -oPe "[a-zA-Z0-9]*$"))
 fi fi
-echo "var n$i = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point($kdex,$kdey).transform(epsg4326,projectTo),{description:'"$sam"'},{externalGraphic:'./$3',graphicHeight:24,graphicWidth:24,graphicXOffset:-12,graphicYOffset:-12});"+echo "var n$i = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point($kdex,$kdey).transform(epsg4326,projectTo),{description:'"$sam"'},{externalGraphic:'./$samicon',graphicHeight:24,graphicWidth:24,graphicXOffset:-12,graphicYOffset:-12});"
 echo "$2.addFeatures(n$i);" echo "$2.addFeatures(n$i);"
  
Line 410: Line 471:
  
 echo "var ALL = new OpenLayers.Layer.Vector('Overlay',{attribution:'<a href=\"http://brmlab.cz\">Brmlab</a>'});" echo "var ALL = new OpenLayers.Layer.Vector('Overlay',{attribution:'<a href=\"http://brmlab.cz\">Brmlab</a>'});"
-spagety "$praseTC" "ALL" "biohazard.svg"+spagety "$praseTC" "ALL" $ICON_biohazard
 echo "map.addLayer(ALL);" echo "map.addLayer(ALL);"
  
Line 417: Line 478:
  echo "var $spag = new OpenLayers.Layer.Vector('Overlay',{attribution:'<a href=\"http://brmlab.cz\">Brmlab</a>'});"  echo "var $spag = new OpenLayers.Layer.Vector('Overlay',{attribution:'<a href=\"http://brmlab.cz\">Brmlab</a>'});"
  spg=$(echo "$praseTC" | grep "<new-field-4>$spag</new-field-4>")  spg=$(echo "$praseTC" | grep "<new-field-4>$spag</new-field-4>")
- case "$spag" in + icon=$(geticon "$spag")
- "Animalia") +
- icon="animalia.png";; +
- "Bacteria"+
- icon="bacteria.png";; +
- "Fungi"+
- icon="fungi.png";; +
- "Chromista"+
- icon="chromista.png";; +
- "Plantae"+
- icon="plantae.svg";; +
- "Protista"+
- icon="protista.png";; +
- *) +
- icon="biohazard.svg";; +
- esac +
  spagety "$spg" "$spag" "$icon"  spagety "$spg" "$spag" "$icon"
  echo "laycon.push($spag);"  echo "laycon.push($spag);"
Line 441: Line 486:
 spg=$(echo "$praseTC" | grep "<phylum>Platyhelminthes</phylum>") spg=$(echo "$praseTC" | grep "<phylum>Platyhelminthes</phylum>")
 echo "var Platyhelminthes = new OpenLayers.Layer.Vector('Overlay',{attribution:'<a href=\"http://brmlab.cz\">Brmlab</a>'});" echo "var Platyhelminthes = new OpenLayers.Layer.Vector('Overlay',{attribution:'<a href=\"http://brmlab.cz\">Brmlab</a>'});"
-spagety "$spg" "Platyhelminthes" "plostenkoid.png"+spagety "$spg" "Platyhelminthes" $ICON_plostenkoid
 echo "laycon.push(Platyhelminthes)" echo "laycon.push(Platyhelminthes)"
  
project/bioosm/start.txt · Last modified: 2023/09/21 12:15 by sachy