<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>stragu</title>
<link>https://stragu.codeberg.page/</link>
<atom:link href="https://stragu.codeberg.page/index.xml" rel="self" type="application/rss+xml"/>
<description>stragu&#39;s web corner</description>
<generator>quarto-1.9.37</generator>
<lastBuildDate>Wed, 27 May 2026 14:00:00 GMT</lastBuildDate>
<item>
  <title>Barrambin biodiversity data</title>
  <dc:creator>Stéphane Guillou</dc:creator>
  <link>https://stragu.codeberg.page/posts/2026-05-27_barrambin-biodiversity/</link>
  <description><![CDATA[ 





<p>On the 23rd of May 2026, 35 volunteers gathered for a “<a href="../../posts/2026-05-20_barrambin-bioblitz/index.html">Barrambin Bioblitz</a>” to learn about iNaturalist and collect biodiversity data in the park.</p>
<p>Let’s have a look at the data collected so far.</p>
<section id="barrambin-bioblitz-impact" class="level2">
<h2 class="anchored" data-anchor-id="barrambin-bioblitz-impact">Barrambin Bioblitz impact</h2>
<p>In 24 hours, we went from:</p>
<ul>
<li>794 to 1026 observations (+232)</li>
<li>309 to 339 species (+30)</li>
<li>1443 to 1680 identifications (+237)</li>
<li>150 to 164 observers (+14)</li>
<li>8 to 17 project members (+9)</li>
</ul>
<div class="quarto-layout-panel" data-layout-ncol="2">
<div class="quarto-layout-row">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="img/before.jpg" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="Project stats before the Bioblitz…"><img src="https://stragu.codeberg.page/posts/2026-05-27_barrambin-biodiversity/img/before.jpg" class="img-fluid figure-img" alt="Statistics on project page, with baseline numbers as in list above."></a></p>
<figcaption>Project stats before the Bioblitz…</figcaption>
</figure>
</div>
</div>
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="img/after.jpg" class="lightbox" data-gallery="quarto-lightbox-gallery-2" title="…and after."><img src="https://stragu.codeberg.page/posts/2026-05-27_barrambin-biodiversity/img/after.jpg" class="img-fluid figure-img" alt="Statistics on project page, with updated numbers as in list above."></a></p>
<figcaption>…and after.</figcaption>
</figure>
</div>
</div>
</div>
</div>
<p>But the effort didn’t stop on the 23rd of May: at the time of writing, there are 1069 observations in the project.</p>
<div class="cell">
<details class="code-fold">
<summary>Show the code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1">barr_obs<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>created_at <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(barr_obs<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>created_at)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(dplyr)</span>
<span id="cb1-3">cumulative <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> barr_obs <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb1-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rg =</span> quality_grade <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"research"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb1-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">count</span>(created_at, rg) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb1-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(created_at) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb1-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(rg) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb1-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cumulative_obs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cumsum</span>(n)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb1-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ungroup</span>()</span>
<span id="cb1-10"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(ggplot2)</span>
<span id="cb1-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_set</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_bw</span>())</span>
<span id="cb1-12"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(cumulative, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> created_at, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> cumulative_obs, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> rg)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-13">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(</span>
<span id="cb1-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2026-05-23"</span>),</span>
<span id="cb1-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span></span>
<span id="cb1-16">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-17">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_area</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-18">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(barr_obs<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>created_at), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(barr_obs), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">inherit.aes =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-19">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">annotate</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(barr_obs<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>created_at) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(barr_obs),</span>
<span id="cb1-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total:"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(barr_obs), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"observations."</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"right"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_fill_discrete</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Others"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Research"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-22">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(</span>
<span id="cb1-23">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Date"</span>,</span>
<span id="cb1-24">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Cumulative observations"</span>,</span>
<span id="cb1-25">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Quality grade"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://stragu.codeberg.page/posts/2026-05-27_barrambin-biodiversity/index_files/figure-html/unnamed-chunk-2-1.png" class="img-fluid figure-img" alt="Line graph showing a somewhat exponential increase in cumulative observations between 2018 and early 2026." width="672"></p>
<figcaption>Cumulative observations in project area. The dashed line denotes when the bioblitz occurred.</figcaption>
</figure>
</div>
</div>
</div>
<p>So what new species were added recently? Looking at observations that have a species-level ID, and including observations recorded during and after the Bioblitz, we added 45 to the list:</p>
<div class="cell">
<details class="code-fold">
<summary>Show the code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(stringr)</span>
<span id="cb2-2">species <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> barr_obs <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(taxon.rank <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"species"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(created_at, taxon.common_name.name, taxon.name, taxon.id) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># mark species that were seen after cutoff date but not before</span></span>
<span id="cb2-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb2-7">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">before =</span> created_at <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2026-05-22"</span>,</span>
<span id="cb2-8">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">after =</span> created_at <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2026-05-22"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(taxon.id) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">only_after =</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(before) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(after)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-11">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ungroup</span>()</span>
<span id="cb2-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># only keep the new ones, one row per species</span></span>
<span id="cb2-13">new_species <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> species <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-14">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(only_after) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-15">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(taxon.name, taxon.common_name.name, taxon.id) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-17">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># tidy up</span></span>
<span id="cb2-18">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rename</span>(</span>
<span id="cb2-19">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scientific.name =</span> taxon.name,</span>
<span id="cb2-20">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">common.name =</span> taxon.common_name.name</span>
<span id="cb2-21">        ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-22">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">common.name =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_to_sentence</span>(common.name)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-23">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(scientific.name) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-24">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># construct link to iNat taxon</span></span>
<span id="cb2-25">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">taxon.id =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(</span>
<span id="cb2-26">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;a href='https://www.inaturalist.org/taxa/"</span>,</span>
<span id="cb2-27">        taxon.id,</span>
<span id="cb2-28">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"'&gt;"</span>,</span>
<span id="cb2-29">        taxon.id,</span>
<span id="cb2-30">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;/a&gt;"</span>))</span>
<span id="cb2-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># print table</span></span>
<span id="cb2-32"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(gt)</span>
<span id="cb2-33">new_species <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-34">    tibble<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rowid_to_column</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-35">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">gt</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rowname_col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rowid"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb2-36">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fmt_markdown</span>(taxon.id) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ro render HTML</span></span></code></pre></div></div>
</details>
<div id="tbl-species" class="cell quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-tbl figure">
<figcaption class="quarto-float-caption-top quarto-float-caption quarto-float-tbl" id="tbl-species-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;1: Species observed since the Bioblitz but not before. Note that not all identifications have necessarily reached a consensus.
</figcaption>
<div aria-describedby="tbl-species-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="cell-output-display">
<div id="uuqtyycbql" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
<style>#uuqtyycbql table {
  font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#uuqtyycbql thead, #uuqtyycbql tbody, #uuqtyycbql tfoot, #uuqtyycbql tr, #uuqtyycbql td, #uuqtyycbql th {
  border-style: none;
}

#uuqtyycbql p {
  margin: 0;
  padding: 0;
}

#uuqtyycbql .gt_table {
  display: table;
  border-collapse: collapse;
  line-height: normal;
  margin-left: auto;
  margin-right: auto;
  color: #333333;
  font-size: 16px;
  font-weight: normal;
  font-style: normal;
  background-color: #FFFFFF;
  width: auto;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #A8A8A8;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #A8A8A8;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
}

#uuqtyycbql .gt_caption {
  padding-top: 4px;
  padding-bottom: 4px;
}

#uuqtyycbql .gt_title {
  color: #333333;
  font-size: 125%;
  font-weight: initial;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-color: #FFFFFF;
  border-bottom-width: 0;
}

#uuqtyycbql .gt_subtitle {
  color: #333333;
  font-size: 85%;
  font-weight: initial;
  padding-top: 3px;
  padding-bottom: 5px;
  padding-left: 5px;
  padding-right: 5px;
  border-top-color: #FFFFFF;
  border-top-width: 0;
}

#uuqtyycbql .gt_heading {
  background-color: #FFFFFF;
  text-align: center;
  border-bottom-color: #FFFFFF;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
}

#uuqtyycbql .gt_bottom_border {
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#uuqtyycbql .gt_col_headings {
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
}

#uuqtyycbql .gt_col_heading {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: normal;
  text-transform: inherit;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: bottom;
  padding-top: 5px;
  padding-bottom: 6px;
  padding-left: 5px;
  padding-right: 5px;
  overflow-x: hidden;
}

#uuqtyycbql .gt_column_spanner_outer {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: normal;
  text-transform: inherit;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 4px;
  padding-right: 4px;
}

#uuqtyycbql .gt_column_spanner_outer:first-child {
  padding-left: 0;
}

#uuqtyycbql .gt_column_spanner_outer:last-child {
  padding-right: 0;
}

#uuqtyycbql .gt_column_spanner {
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  vertical-align: bottom;
  padding-top: 5px;
  padding-bottom: 5px;
  overflow-x: hidden;
  display: inline-block;
  width: 100%;
}

#uuqtyycbql .gt_spanner_row {
  border-bottom-style: hidden;
}

#uuqtyycbql .gt_group_heading {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: middle;
  text-align: left;
}

#uuqtyycbql .gt_empty_group_heading {
  padding: 0.5px;
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  vertical-align: middle;
}

#uuqtyycbql .gt_from_md > :first-child {
  margin-top: 0;
}

#uuqtyycbql .gt_from_md > :last-child {
  margin-bottom: 0;
}

#uuqtyycbql .gt_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  margin: 10px;
  border-top-style: solid;
  border-top-width: 1px;
  border-top-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: middle;
  overflow-x: hidden;
}

#uuqtyycbql .gt_stub {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  padding-left: 5px;
  padding-right: 5px;
}

#uuqtyycbql .gt_stub_row_group {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  padding-left: 5px;
  padding-right: 5px;
  vertical-align: top;
}

#uuqtyycbql .gt_row_group_first td {
  border-top-width: 2px;
}

#uuqtyycbql .gt_row_group_first th {
  border-top-width: 2px;
}

#uuqtyycbql .gt_summary_row {
  color: #333333;
  background-color: #FFFFFF;
  text-transform: inherit;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
}

#uuqtyycbql .gt_first_summary_row {
  border-top-style: solid;
  border-top-color: #D3D3D3;
}

#uuqtyycbql .gt_first_summary_row.thick {
  border-top-width: 2px;
}

#uuqtyycbql .gt_last_summary_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#uuqtyycbql .gt_grand_summary_row {
  color: #333333;
  background-color: #FFFFFF;
  text-transform: inherit;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
}

#uuqtyycbql .gt_first_grand_summary_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-top-style: double;
  border-top-width: 6px;
  border-top-color: #D3D3D3;
}

#uuqtyycbql .gt_last_grand_summary_row_top {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-style: double;
  border-bottom-width: 6px;
  border-bottom-color: #D3D3D3;
}

#uuqtyycbql .gt_striped {
  background-color: rgba(128, 128, 128, 0.05);
}

#uuqtyycbql .gt_table_body {
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#uuqtyycbql .gt_footnotes {
  color: #333333;
  background-color: #FFFFFF;
  border-bottom-style: none;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
}

#uuqtyycbql .gt_footnote {
  margin: 0px;
  font-size: 90%;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
}

#uuqtyycbql .gt_sourcenotes {
  color: #333333;
  background-color: #FFFFFF;
  border-bottom-style: none;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
}

#uuqtyycbql .gt_sourcenote {
  font-size: 90%;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
}

#uuqtyycbql .gt_left {
  text-align: left;
}

#uuqtyycbql .gt_center {
  text-align: center;
}

#uuqtyycbql .gt_right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#uuqtyycbql .gt_font_normal {
  font-weight: normal;
}

#uuqtyycbql .gt_font_bold {
  font-weight: bold;
}

#uuqtyycbql .gt_font_italic {
  font-style: italic;
}

#uuqtyycbql .gt_super {
  font-size: 65%;
}

#uuqtyycbql .gt_footnote_marks {
  font-size: 75%;
  vertical-align: 0.4em;
  position: initial;
}

#uuqtyycbql .gt_asterisk {
  font-size: 100%;
  vertical-align: 0;
}

#uuqtyycbql .gt_indent_1 {
  text-indent: 5px;
}

#uuqtyycbql .gt_indent_2 {
  text-indent: 10px;
}

#uuqtyycbql .gt_indent_3 {
  text-indent: 15px;
}

#uuqtyycbql .gt_indent_4 {
  text-indent: 20px;
}

#uuqtyycbql .gt_indent_5 {
  text-indent: 25px;
}

#uuqtyycbql .katex-display {
  display: inline-flex !important;
  margin-bottom: 0.75em !important;
}

#uuqtyycbql div.Reactable > div.rt-table > div.rt-thead > div.rt-tr.rt-tr-group-header > div.rt-th-group:after {
  height: 0px !important;
}
</style>

<table class="gt_table cell caption-top table table-sm table-striped small" data-quarto-bootstrap="false">
<thead>
<tr class="gt_col_headings header">
<th id="a::stub" class="gt_col_heading gt_columns_bottom_border gt_left" data-quarto-table-cell-role="th" scope="col"></th>
<th id="scientific.name" class="gt_col_heading gt_columns_bottom_border gt_left" data-quarto-table-cell-role="th" scope="col">scientific.name</th>
<th id="common.name" class="gt_col_heading gt_columns_bottom_border gt_left" data-quarto-table-cell-role="th" scope="col">common.name</th>
<th id="taxon.id" class="gt_col_heading gt_columns_bottom_border gt_left" data-quarto-table-cell-role="th" scope="col">taxon.id</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr class="odd">
<th id="stub_1_1" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">1</th>
<td class="gt_row gt_left" headers="stub_1_1 scientific.name">Albizia lebbeck</td>
<td class="gt_row gt_left" headers="stub_1_1 common.name">Lebbeck</td>
<td class="gt_row gt_left" headers="stub_1_1 taxon.id"><a href="https://www.inaturalist.org/taxa/60832">60832</a></td>
</tr>
<tr class="even">
<th id="stub_1_2" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">2</th>
<td class="gt_row gt_left" headers="stub_1_2 scientific.name">Angophora subvelutina</td>
<td class="gt_row gt_left" headers="stub_1_2 common.name">Broad-leaved apple</td>
<td class="gt_row gt_left" headers="stub_1_2 taxon.id"><a href="https://www.inaturalist.org/taxa/531489">531489</a></td>
</tr>
<tr class="odd">
<th id="stub_1_3" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">3</th>
<td class="gt_row gt_left" headers="stub_1_3 scientific.name">Araucaria bidwillii</td>
<td class="gt_row gt_left" headers="stub_1_3 common.name">Bunya pine</td>
<td class="gt_row gt_left" headers="stub_1_3 taxon.id"><a href="https://www.inaturalist.org/taxa/136231">136231</a></td>
</tr>
<tr class="even">
<th id="stub_1_4" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">4</th>
<td class="gt_row gt_left" headers="stub_1_4 scientific.name">Austromyrtus dulcis</td>
<td class="gt_row gt_left" headers="stub_1_4 common.name">Midgen berry</td>
<td class="gt_row gt_left" headers="stub_1_4 taxon.id"><a href="https://www.inaturalist.org/taxa/429695">429695</a></td>
</tr>
<tr class="odd">
<th id="stub_1_5" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">5</th>
<td class="gt_row gt_left" headers="stub_1_5 scientific.name">Banksia integrifolia</td>
<td class="gt_row gt_left" headers="stub_1_5 common.name">Coastal banksia</td>
<td class="gt_row gt_left" headers="stub_1_5 taxon.id"><a href="https://www.inaturalist.org/taxa/244884">244884</a></td>
</tr>
<tr class="even">
<th id="stub_1_6" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">6</th>
<td class="gt_row gt_left" headers="stub_1_6 scientific.name">Brachychiton australis</td>
<td class="gt_row gt_left" headers="stub_1_6 common.name">Broad-leaved bottletree</td>
<td class="gt_row gt_left" headers="stub_1_6 taxon.id"><a href="https://www.inaturalist.org/taxa/135372">135372</a></td>
</tr>
<tr class="odd">
<th id="stub_1_7" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">7</th>
<td class="gt_row gt_left" headers="stub_1_7 scientific.name">Buckinghamia celsissima</td>
<td class="gt_row gt_left" headers="stub_1_7 common.name">Ivory curl tree</td>
<td class="gt_row gt_left" headers="stub_1_7 taxon.id"><a href="https://www.inaturalist.org/taxa/411170">411170</a></td>
</tr>
<tr class="even">
<th id="stub_1_8" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">8</th>
<td class="gt_row gt_left" headers="stub_1_8 scientific.name">Calochlaena dubia</td>
<td class="gt_row gt_left" headers="stub_1_8 common.name">Common ground fern</td>
<td class="gt_row gt_left" headers="stub_1_8 taxon.id"><a href="https://www.inaturalist.org/taxa/323953">323953</a></td>
</tr>
<tr class="odd">
<th id="stub_1_9" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">9</th>
<td class="gt_row gt_left" headers="stub_1_9 scientific.name">Camponotus consobrinus</td>
<td class="gt_row gt_left" headers="stub_1_9 common.name">Banded sugar ant</td>
<td class="gt_row gt_left" headers="stub_1_9 taxon.id"><a href="https://www.inaturalist.org/taxa/201978">201978</a></td>
</tr>
<tr class="even">
<th id="stub_1_10" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">10</th>
<td class="gt_row gt_left" headers="stub_1_10 scientific.name">Chlorophyllum rhacodes</td>
<td class="gt_row gt_left" headers="stub_1_10 common.name">Shaggy parasol</td>
<td class="gt_row gt_left" headers="stub_1_10 taxon.id"><a href="https://www.inaturalist.org/taxa/56535">56535</a></td>
</tr>
<tr class="odd">
<th id="stub_1_11" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">11</th>
<td class="gt_row gt_left" headers="stub_1_11 scientific.name">Codiaeum variegatum</td>
<td class="gt_row gt_left" headers="stub_1_11 common.name">Variegated croton</td>
<td class="gt_row gt_left" headers="stub_1_11 taxon.id"><a href="https://www.inaturalist.org/taxa/127387">127387</a></td>
</tr>
<tr class="even">
<th id="stub_1_12" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">12</th>
<td class="gt_row gt_left" headers="stub_1_12 scientific.name">Corymbia henryi</td>
<td class="gt_row gt_left" headers="stub_1_12 common.name">Large-leaved spotted gum</td>
<td class="gt_row gt_left" headers="stub_1_12 taxon.id"><a href="https://www.inaturalist.org/taxa/1023768">1023768</a></td>
</tr>
<tr class="odd">
<th id="stub_1_13" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">13</th>
<td class="gt_row gt_left" headers="stub_1_13 scientific.name">Corymbia intermedia</td>
<td class="gt_row gt_left" headers="stub_1_13 common.name">Pink bloodwood</td>
<td class="gt_row gt_left" headers="stub_1_13 taxon.id"><a href="https://www.inaturalist.org/taxa/334817">334817</a></td>
</tr>
<tr class="even">
<th id="stub_1_14" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">14</th>
<td class="gt_row gt_left" headers="stub_1_14 scientific.name">Delonix regia</td>
<td class="gt_row gt_left" headers="stub_1_14 common.name">Flamboyant</td>
<td class="gt_row gt_left" headers="stub_1_14 taxon.id"><a href="https://www.inaturalist.org/taxa/62839">62839</a></td>
</tr>
<tr class="odd">
<th id="stub_1_15" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">15</th>
<td class="gt_row gt_left" headers="stub_1_15 scientific.name">Dianella caerulea</td>
<td class="gt_row gt_left" headers="stub_1_15 common.name">Blue flax-lily</td>
<td class="gt_row gt_left" headers="stub_1_15 taxon.id"><a href="https://www.inaturalist.org/taxa/53680">53680</a></td>
</tr>
<tr class="even">
<th id="stub_1_16" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">16</th>
<td class="gt_row gt_left" headers="stub_1_16 scientific.name">Dodonaea triquetra</td>
<td class="gt_row gt_left" headers="stub_1_16 common.name">Common hop bush</td>
<td class="gt_row gt_left" headers="stub_1_16 taxon.id"><a href="https://www.inaturalist.org/taxa/83633">83633</a></td>
</tr>
<tr class="odd">
<th id="stub_1_17" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">17</th>
<td class="gt_row gt_left" headers="stub_1_17 scientific.name">Elaeocarpus grandis</td>
<td class="gt_row gt_left" headers="stub_1_17 common.name">Blue quandong</td>
<td class="gt_row gt_left" headers="stub_1_17 taxon.id"><a href="https://www.inaturalist.org/taxa/369964">369964</a></td>
</tr>
<tr class="even">
<th id="stub_1_18" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">18</th>
<td class="gt_row gt_left" headers="stub_1_18 scientific.name">Erythrina lysistemon</td>
<td class="gt_row gt_left" headers="stub_1_18 common.name">Common coral tree</td>
<td class="gt_row gt_left" headers="stub_1_18 taxon.id"><a href="https://www.inaturalist.org/taxa/119673">119673</a></td>
</tr>
<tr class="odd">
<th id="stub_1_19" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">19</th>
<td class="gt_row gt_left" headers="stub_1_19 scientific.name">Erythrina vespertilio</td>
<td class="gt_row gt_left" headers="stub_1_19 common.name">Bat's wing coral tree</td>
<td class="gt_row gt_left" headers="stub_1_19 taxon.id"><a href="https://www.inaturalist.org/taxa/369714">369714</a></td>
</tr>
<tr class="even">
<th id="stub_1_20" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">20</th>
<td class="gt_row gt_left" headers="stub_1_20 scientific.name">Eucalyptus carnea</td>
<td class="gt_row gt_left" headers="stub_1_20 common.name">Broad-leaved white mahogany</td>
<td class="gt_row gt_left" headers="stub_1_20 taxon.id"><a href="https://www.inaturalist.org/taxa/538030">538030</a></td>
</tr>
<tr class="odd">
<th id="stub_1_21" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">21</th>
<td class="gt_row gt_left" headers="stub_1_21 scientific.name">Eucalyptus cinerea</td>
<td class="gt_row gt_left" headers="stub_1_21 common.name">Argyle apple</td>
<td class="gt_row gt_left" headers="stub_1_21 taxon.id"><a href="https://www.inaturalist.org/taxa/162748">162748</a></td>
</tr>
<tr class="even">
<th id="stub_1_22" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">22</th>
<td class="gt_row gt_left" headers="stub_1_22 scientific.name">Eucalyptus cloeziana</td>
<td class="gt_row gt_left" headers="stub_1_22 common.name">Gympie messmate</td>
<td class="gt_row gt_left" headers="stub_1_22 taxon.id"><a href="https://www.inaturalist.org/taxa/1074794">1074794</a></td>
</tr>
<tr class="odd">
<th id="stub_1_23" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">23</th>
<td class="gt_row gt_left" headers="stub_1_23 scientific.name">Eucalyptus fibrosa</td>
<td class="gt_row gt_left" headers="stub_1_23 common.name">Red ironbark</td>
<td class="gt_row gt_left" headers="stub_1_23 taxon.id"><a href="https://www.inaturalist.org/taxa/323762">323762</a></td>
</tr>
<tr class="even">
<th id="stub_1_24" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">24</th>
<td class="gt_row gt_left" headers="stub_1_24 scientific.name">Eucalyptus melanophloia</td>
<td class="gt_row gt_left" headers="stub_1_24 common.name">NA</td>
<td class="gt_row gt_left" headers="stub_1_24 taxon.id"><a href="https://www.inaturalist.org/taxa/323757">323757</a></td>
</tr>
<tr class="odd">
<th id="stub_1_25" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">25</th>
<td class="gt_row gt_left" headers="stub_1_25 scientific.name">Eucalyptus propinqua</td>
<td class="gt_row gt_left" headers="stub_1_25 common.name">Small-fruited grey gum</td>
<td class="gt_row gt_left" headers="stub_1_25 taxon.id"><a href="https://www.inaturalist.org/taxa/334073">334073</a></td>
</tr>
<tr class="even">
<th id="stub_1_26" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">26</th>
<td class="gt_row gt_left" headers="stub_1_26 scientific.name">Eucalyptus punctata</td>
<td class="gt_row gt_left" headers="stub_1_26 common.name">Grey gum</td>
<td class="gt_row gt_left" headers="stub_1_26 taxon.id"><a href="https://www.inaturalist.org/taxa/401758">401758</a></td>
</tr>
<tr class="odd">
<th id="stub_1_27" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">27</th>
<td class="gt_row gt_left" headers="stub_1_27 scientific.name">Euphorbia hirta</td>
<td class="gt_row gt_left" headers="stub_1_27 common.name">Asthma plant</td>
<td class="gt_row gt_left" headers="stub_1_27 taxon.id"><a href="https://www.inaturalist.org/taxa/131560">131560</a></td>
</tr>
<tr class="even">
<th id="stub_1_28" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">28</th>
<td class="gt_row gt_left" headers="stub_1_28 scientific.name">Eustrephus latifolius</td>
<td class="gt_row gt_left" headers="stub_1_28 common.name">Wombat berry</td>
<td class="gt_row gt_left" headers="stub_1_28 taxon.id"><a href="https://www.inaturalist.org/taxa/334785">334785</a></td>
</tr>
<tr class="odd">
<th id="stub_1_29" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">29</th>
<td class="gt_row gt_left" headers="stub_1_29 scientific.name">Ficus rubiginosa</td>
<td class="gt_row gt_left" headers="stub_1_29 common.name">Port jackson fig</td>
<td class="gt_row gt_left" headers="stub_1_29 taxon.id"><a href="https://www.inaturalist.org/taxa/199385">199385</a></td>
</tr>
<tr class="even">
<th id="stub_1_30" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">30</th>
<td class="gt_row gt_left" headers="stub_1_30 scientific.name">Flindersia schottiana</td>
<td class="gt_row gt_left" headers="stub_1_30 common.name">Cudgerie</td>
<td class="gt_row gt_left" headers="stub_1_30 taxon.id"><a href="https://www.inaturalist.org/taxa/192451">192451</a></td>
</tr>
<tr class="odd">
<th id="stub_1_31" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">31</th>
<td class="gt_row gt_left" headers="stub_1_31 scientific.name">Fomitiporia robusta</td>
<td class="gt_row gt_left" headers="stub_1_31 common.name">Robust bracket</td>
<td class="gt_row gt_left" headers="stub_1_31 taxon.id"><a href="https://www.inaturalist.org/taxa/485958">485958</a></td>
</tr>
<tr class="even">
<th id="stub_1_32" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">32</th>
<td class="gt_row gt_left" headers="stub_1_32 scientific.name">Grevillea robusta</td>
<td class="gt_row gt_left" headers="stub_1_32 common.name">Silk oak</td>
<td class="gt_row gt_left" headers="stub_1_32 taxon.id"><a href="https://www.inaturalist.org/taxa/77302">77302</a></td>
</tr>
<tr class="odd">
<th id="stub_1_33" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">33</th>
<td class="gt_row gt_left" headers="stub_1_33 scientific.name">Harpullia pendula</td>
<td class="gt_row gt_left" headers="stub_1_33 common.name">Black tulip</td>
<td class="gt_row gt_left" headers="stub_1_33 taxon.id"><a href="https://www.inaturalist.org/taxa/369494">369494</a></td>
</tr>
<tr class="even">
<th id="stub_1_34" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">34</th>
<td class="gt_row gt_left" headers="stub_1_34 scientific.name">Heteropoda jugulans</td>
<td class="gt_row gt_left" headers="stub_1_34 common.name">Jungle huntsman spider</td>
<td class="gt_row gt_left" headers="stub_1_34 taxon.id"><a href="https://www.inaturalist.org/taxa/369020">369020</a></td>
</tr>
<tr class="odd">
<th id="stub_1_35" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">35</th>
<td class="gt_row gt_left" headers="stub_1_35 scientific.name">Lophostemon confertus</td>
<td class="gt_row gt_left" headers="stub_1_35 common.name">Brush box</td>
<td class="gt_row gt_left" headers="stub_1_35 taxon.id"><a href="https://www.inaturalist.org/taxa/135363">135363</a></td>
</tr>
<tr class="even">
<th id="stub_1_36" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">36</th>
<td class="gt_row gt_left" headers="stub_1_36 scientific.name">Macadamia integrifolia</td>
<td class="gt_row gt_left" headers="stub_1_36 common.name">Macadamia tree</td>
<td class="gt_row gt_left" headers="stub_1_36 taxon.id"><a href="https://www.inaturalist.org/taxa/287245">287245</a></td>
</tr>
<tr class="odd">
<th id="stub_1_37" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">37</th>
<td class="gt_row gt_left" headers="stub_1_37 scientific.name">Melaleuca bracteata</td>
<td class="gt_row gt_left" headers="stub_1_37 common.name">Black tea-tree</td>
<td class="gt_row gt_left" headers="stub_1_37 taxon.id"><a href="https://www.inaturalist.org/taxa/346356">346356</a></td>
</tr>
<tr class="even">
<th id="stub_1_38" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">38</th>
<td class="gt_row gt_left" headers="stub_1_38 scientific.name">Melaleuca thymifolia</td>
<td class="gt_row gt_left" headers="stub_1_38 common.name">Thyme honey-myrtle</td>
<td class="gt_row gt_left" headers="stub_1_38 taxon.id"><a href="https://www.inaturalist.org/taxa/446704">446704</a></td>
</tr>
<tr class="odd">
<th id="stub_1_39" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">39</th>
<td class="gt_row gt_left" headers="stub_1_39 scientific.name">Phoenix roebelenii</td>
<td class="gt_row gt_left" headers="stub_1_39 common.name">Pygmy date palm</td>
<td class="gt_row gt_left" headers="stub_1_39 taxon.id"><a href="https://www.inaturalist.org/taxa/204744">204744</a></td>
</tr>
<tr class="even">
<th id="stub_1_40" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">40</th>
<td class="gt_row gt_left" headers="stub_1_40 scientific.name">Polyrhachis aurea</td>
<td class="gt_row gt_left" headers="stub_1_40 common.name">NA</td>
<td class="gt_row gt_left" headers="stub_1_40 taxon.id"><a href="https://www.inaturalist.org/taxa/964525">964525</a></td>
</tr>
<tr class="odd">
<th id="stub_1_41" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">41</th>
<td class="gt_row gt_left" headers="stub_1_41 scientific.name">Polyrhachis daemeli</td>
<td class="gt_row gt_left" headers="stub_1_41 common.name">Daemel's spiny ant</td>
<td class="gt_row gt_left" headers="stub_1_41 taxon.id"><a href="https://www.inaturalist.org/taxa/201995">201995</a></td>
</tr>
<tr class="even">
<th id="stub_1_42" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">42</th>
<td class="gt_row gt_left" headers="stub_1_42 scientific.name">Pteropus poliocephalus</td>
<td class="gt_row gt_left" headers="stub_1_42 common.name">Grey-headed flying-fox</td>
<td class="gt_row gt_left" headers="stub_1_42 taxon.id"><a href="https://www.inaturalist.org/taxa/40905">40905</a></td>
</tr>
<tr class="odd">
<th id="stub_1_43" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">43</th>
<td class="gt_row gt_left" headers="stub_1_43 scientific.name">Rhytidoponera metallica</td>
<td class="gt_row gt_left" headers="stub_1_43 common.name">Green-head ant</td>
<td class="gt_row gt_left" headers="stub_1_43 taxon.id"><a href="https://www.inaturalist.org/taxa/201975">201975</a></td>
</tr>
<tr class="even">
<th id="stub_1_44" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">44</th>
<td class="gt_row gt_left" headers="stub_1_44 scientific.name">Stenocarpus sinuatus</td>
<td class="gt_row gt_left" headers="stub_1_44 common.name">Firewheel tree</td>
<td class="gt_row gt_left" headers="stub_1_44 taxon.id"><a href="https://www.inaturalist.org/taxa/83360">83360</a></td>
</tr>
<tr class="odd">
<th id="stub_1_45" class="gt_row gt_right gt_stub" data-quarto-table-cell-role="th" scope="row">45</th>
<td class="gt_row gt_left" headers="stub_1_45 scientific.name">Tetragonula carbonaria</td>
<td class="gt_row gt_left" headers="stub_1_45 common.name">Charcoal stingless bee</td>
<td class="gt_row gt_left" headers="stub_1_45 taxon.id"><a href="https://www.inaturalist.org/taxa/475518">475518</a></td>
</tr>
</tbody>
</table>

</div>
</div>
</div>
</figure>
</div>
</div>
<p>Keep in mind that the newly-spotted species listed above are not necessarily all confirmed with several identifications. Here are some other places to explore what has been recorded at Barrambin:</p>
<ul>
<li>The <a href="https://www.inaturalist.org/projects/barrambin-victoria-park?tab=species">full list of taxa observed at this location</a>, starting with the most commonly seen</li>
<li>A <a href="https://www.inaturalist.org/observations?project_id=barrambin-victoria-park&amp;quality_grade=research&amp;verifiable=any">list of all the “Research Grade” observations</a></li>
<li>The project’s <a href="https://www.inaturalist.org/observations/identify?project_id=288305">‘Identify’ page</a>, on which you can help refine the data by adding your own identifications</li>
</ul>
</section>
<section id="more-biodiversity-data-on-the-ala" class="level2">
<h2 class="anchored" data-anchor-id="more-biodiversity-data-on-the-ala">More biodiversity data on the ALA</h2>
<p>For a more exhaustive list of species recorded at Barrambin, the Atlas of Living Australia (ALA) collates observations from various sources – including the “Research Grade” observations from iNaturalist. For the same area used in our Barrambin project, at the time of writing, the ALA lists 497 taxa, including 21 “threatened species”.</p>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Tip</span>ALA Area Report
</div>
</div>
<div class="callout-body-container callout-body">
<p><a href="https://archive.org/download/ALA_area_report_Barrambin_2026-05-28/areaReport1779975680564.pdf">Download the ALA area report</a> from the Internet Archive (PDF generated on 2026-05-28).</p>
<p>You can create your own up-to-date report and explore the data by heading to the <a href="https://spatial.ala.org.au/">ALA’s Spatial Portal</a>, importing <a href="barrambin_extended.kml">the area’s KML</a>, and selecting “Tools - Area Report”.</p>
</div>
</div>
<p>Remember: by <a href="../../posts/2026-05-20_barrambin-bioblitz/index.html">contributing more observations</a> to the project, and <a href="https://www.inaturalist.org/observations/identify?project_id=288305">identifying existing observations</a>, we can continue building up a more accurate and exhaustive record of biodiversity at Barrambin, which eventually feeds into authoritative databases like the ALA.</p>
</section>
<section id="protecting-barrambin" class="level2">
<h2 class="anchored" data-anchor-id="protecting-barrambin">Protecting Barrambin</h2>
<p>Here are other ways you can continue protecting Barrambin:</p>
<ul>
<li>Sign the <a href="https://www.savevictoriapark.com/submission">community submission</a> to support the Section 10 Applications, before 5 pm, 29th of May</li>
<li><a href="https://chuffed.org/project/177541-goori-camp-embassy">Donate to the Goori Camp Embassy</a>, <a href="https://nit.com.au/19-05-2026/24364/goori-camp-embassy-calls-on-community-to-help-defend-barrambin">join the camp</a> between 29th of May and 2nd of June, and <a href="https://www.instagram.com/gooricampembassy/">follow them on Instagram</a></li>
<li>Join the protest on Sunday 31st of May, 12 pm, outside the Herston Road entrance.</li>
<li>Join actions and learn more with <a href="https://www.savevictoriapark.com/">Save Victoria Park</a></li>
</ul>


</section>

 ]]></description>
  <category>iNaturalist</category>
  <category>activism</category>
  <category>Meanjin</category>
  <category>rstats</category>
  <guid>https://stragu.codeberg.page/posts/2026-05-27_barrambin-biodiversity/</guid>
  <pubDate>Wed, 27 May 2026 14:00:00 GMT</pubDate>
</item>
<item>
  <title>Barrambin Bioblitz - Getting started with iNaturalist</title>
  <dc:creator>Stéphane Guillou</dc:creator>
  <link>https://stragu.codeberg.page/posts/2026-05-20_barrambin-bioblitz/</link>
  <description><![CDATA[ 





<p>On Saturday the 23rd of May, from 9 am, we are running a <a href="https://www.facebook.com/savevictoriaparkbarrambin/posts/pfbid02sQLkG5YLfcFtebFrBSVvTbxkXmPwLnERReTmPhKGPXw5Wqzmv5qiLFqAZGR86iCjl?comment_id=2651612041901126">Bioblitz at Victoria Park / Barrambin</a> (meet at the barbecues). We want to get a big crowd together to record as many animals, plants, fungi, insects and any other critters as we can, so we can celebrate the biodiversity the park supports, and create a baseline of what’s at stake, as GIICA plans to fence off most of the park in less than 2 weeks.</p>
<p>This article will get you started with iNaturalist (aka “iNat”) so you can get straight into it, even before the event starts.</p>
<p>Already familiar with iNat? Jump to Barrambin Bioblitz.</p>
<p>New to iNat? Read on.</p>
<section id="inaturalist-what-is-it" class="level2">
<h2 class="anchored" data-anchor-id="inaturalist-what-is-it">iNaturalist: what is it?</h2>
<p><a href="https://www.inaturalist.org/">iNat</a> is a network of enthusiasts recording sightings of anything alive. No need to have any background in ecology, taxonomy or botany. All you need is something to take photos, and some interest in the natural world that surrounds us.</p>
<p>People upload “observations” into iNat, usually using a phone app. In most cases, it’s a picture of what you saw, along with its location and when it was recorded (but you can also submit a sound, e.g.&nbsp;a bird or frog call). The app gives you a suggestion of what the species might be (based on the pictures).</p>
<p>Once it’s on iNat, others can see it and contribute identifications. The data becomes particularly useful once several people agree on which species was observed - that’s the kind of data scientists end up using for studying biodiversity, population dynamics…</p>
<p>So far, more than 300 million observations have been uploaded to iNat! That’s more than 550,000 different species.</p>
<p>iNat is a non-profit organisation, the apps are open source, and the data is open data anyone can make use of.</p>
</section>
<section id="getting-started-with-inat" class="level2">
<h2 class="anchored" data-anchor-id="getting-started-with-inat">Getting started with iNat</h2>
<ol type="1">
<li>Download the app on your phone (<a href="https://apps.apple.com/us/app/inaturalist/id6475737561">from the App Store</a> on iOS, or <a href="https://play.google.com/store/apps/details?id=org.inaturalist.android">from Google Play</a> on Android)</li>
<li>Open the app and follow the steps to create an account</li>
<li>Log in</li>
</ol>
<p>Once logged in, you can start recording what you spot:</p>
<ol type="1">
<li>Tap the green “new observation” button</li>
<li>Take a photo (or more)</li>
<li>The location and time are automatically added to your observation (but you can double-check that the location is accurate enough)</li>
<li>Tap the “What did you see?” area so you can pick a suggestion from the list (or search for the common name / species if you already know it)</li>
<li>Save and upload the observation</li>
<li>Repeat!</li>
</ol>
<p>As an alternative (or complement) to the mobile app, you can use a more serious camera to take photos - particularly useful if you want to get good photos of birds, or do some macro photography of tiny organisms. In this case, you can upload your photos from your computer later, <a href="https://www.inaturalist.org/observations/upload">on the iNat website</a> - but make sure you record the location of each observation if your camera doesn’t automatically attach it to your photos!</p>
</section>
<section id="barrambin-bioblitz" class="level2">
<h2 class="anchored" data-anchor-id="barrambin-bioblitz">Barrambin Bioblitz</h2>
<p>We want to record as many species as we can at Barrambin / Victoria Park! In particular, we want to have good coverage of the area GIICA is planning to fence off on the 1st of June 2026.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://stragu.codeberg.page/posts/2026-05-20_barrambin-bioblitz/img/fencing.png" class="img-fluid figure-img" alt="Satellite map of Barrambin showing most of its area affected by GIICA's planned closures. The whole area between the QUT and Herston bus stations, pump track, and Gilchrist Avenue is included, as well as the area between Gilchrist Avenue and the ICB."></p>
<figcaption>Map of the area GIICA plans to fence off on the 1st of June 2026.</figcaption>
</figure>
</div>
<p>You can record anything that’s alive. That means: mammals, insects, birds, spiders, fish, fungi, lichen, mould, trees, shrubs, grasses, weeds… just don’t record other humans!</p>
<p>To get good coverage, and potentially spot more species, remember that crowd-sourced biodiversity can be biased in various ways. Most observations are:</p>
<ul>
<li>Close to where people live and travel (in cities, along roads…)</li>
<li>Made during the day</li>
<li>Depicting easy to approach, easy to spot organisms. For example: the ubiquitous Water Dragon, Brush Turkey and Australian Ibis.</li>
<li>Depicting particularly noticeable, or “beautiful”, or rare, or popular organisms. For example: a colourful lorikeet; a cuddly koala; a showy flower.</li>
</ul>
<p>So if you are able to, try also recording:</p>
<ul>
<li>Nocturnal animals (come back in the evening with a good torch) and early risers too</li>
<li>The “weeds” and the “boring” ones we see everywhere</li>
<li>In hard-to-reach areas, or inside patches of denser vegetation</li>
<li>Tree-dwelling and aquatic organisms</li>
<li>Tiny animals and plants your wouldn’t notice without stopping and looking very closely. Do you maybe have a camera that takes good macro photos?</li>
</ul>
<p>We have an <a href="https://www.inaturalist.org/projects/barrambin-victoria-park">iNaturalist project</a> that automatically collects the observations from the Barrambin area. You can “join” the project right now to get the latest news, find observations that still need IDs, or to just keep an eye on the stats to see how we are progressing!</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://stragu.codeberg.page/posts/2026-05-20_barrambin-bioblitz/img/inat_project.png" class="img-fluid figure-img" alt="Screenshot of the stats page of the Barrambin project on iNaturalist, showing totals of 747 observations and 297 species."></p>
<figcaption>Project stats as of 2026-05-20</figcaption>
</figure>
</div>
</section>
<section id="beyond-the-blitz" class="level2">
<h2 class="anchored" data-anchor-id="beyond-the-blitz">Beyond the blitz</h2>
<p>You can contribute to this project at any time, you don’t have to wait for the event, nor stop when it’s over!</p>
<ul>
<li>Do you have old wildlife photos taken at Barrambin? You can create observations from them on your computer, as long as you have an approximate time and location.</li>
<li>Before the event, feel free to go to the park and contribute observations.</li>
<li>After the event, please continue to build this valuable dataset! Record what you see every time you go through the park.</li>
</ul>
<p>Thank you for your invaluable contributions! They can make a huge difference in sending a strong message about what is at stake, and to keep GIICA and BCC accountable.</p>
</section>
<section id="other-ways-to-save-barrambin" class="level2">
<h2 class="anchored" data-anchor-id="other-ways-to-save-barrambin">Other ways to save Barrambin</h2>
<ul>
<li>Sign the <a href="https://www.savevictoriapark.com/submission">community submission</a> to support the Section 10 Applications</li>
<li><a href="https://chuffed.org/project/177541-goori-camp-embassy">Donate to the Goori Camp Embassy</a> and <a href="https://nit.com.au/19-05-2026/24364/goori-camp-embassy-calls-on-community-to-help-defend-barrambin">join the camp</a> between 29th of May and 2nd of June</li>
<li>Join actions and learn more with <a href="https://www.savevictoriapark.com/">Save Victoria Park</a></li>
</ul>


</section>

 ]]></description>
  <category>iNaturalist</category>
  <category>activism</category>
  <category>Meanjin</category>
  <guid>https://stragu.codeberg.page/posts/2026-05-20_barrambin-bioblitz/</guid>
  <pubDate>Tue, 19 May 2026 14:00:00 GMT</pubDate>
</item>
<item>
  <title>Introduction to tidy spatial networks</title>
  <dc:creator>Stéphane Guillou</dc:creator>
  <link>https://stragu.codeberg.page/posts/2022-06-06_spatial-networks/</link>
  <description><![CDATA[ 





<blockquote class="blockquote">
<p>This post was originally published on <a href="https://geospatial-community.netlify.app/">UQ Geospatial Analysis Community of Practice’s blog</a>. It was published on this blog on 2022-06-06, and updated to work with the latest package versions on 2026-05-19. (See the session info at the bottom of the article.)</p>
</blockquote>
<p>This tutorial is an introduction to dealing with tidy spatial networks in R, demonstrating a full process of data acquisition from the open spatial database OpenStreetMap, data preparation, and basic network analysis like isodistance and shortest path calculation. Along the way, we use the default plotting methods for spatial network objects, but also make use of the ggplot2 and tmap packages as alternatives.</p>
<section id="setting-up" class="level2">
<h2 class="anchored" data-anchor-id="setting-up">Setting up</h2>
<p>To follow this tutorial, you will have to have a number of packages available, which can be best sorted out with the following command:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">install.packages</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dplyr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ggplot2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sfnetworks"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tmap"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"osmdata"</span>))</span></code></pre></div></div>
</div>
<p>If you run into issues installing and running sf (which relies on spatial libraries external to R), please refer to <a href="https://github.com/r-spatial/sf#installing">their installation instructions</a>.</p>
</section>
<section id="sfnetworks" class="level2">
<h2 class="anchored" data-anchor-id="sfnetworks">sfnetworks</h2>
<p>The main package this tutorial centres around is the <a href="https://luukvdmeer.github.io/sfnetworks"><strong>sfnetworks</strong></a> package (Lucas van der Meer, Lorena Abad <em>et al.</em>), which is the result of joining what the <a href="https://tidygraph.data-imaginist.com/">tidygraph</a> package does for networks with what the <a href="https://r-spatial.github.io/sf/">sf</a> package does for spatial vector data.</p>
<p>The data structure central to this package is a combination of two spatial objects, one describing the <strong>nodes</strong> (or points) and another describing the <strong>edges</strong> (or lines connecting the points). In the words of the developers:</p>
<blockquote class="blockquote">
<p>“A close approximation of tidyness for relational <em>geospatial data</em> is two <em>sf objects</em>, one describing the node data and one describing the edge data.”</p>
</blockquote>
<p>In other words, an <code>sfnetwork</code> object is made up of one <code>sf</code> object for nodes and one <code>sf</code> object for edges. (As opposed to two simple <code>data.frame</code>s for a tidygraph object.)</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://stragu.codeberg.page/posts/2022-06-06_spatial-networks/images/paste-8141125C.png" class="img-fluid figure-img"></p>
<figcaption>A visual explanation of sf objects by <a href="https://twitter.com/allison_horst/status/1071456081308614656">Allison Horst</a> (copyright hers): a dataframe with sticky geometries in a list column. The geometries are “sticky” because they don’t vanish when, say, you <code>select()</code> columns.</figcaption>
</figure>
</div>
<p>In the edges component of a network, it is also possible (or necessary) to specify where the edge starts and finishes, using the <code>from</code> and <code>to</code> columns. Such information can be interpreted as the direction of the edge in a “directed” network, or simply as its two extremities in the case of an “undirected” network.</p>
<p>Finally, another important characteristic of the edges is their <strong>weight</strong>. This can relate to any kind of information, but if we are interested in distances between points, it will typically be the length of the edges.</p>
</section>
<section id="from-osm-data-to-an-sfnetwork" class="level2">
<h2 class="anchored" data-anchor-id="from-osm-data-to-an-sfnetwork">From OSM data to an sfnetwork</h2>
<p>Although the structure of an <code>sfnetwork</code> seems to be quite complex, it is possible – and useful! – to use a shortcut and create one from a simple collection of linestrings.</p>
<p>We can download download data from a spatial vector database like <a href="https://www.openstreetmap.org/">OpenStreetMap</a> (OSM), focus on the lines (or “ways”) and convert that <code>sf</code> object into an <code>sfnetwork</code> that will use the lines as edges, and their endpoints as nodes.</p>
<p>Let’s first download from OSM all the ways that are primarily used by pedestrians in the suburb of West End. (To understand how these features are tagged in the database, a good starting point is the <a href="https://wiki.openstreetmap.org/wiki/Map_Features">Map Features page on the OSM wiki</a>.)</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(osmdata)</span>
<span id="cb2-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(dplyr)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># build the query</span></span>
<span id="cb3-2">we_foot <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">opq</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"west end, meanjin"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb3-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">add_osm_features</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">features =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'"highway"="footway"'</span>,</span>
<span id="cb3-4">                                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'"highway"="steps"'</span>,</span>
<span id="cb3-5">                                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'"foot"="yes"'</span>,</span>
<span id="cb3-6">                                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'"highway"="living_street"'</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb3-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">osmdata_sf</span>()</span></code></pre></div></div>
</div>
<p>The osmdata package allows building Overpass queries to download OSM vector data that matches our criteria:</p>
<ul>
<li>Features tagged as <code>highway=footway</code>, including footpaths, crossings…</li>
<li>Features tagged as <code>highway=steps</code>, for stairs</li>
<li>Features tagged as <code>foot=yes</code>, for example bikeways on which foot traffic is allowed (see <a href="https://www.openstreetmap.org/way/29124510">this shared bikeway</a> for an example)</li>
<li>Features tagged as <code>highway=living_street</code>, a shared road on which pedestrians often have right of way</li>
</ul>
<p>Finding the right combination of OSM tags to use is always an iterative process, refining the selection at each step.</p>
<p>We choose to return an <code>sf</code> object, which might contain points, lines and polygons. We are only interested in the lines:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>(we_foot)</span>
<span id="cb4-2">we_foot_lines <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> we_foot<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>osm_lines</span></code></pre></div></div>
</div>
<p>We can visualise the resulting object with the sf package:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(sf) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># load sf for st_geometry, but also before using any dplyr methods </span></span>
<span id="cb5-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># for sf objects (like filter() and select())</span></span>
<span id="cb5-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># see https://github.com/ropensci/osmdata/issues/357#issuecomment-2962230662</span></span>
<span id="cb5-4">we_foot_lines <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb5-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_geometry</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb5-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>()</span></code></pre></div></div>
</div>
<p>It seems to have kept a ferry route, which was tagged with <code>foot=yes</code> and <code>route=ferry</code> on OSM. We can remove it:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">we_foot_lines <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> we_foot_lines <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb6-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(route))</span></code></pre></div></div>
</div>
<p>Another caveat in our process is that some footpaths are mapped as closed ways on OSM, and are therefore returned as a polygon:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">we_foot<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>osm_polygons <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb7-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_geometry</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb7-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>()</span></code></pre></div></div>
</div>
<p>The smaller ones are proper pedestrian areas, but the bigger ones are probably footpaths encircling a whole residential block. It is possible to “cast” these polygons as ways and include them in the network:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cast polygons to lines</span></span>
<span id="cb8-2">poly_to_lines <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_cast</span>(we_foot<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>osm_polygons, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LINESTRING"</span>)</span>
<span id="cb8-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># bind all lines together</span></span>
<span id="cb8-4">we_foot_lines <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(we_foot_lines, poly_to_lines)</span>
<span id="cb8-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># remove columns with problematic names</span></span>
<span id="cb8-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (there would be an error when we use to_spatial_smooth)</span></span>
<span id="cb8-7">we_foot_lines <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(we_foot_lines, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">contains</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>))</span></code></pre></div></div>
</div>
<p>This is what we are left with:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># plot it</span></span>
<span id="cb9-2">we_foot_lines <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb9-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_geometry</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb9-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>()</span></code></pre></div></div>
</div>
<p>We can now convert the object to an <code>sfnetwork</code> object, making sure we set it as undirected (the default is <code>directed = TRUE</code>):</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(sfnetworks)</span>
<span id="cb10-2">foot_net <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_sfnetwork</span>(we_foot_lines, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">directed =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb10-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(foot_net)</span></code></pre></div></div>
</div>
</section>
<section id="prepare-the-network" class="level2">
<h2 class="anchored" data-anchor-id="prepare-the-network">Prepare the network</h2>
<section id="crs" class="level3">
<h3 class="anchored" data-anchor-id="crs">CRS</h3>
<p>The current coordinate system for the network is a global one, EPSG:4326.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_crs</span>(foot_net)</span></code></pre></div></div>
</div>
<p><code>st_transform()</code> allows us to transform the coordinates to a different projection. For this part of the world, a recent Projected Reference System is <a href="https://epsg.io/7856">EPSG:7856</a> (or “GDA2020 / MGA zone 56”).</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1">foot_net <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_transform</span>(foot_net, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7856</span>)</span></code></pre></div></div>
</div>
<p>If the command above gives you a GDAL error, reassign the original CRS first: <code>st_crs(foot_net) &lt;- 4326</code></p>
</section>
<section id="clean-up" class="level3">
<h3 class="anchored" data-anchor-id="clean-up">Clean up</h3>
<p>sfnetworks and tidygraph include many pre-processing and cleaning functions for graphs, some of them detailed in <a href="https://luukvdmeer.github.io/sfnetworks/articles/sfn02_preprocess_clean.html">this article</a>.</p>
<p>One relevant example for this dataset is the <strong>subdivision of edges</strong>: because some edges have interior nodes that are endpoints of other edges, they will not be connected to each other when analysing the network.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://stragu.codeberg.page/posts/2022-06-06_spatial-networks/images/paste-5AC5A8E2.png" class="img-fluid figure-img"></p>
<figcaption>The green and pink edges are not considered connected when routing, for example. The green edge needs to be divided into two edges so endpoints connect. Keep in mind that the blue and purple crossing edges will also be subdivided in this process, because they do share a point at their intersection. (Copyright: tidygraph authors)</figcaption>
</figure>
</div>
<p>We need to combine tidygraph’s <code>convert()</code> function with a “spatial morpher” function from sfnetworks:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(tidygraph)</span>
<span id="cb13-2">foot_net <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">convert</span>(foot_net, to_spatial_subdivision)</span></code></pre></div></div>
</div>
<p>The network should now contain more edges.</p>
<p>Note that this will only happen for features sharing a node: if two edges overlap, like for bridges and underpaths, no extra node will be created where they cross, and therefore no new connecting endpoints will be created for them – which is good news!</p>
<p>Also note that using <code>to_spatial_subdivision()</code> will copy tags into each of the subdivisions of an edge. This usually isn’t a problem (think speed limits, surface, lighting, width…) but can be in some cases (for example if the length of the edge had already been added). The order of processing often matters.</p>
<p>Another example is the removal of nodes that have only two edges connected, also called “<strong>smoothing of pseudo-nodes</strong>”. This would be useful to simplify a network and reduce the processing times needed. We again use a combination of <code>convert()</code> with the relevant spatial morpher, <code>to_spatial_smooth()</code>:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">foot_simple <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">convert</span>(foot_net, to_spatial_smooth)</span>
<span id="cb14-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(foot_simple)</span></code></pre></div></div>
</div>
<p>For our example, simplifying the network might not be useful:</p>
<ul>
<li>If we calculate isodistances or isochrones, reducing the number of nodes will reduce the precision;</li>
<li>Once again, one needs to take care of the potential loss of valuable data. For example, do nodes contain relevant tags, like ones describing physical barriers? And how will the combined edges’ tags be stored?</li>
</ul>
<p>More information about “spatial morphers”, including what options exist for dealing with attributes when multiple features are merged, is available in the documentation: <code>?spatial_morphers</code></p>
</section>
<section id="weights" class="level3">
<h3 class="anchored" data-anchor-id="weights">Weights</h3>
<p>As mentioned before, a common weight associated with each edge of the network is the edge’s length. We can add this weight to our network, but we need to first “activate” the part of the object we want to modify:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">foot_net <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> foot_net <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb15-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">activate</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"edges"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb15-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">weight =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">edge_length</span>())</span></code></pre></div></div>
</div>
<p>Using <code>st_as_sf()</code>, we can extract the components of an <code>sfnetwork</code> object and use them in a familiar plotting system like ggplot2:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(ggplot2)</span>
<span id="cb16-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb16-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_sf</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_as_sf</span>(foot_net, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"edges"</span>),</span>
<span id="cb16-4">          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mapping =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(weight))) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb16-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Edge length (m)"</span>)</span></code></pre></div></div>
</div>
</section>
</section>
<section id="interactive-map" class="level2">
<h2 class="anchored" data-anchor-id="interactive-map">Interactive map</h2>
<p>At this point, it might be interesting to create an interactive visualisation to zoom into, which might help spot issues with the data.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(tmap)</span>
<span id="cb17-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tmap_mode</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"view"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># set to interactive mode</span></span>
<span id="cb17-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tm_basemap</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CartoDB.Positron"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb17-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tm_shape</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_as_sf</span>(foot_net, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"edges"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb17-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tm_lines</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"footway"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">palette =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Accent"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colorNA =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb17-6"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tm_shape</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_as_sf</span>(foot_net, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nodes"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb17-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tm_dots</span>()</span></code></pre></div></div>
</div>
<section id="remove-small-disconnected-neighbourhoods" class="level3">
<h3 class="anchored" data-anchor-id="remove-small-disconnected-neighbourhoods">Remove small disconnected neighbourhoods</h3>
<p>There are a few “islands” in the network, in which not many points are connected to each other. We can remove those, by:</p>
<ol type="1">
<li>Choosing how far we look to determine the size of a neighbourhood, with tidygraph’s <code>local_size()</code> function</li>
<li>Only keeping the neighbourhoods that have reached that threshold.</li>
</ol>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1">foot_net <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> foot_net <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb18-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">activate</span>(nodes) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb18-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">neighbourhood =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">local_size</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">order =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb18-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(neighbourhood <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
</div>
</section>
</section>
<section id="isodistances" class="level2">
<h2 class="anchored" data-anchor-id="isodistances">Isodistances</h2>
<p>Let’s now draw an isodistance around the <a href="https://www.openstreetmap.org/way/523925261">Kurilpa Library in West End</a>. First, download the library’s feature from OSM, and calculate its centroid (because it is mapped as a building):</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1">kurilpa_lib <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">opq_osm_id</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">id =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">523925261</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"way"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb19-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">osmdata_sf</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb19-3">  .<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>osm_polygons <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb19-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_centroid</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb19-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_set_crs</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4326</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (if the following step generates a GDAL error)</span></span>
<span id="cb19-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_transform</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">crs =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7856</span>)</span></code></pre></div></div>
</div>
<p>Then, calculate the isodistance for a distance smaller or equal to 1 km (more or less a 15-minute walk), using the <code>node_distance_from()</code> function from tidygraph:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1">foot_net <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">activate</span>(foot_net, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nodes"</span>)</span>
<span id="cb20-2">iso <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> foot_net <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb20-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dist_to_lib =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">node_distance_from</span>(</span>
<span id="cb20-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_nearest_feature</span>(kurilpa_lib, foot_net),</span>
<span id="cb20-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">weights =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(weight))</span>
<span id="cb20-6">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb20-7">  dplyr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(dist_to_lib <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>)</span></code></pre></div></div>
</div>
<p>Finally, draw a polygon around the isodistance, and plot everything:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1">iso_poly <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> iso <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb21-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_geometry</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb21-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_combine</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb21-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_convex_hull</span>()</span>
<span id="cb21-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(foot_net, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey"</span>)</span>
<span id="cb21-6"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(iso_poly, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">border =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"black"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">add =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb21-7"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(iso, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lightgreen"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">add =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb21-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(kurilpa_lib, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pch =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cex =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">add =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span></code></pre></div></div>
</div>
</section>
<section id="shortest-path" class="level2">
<h2 class="anchored" data-anchor-id="shortest-path">Shortest path</h2>
<p>Let’s now calculate the shortest distance from the South Brisbane Sailing Club to the library.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># get the location of the Sailing Club's entrance</span></span>
<span id="cb22-2">sailing_club <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">opq_osm_id</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">id =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7622867925</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"node"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb22-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">osmdata_sf</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb22-4">  .<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>osm_points <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb22-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_set_crs</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4326</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (if the following step generates a GDAL error)</span></span>
<span id="cb22-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_transform</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">crs =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7856</span>)</span>
<span id="cb22-7"></span>
<span id="cb22-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># calculate the shortest path</span></span>
<span id="cb22-9">shortest <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> foot_net <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb22-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">activate</span>(edges) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb22-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_network_paths</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">from =</span> sailing_club, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">to =</span> kurilpa_lib)</span>
<span id="cb22-12"></span>
<span id="cb22-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># extract the node IDs</span></span>
<span id="cb22-14">node_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> shortest <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb22-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb22-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(node_paths) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb22-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unlist</span>()</span>
<span id="cb22-18"></span>
<span id="cb22-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># only keep the network for these nodeIDs</span></span>
<span id="cb22-20">path_sf <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> foot_net <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb22-21">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">activate</span>(nodes) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb22-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice</span>(node_path) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> </span>
<span id="cb22-23">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_as_sf</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"edges"</span>)</span>
<span id="cb22-24"></span>
<span id="cb22-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># visualise</span></span>
<span id="cb22-26"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tm_basemap</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CartoDB.Positron"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-27"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tm_shape</span>(path_sf) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-28">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tm_lines</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-29"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tm_shape</span>(sailing_club) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-30">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tm_dots</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"blue"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-31"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tm_shape</span>(kurilpa_lib) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-32">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tm_dots</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"green"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span></code></pre></div></div>
</div>
<p>The granularity of the OSM data available for this area allows us to create a precise path for pedestrians, switching sides of roads only when a crossing is reached. However, every new analysis of the network might reveal more interesting information about the data we have used. For example, the shortest path calculated might go through private residential paths (usually blocked by gates), and avoiding those would mean extra steps in pre-processing (for example keeping track of existing OSM tags like <code>barrier=*</code> on nodes and <code>access=private</code> on ways).</p>
</section>
<section id="further-resources" class="level2">
<h2 class="anchored" data-anchor-id="further-resources">Further resources</h2>
<ul>
<li><a href="https://luukvdmeer.github.io/sfnetworks/index.html">sfnetworks’ documentation</a>, including its 5 articles, which inspired much of this tutorial</li>
<li>tidygraph’s gigantic <a href="https://tidygraph.data-imaginist.com/reference/index.html">collection of graph manipulation functions</a></li>
<li><a href="https://geocompr.robinlovelace.net/transport.html">Transportation chapter</a> in the free <em>Geocomputation with R book</em> (Lovelace, Nowosad, Muenchow)</li>
<li><a href="https://www.youtube.com/watch?v=2cCXUYgEtGw">Spatial network analysis with the {sfnetworks} package</a>, video on analysing OSM data with sfnetworks, by Renate Thiede, for R-Ladies Johannesburg (2021)</li>
<li><a href="https://r-spatial.org/r/2019/09/26/spatial-networks.html"><em>Spatial networks in R with sf and tidygraph</em></a>, article by van der Meer, Abad and Lovelace (2019)</li>
<li>Other related packages:
<ul>
<li><a href="https://ggraph.data-imaginist.com/">ggraph</a> for graph visualisation</li>
<li><a href="https://docs.ropensci.org/stplanr/">stplanr</a> for sustainable transport planning and modeling</li>
<li><a href="https://github.com/vlarmet/cppRouting">cppRouting</a> for calculating distances, shortest paths and isochrones/isodistances</li>
<li><a href="https://atfutures.github.io/dodgr/">dodgr</a> for distance and time calculations on directed graphs (and <a href="https://cran.r-project.org/web/packages/dodgr/vignettes/times.html">its vignette on street network routing based on OSM data</a>)</li>
<li><a href="https://rgeomatic.hypotheses.org/category/osrm">osrm</a> for using a routing API based on OSM data</li>
</ul></li>
</ul>
</section>
<section id="r-session-details" class="level2">
<h2 class="anchored" data-anchor-id="r-session-details">R session details</h2>
<p>System and packages used to run the code when this page was last rendered.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center collapsed" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse">
<div class="callout-body-container callout-body">
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sessionInfo</span>()</span></code></pre></div></div>
</div>
</div>
</div>
</div>
</section>
<section id="legal" class="level2">
<h2 class="anchored" data-anchor-id="legal">Legal</h2>
<p>Apart for illustrations in which the copyright is mentioned, this article is released under a CC-BY 4.0 licence. All data used for the data visualisations use OpenStreetMap data, which is <a href="https://www.openstreetmap.org/copyright">© OpenStreetMap contributors but released under an ODBL licence</a>.</p>


</section>

 ]]></description>
  <category>spatial</category>
  <category>R</category>
  <category>tutorial</category>
  <guid>https://stragu.codeberg.page/posts/2022-06-06_spatial-networks/</guid>
  <pubDate>Sun, 05 Jun 2022 14:00:00 GMT</pubDate>
  <media:content url="https://stragu.codeberg.page/posts/2022-06-06_spatial-networks/featured.png" medium="image" type="image/png" height="119" width="144"/>
</item>
</channel>
</rss>
