<?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>évologie</title>
<link>https://evologie.netlify.app/</link>
<atom:link href="https://evologie.netlify.app/index.xml" rel="self" type="application/rss+xml"/>
<description>Réflexions sur l&#39;évolution, la biodiversité et la vie</description>
<generator>quarto-1.8.26</generator>
<lastBuildDate>Mon, 19 Jan 2026 05:00:01 GMT</lastBuildDate>
<item>
  <title>Guide d’identification de biodiversité du Québec - Partie 1 : les cartes</title>
  <dc:creator>Marc-Olivier Beausoleil</dc:creator>
  <link>https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/Guide_biodiv_qc_1.html</link>
  <description><![CDATA[ 





<section id="un-guide-qui-sadapte" class="level2">
<h2 class="anchored" data-anchor-id="un-guide-qui-sadapte">Un guide qui s’adapte</h2>
<p>Dans le <a href="../../../posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/Guide_biodiv_qc_0.html">dernier billet</a> où nous parlions de biodiversité, nous avons terminé sur mon plan pour faire un projet permettant de représenter la biodiversité du Québec dans un dépliant. Ce guide d’identification serait basé sur les données de science citoyenne et sur des données publiques qui nous permettraient de faire des cartes.</p>
<p>Avant de se lancer dans ce billet, qui est un tutoriel pour faire de la cartographie dans R, voici mon plan détaillé pour ce projet.</p>
<section id="plan-et-objectifs-du-projet" class="level3">
<h3 class="anchored" data-anchor-id="plan-et-objectifs-du-projet">Plan et objectifs du projet</h3>
<p>Pour ce projet, nous devons remplir quelques objectifs qui seront abordés lors de cette série «&nbsp;Guide d’identification de biodiversité du Québec&nbsp;» :</p>
<ol type="A">
<li><strong>Cartographie et spatialisation des données</strong></li>
</ol>
<p>1.1 <strong>Cartographie de référence</strong> : produire une carte avec les MRC du Québec et les domaines biologiques du Québec;</p>
<p>1.2 <strong>Identification des zones critiques de biodiversité</strong> : obtenir et cartographier des sites ornithologiques ayant un fort volume d’observations issues de la science citoyenne, et qui seront utilisées pour mettre en évidence des zones à haut potentiel de biodiversité;</p>
<p>2.1 <strong>Inventaire des espèces observées</strong> : élaborer, pour une région d’intérêt donnée, une liste d’espèces souvent vues par la science citoyenne ;</p>
<ol start="2" type="A">
<li><strong>Contenu descriptif et visuel pour le dépliant (optionnel)</strong></li>
</ol>
<p>3.1 <strong>Liste de traits</strong> : Compiler des informations morphologiques (longueur, envergure, poids, etc.) à intégrer aux descriptions. Selon le design du dépliant, ajouter des éléments pédagogiques comme des trucs mnémotechniques pour l’identification des oiseaux chanteurs.</p>
<p>3.2 <strong>Portrait photo des organismes</strong> : Intégrer des photos d’organismes afin d’enrichir le contenu visuel et faciliter l’identification.</p>
<p>La première partie de cette série commence par la cartographie (1.1 et 1.2) puisque nous allons avoir besoin de manipuler de l’information spatiale lorsque nous allons travailler avec des données de biodiversité (dans un autre billet de blogue). Plus spécifiquement, nous utiliserons des progiciels<sup>1</sup> <a href="https://cran.r-project.org">R</a> pour faire des analyses spatiales. J’assume ici une familiarité avec le langage R <span class="citation" data-cites="R-base">(R Core Team 2024)</span>. Si vous voulez débuter avec le langage R, je recommande les <a href="https://r.qcbs.ca/fr/workshops/" target="_blank">ateliers R du Centre de la science de la biodiversité du Québec</a>.</p>
</section>
<section id="reproduire-les-analyses" class="level3">
<h3 class="anchored" data-anchor-id="reproduire-les-analyses">Reproduire les analyses</h3>
<p>Si vous voulez reproduire les analyses ou suivre le code en même temps, l’ensemble des données et les scripts de ce projet sont disponibles sur <a href="https://github.com/beausoleilmo/guide_biodiv">GitHub : beausoleilmo/guide_biodiv</a>. Des instructions sont présentes pour débuter avec ce projet.</p>
<!-- [^2]. -->
<!-- [^2]: Les données sont aussi présentes sur le site [de l'Open Science Framework (OSF) : Guide d’identification de biodiversité du Québec](https://osf.io/92zv4/overview?view_only=528c78edcd814d10a7204e72fdde8490) [@MOBGuideIDBiodiv2025]. Cliquez sur les données (data.zip), téléchargez (icone de téléchargement) et décompressez le fichier. La structure des dossiers de données respecte la structure dans les scripts R. N'hésitez pas à vous pratiquer! Si quelque chose ne tourne pas rond, les commentaires sont bienvenus!  -->
<p>Notez que les progiciels et données ont leur référence dans le fichier <a href="https://github.com/beausoleilmo/evologie/blob/7253741bf2edba6bffb354c396cd53c72c804b48/posts/ref_blg.bib"><code>ref_blg.bib</code></a> et sont cités à la fin de ce billet.</p>
</section>
</section>
<section id="recherche-de-données" class="level2">
<h2 class="anchored" data-anchor-id="recherche-de-données">Recherche de données</h2>
<p>Pour réaliser le projet, nous devons trouver des jeux de données pertinents pour faire une carte et mettre des observations de biodiversité. Beaucoup de jeux de données pour de l’information cartographique administrative ou décrivant le territoire sont disponibles sur <a href="https://www.donneesquebec.ca">Données Québec (DQC)</a>. Pour la biodiversité, le <a href="https://www.gbif.org">Global Biodiversity Information Facility (GBIF) ou Système mondial d’information sur la biodiversité (SMIB)</a> est <strong>la</strong> source de données la plus reconnue, en particulier pour les données de présence d’espèces Les acronymes (DQC, GBIF, etc.) seront utilisés à côté d’un jeu de données pour connaître leur source rapidement.</p>
<section id="données-administratives-et-du-territoire-villes-hydrologie-etc." class="level3">
<h3 class="anchored" data-anchor-id="données-administratives-et-du-territoire-villes-hydrologie-etc.">Données administratives et du territoire (villes, hydrologie, etc.)</h3>
<p>Voici les jeux de données que je propose pour faire notre carte de base (disponible sur <a href="https://osf.io/92zv4/overview?view_only=528c78edcd814d10a7204e72fdde8490">l’Open Science Framework (OSF)</a>) :</p>
<ul>
<li><strong>Régions administratives</strong> : <a href="https://www.donneesquebec.ca/recherche/dataset/decoupages-administratifs/resource/b368d470-71d6-40a2-8457-e4419de2f9c0">Découpages administratifs (DQC)</a> <span class="citation" data-cites="MRNFDecAdmin2018">(Ministère des Ressources Naturelles et des Forêts 2018)</span> et celles du site <a href="https://www12.statcan.gc.ca/census-recensement/2021/geo/sip-pis/boundary-limites/index2021-fra.cfm?year=21">Statistique Canada</a> pour les limites du recensement du Canada (voir <em>Recensement de 2021 - Fichiers des limites</em> <span class="citation" data-cites="statistiquecanadaRecensement2021Fichier2025">(Statistique Canada 2025)</span>);</li>
<li><strong>Hydrologie</strong> : <a href="https://www.donneesquebec.ca/recherche/fr/dataset/grhq">Géobase du réseau hydrographique du Québec (GRHQ; DQC)</a> <span class="citation" data-cites="MRNFGeobaseResHydro2019">(Ministère des Ressources Naturelles et des Forêts 2019)</span>;</li>
<li><strong>Référence écologique</strong> du Québec avec information sur les biomes : <a href="https://www.donneesquebec.ca/recherche/dataset/systeme-hierarchique-de-classification-ecologique-du-territoire/resource/b336d842-9f1d-4d0e-88c1-d771d8ade785">Classification écologique du territoire québécois (DQC)</a> <span class="citation" data-cites="MRNFClassEcoTerritoire2016">(Ministère des Ressources Naturelles et des Forêts 2016)</span>;</li>
<li><strong>Villes et toponymie</strong> : Quelques données provenant du <a href="https://portraits.ouranos.ca/fr/spatial?a=0&amp;c=0&amp;discrete=1&amp;e=CMIP6&amp;fro=1&amp;i=tg_mean&amp;mun=0&amp;p=50&amp;r=qc000&amp;s=annual&amp;scen=ssp370&amp;w=0&amp;yr=2071">portail de données des portraits climatiques d’Ouranos</a> pour le nom des villes et la population de celles-ci <span class="citation" data-cites="ouranosPlaces2024">(Ouranos 2024)</span>. Par contre, la <em>Base de données toponymiques du Canada (BDTC)</em> pourrait être utilisée pour le Canada et sélectionner les villes, les parcs ou autres entités ayant un toponyme <span class="citation" data-cites="GouvCanRessNatCan2025">(Gouvernement du Canada 2025)</span>. Ce dernier jeu de données contient des règles d’affichage des étiquettes de toponymie selon l’échelle, mais nous allons pas utiliser celui-ci dans ce tutoriel.</li>
</ul>
</section>
<section id="données-de-biodiversité-de-science-citoyenne" class="level3">
<h3 class="anchored" data-anchor-id="données-de-biodiversité-de-science-citoyenne">Données de biodiversité de science citoyenne</h3>
<p>Pour les données de biodiversité, il existe aussi plusieurs sources. D’abord, il y a le <a href="https://www.gbif.org">Global Biodiversity Information Facility (GBIF)</a> qui contient en date d’octobre 2025, plus de 43&nbsp;millions de données de présences d’individus pour le Québec (vous pouvez aller voir cette information directement sur le <a href="https://www.gbif.org/occurrence/search?occurrence_status=present&amp;gadm_gid=CAN.11_1">site web GBIF avec le filtre de région</a>). Les données de biodiversité du Québec seront explorées dans la deuxième partie de cette série.</p>
<ul>
<li><strong>Points d’observations eBird</strong> : voir la <a href="https://support.ebird.org/en/support/solutions/articles/48001009443-ebird-hotspot-faqs#anchorAllHotspots">documentation ici</a> pour accéder aux données. J’en reparlerai plus tard dans le billet;</li>
<li><strong>Données de présence d’espèces</strong> : <a href="https://www.gbif.org">GBIF</a> qui peuvent être accessibles directement sur le site web ou avec le <a href="https://docs.ropensci.org/rgbif/index.html">progiciel <code>rgbif</code></a> <span class="citation" data-cites="R-rgbif">(Chamberlain, Oldoni, et Waller 2025)</span>.</li>
</ul>
<p>Aussi, il pourrait être intéressant d’avoir des informations sur la taille des organismes et autres traits morphologiques. Au lieu d’aller chercher ces valeurs individuellement, des bases de données sont déjà disponibles, pour les oiseaux <span class="citation" data-cites="tobiasAVONETMorphologicalEcological2022">(Tobias et al. 2022)</span> et plus généralement pour les mammifères et les reptiles <span class="citation" data-cites="myhrvoldAmnioteLifehistoryDatabase2015">(Myhrvold et al. 2015)</span>.</p>
<ul>
<li><strong>Traits des espèces</strong> (optionnel) : <a href="https://figshare.com/s/b990722d72a26b5bfead">AVONET pour les oiseaux</a> <span class="citation" data-cites="tobiasAVONETMorphologicalEcological2022">(Tobias et al. 2022)</span> ou une <a href="https://www.esapubs.org/archive/ecol/E096/269/">base de données des oiseaux, mammifères et reptiles</a> <span class="citation" data-cites="myhrvoldAmnioteLifehistoryDatabase2015">(Myhrvold et al. 2015)</span>.</li>
</ul>
<p>Finalement, des portails de science citoyenne, comme <a href="https://inaturalist.ca" target="_blank">iNaturalist</a>, permettent d’enregistrer des observations de la nature. Un des fondements de cette plateforme est d’avoir des preuves (photos ou enregistrement sonore) d’observation que la communauté peut identifier. Nous pourrions donc extraire des photos et finaliser notre projet de dépliant.</p>
<ul>
<li><strong>Photos des espèces</strong> (optionnel) : <a href="https://inaturalist.ca" target="_blank">iNaturalist</a> avec le <a href="https://github.com/ropensci/rinat">progiciel <code>rinat</code></a> <span class="citation" data-cites="R-rinat">(Barve et Hart 2025)</span>.</li>
</ul>
</section>
</section>
<section id="la-cartographie" class="level2">
<h2 class="anchored" data-anchor-id="la-cartographie">La cartographie</h2>
<p>Pour cette première partie, nous allons produire deux cartes pour le dépliant :</p>
<ol type="1">
<li>une carte couvrant l’ensemble du territoire du Québec afin d’offrir un contexte général,</li>
<li>une carte à plus fine échelle, mettant en évidence les principaux points d’intérêt en matière de biodiversité pour les régions de Montréal et Laval.</li>
</ol>
<!-- Notre plan de match est de préparer notre session R pour avoir les progiciels et fonctions nécessaires pour faire tourner nos scripts. Ensuite, nous allons produire notre carte de fond et une carte avec des points d'observation de biodiversité. -->
<!-- À noter ici que les scripts que vous voyez sont le résultat de la recherche et non une explication de tout le développement des scripts et toutes les réflexions. -->
</section>
<section id="sec-prepenv" class="level2">
<h2 class="anchored" data-anchor-id="sec-prepenv">Préparation de l’environnement R</h2>
<p>Tout d’abord, nous devons préparer l’environnement de travail R. Une procédure détaillée est disponible sur le <a href="https://github.com/beausoleilmo/guide_biodiv">projet GitHub beausoleilmo/guide_biodiv</a> dans le fichier <code>README.md</code>. En voici les grandes lignes.</p>
<p>L’environnement de travail a été capturé avec le progiciel <code>renv</code>, ce qui permet d’avoir les mêmes versions de progiciels R pour ce tutoriel.</p>
<p>Pour restaurer l’environnement de travail, un fichier <code>renv.lock</code> avec l’environnement de travail reproductible permet de préparer votre session R en installant les progiciels utilisés avec les mêmes versions pour ce tutoriel. Avec le progiciel <code>renv</code>, utilisez <code>renv::restore()</code> pour recréer cet espace.</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">renv<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;">restore</span>() <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Permet de restaurer la session avec les mêmes versions</span></span></code></pre></div></div>
</div>
<p>J’ai placé les progiciels R et autres scripts à appeler dans <code>00_initialize.R</code>.</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="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Lire le script de préparation automatiquement</span></span>
<span id="cb2-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">source</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">file =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'scripts/00_init/00_initialize.R'</span>)</span></code></pre></div></div>
</div>
<p>Celui-ci chargera les progiciels (vous devez tout de même installer les progiciels ou «&nbsp;<em>library</em>&nbsp;» avant!) et mettra en mémoire des fonctions pour faire nos analyses. La structure du fichier ressemble à cela :</p>
<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;"># Description ------</span></span>
<span id="cb3-2"></span>
<span id="cb3-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># [...]</span></span>
<span id="cb3-4"></span>
<span id="cb3-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Création des dossiers ------</span></span>
<span id="cb3-6"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dir.create</span>(...)</span>
<span id="cb3-7"></span>
<span id="cb3-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Progiciels R ------</span></span>
<span id="cb3-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(...)</span>
<span id="cb3-10"></span>
<span id="cb3-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Charge les fonctions ------</span></span>
<span id="cb3-12"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">source</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'abcdef.R'</span>)</span>
<span id="cb3-13"></span>
<span id="cb3-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># [...]</span></span></code></pre></div></div>
</div>
<p>J’ai construit le script <code>00_initialize.R</code> à mesure que je développais le projet. C’est pratique puisque pour un nouveau script, je peux simplement l’appeler (avec <code>source()</code>) et toutes les fonctions nécessaires seront à ma disposition.</p>
<p>Les principaux progiciels pour ce projet sont ici :</p>
<ul>
<li><code>ggplot2</code> pour faire des graphiques et des cartes <span class="citation" data-cites="ggplot22016 R-ggplot2">(Wickham 2016; Wickham et al. 2024)</span>,</li>
<li><code>dplyr</code> pour la manipulation de données <span class="citation" data-cites="R-dplyr">(Wickham et al. 2023)</span>,</li>
<li><code>sf</code> pour l’analyse spatiale <span class="citation" data-cites="sf2023 sf2018 R-sf">(Pebesma et Bivand 2023; Pebesma 2018, 2025)</span>,</li>
<li><code>mapview</code> pour faires cartes interactives simples <span class="citation" data-cites="R-mapview">(Appelhans et al. 2023)</span> et</li>
<li><code>rgbif</code> <span class="citation" data-cites="R-rgbif">(Chamberlain, Oldoni, et Waller 2025)</span> et rinat <span class="citation" data-cites="R-rinat">(Barve et Hart 2025)</span> pour la manipulation de données de biodiversité.</li>
</ul>
<p>Nous allons maintenant préparer le terrain pour faire notre carte de base.</p>
</section>
<section id="cartographie" class="level2">
<h2 class="anchored" data-anchor-id="cartographie">1.1 Cartographie</h2>
<p>Lorsqu’on fait des cartes, un fond permet de contextualiser l’information avec des marqueurs spatiaux (délimitation d’une région administrative, lacs ou cours d’eau importants, une ville, etc.). Aussi, les données du fond de la carte sont parfois pertinentes pour faire des manipulations spatiales. Par exemple, il arrive de recouper le territoire par des noms connus (régions administratives), de faire un sommaire en fonction de régions connues ou d’appliquer des filtres à l’échelle d’une MRC.</p>
<section id="carte-régions-administratives-du-québec" class="level3">
<h3 class="anchored" data-anchor-id="carte-régions-administratives-du-québec">Carte : régions administratives du Québec</h3>
<p>Les délimitations des MRC du Québec sont disponibles sur Données Québec sous <a href="https://www.donneesquebec.ca/recherche/dataset/decoupages-administratifs/resource/b368d470-71d6-40a2-8457-e4419de2f9c0">Découpages administratifs (DQC)</a>. Le fichier qui nous intéresse est <code>mrc_s.shp</code> : ce sont les polygones des MRC du Québec. L’original est un Shapefile. Mais je trouve cela plus élégant de mettre cela en géopackage (<code>.gpkg</code>), puisque tout se retrouve dans un seul fichier. De plus, les géopackages offrent plusieurs avantages par rapport à d’autres types de fichiers comme les Shapefiles.x Le script <code>scripts/partie_1/Preparation_admin_region.R</code> montre comment.</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="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fonctionne si vous téléchargez les jeux de données originaux localement. </span></span>
<span id="cb4-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">source</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">file =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'scripts/partie_1/Preparation_admin_region.R'</span>)</span></code></pre></div></div>
</div>
<p>Le progiciel <code>sf</code> permet de lire des fichiers pour nos analyses spatiales <span class="citation" data-cites="R-sf sf2018 sf2023">(Pebesma 2025, 2018; Pebesma et Bivand 2023)</span>.</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="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Charger le géopackage </span></span>
<span id="cb5-2">regqc <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> sf<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;">st_read</span>(</span>
<span id="cb5-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># DSN : data source name</span></span>
<span id="cb5-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dsn =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/partie_1/admin_geo/admin_reg_qc/mrc_s.gpkg"</span>, </span>
<span id="cb5-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quiet =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb5-6">) </span></code></pre></div></div>
</div>
<p>Regardons les premières lignes du jeu de données :</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"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Sélection de colonnes</span></span>
<span id="cb6-2">regqc <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb6-3">  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;">select</span>(</span>
<span id="cb6-4">    MRS_NM_MRC, </span>
<span id="cb6-5">    MRS_NM_REG</span>
<span id="cb6-6">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb6-7">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extraction de quelques lignes</span></span>
<span id="cb6-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Simple feature collection with 3 features and 2 fields
Geometry type: MULTIPOLYGON
Dimension:     XY
Bounding box:  xmin: -74.02858 ymin: 46.00672 xmax: -72.14935 ymax: 47.49639
Geodetic CRS:  NAD83
       MRS_NM_MRC       MRS_NM_REG                           geom
1  Trois-Rivières         Mauricie MULTIPOLYGON (((-72.69339 4...
2 Nicolet-Yamaska Centre-du-Québec MULTIPOLYGON (((-72.58621 4...
3         Mékinac         Mauricie MULTIPOLYGON (((-73.72068 4...</code></pre>
</div>
</div>
<p>Il serait intéressant de voir les données sur une carte rapidement. Le progiciel <a href="https://r-spatial.github.io/mapview/"><code>mapview</code></a> est utile pour faire une carte interactive et colorier les MRC <span class="citation" data-cites="R-mapview">(Appelhans et al. 2023)</span>. Pour ce tutoriel, je n’ai gardé que des cartes statiques de <code>mapview</code>, mais je vous laisse tester les bouts de code comme exercice!</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;"># Faire une carte interactive.</span></span>
<span id="cb8-2">mapview<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;">mapview</span>(</span>
<span id="cb8-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> regqc, </span>
<span id="cb8-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">zcol =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'MRS_NM_MRC'</span>, <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Les couleurs représentent les MRCs</span></span>
<span id="cb8-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ne pas ajouter de légende </span></span>
<span id="cb8-6">) </span></code></pre></div></div>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/output/partie_1/carte_mv_regqc.png" class="img-fluid figure-img"></p>
<figcaption>Carte des régions du Québec</figcaption>
</figure>
</div>
<p>Maintenant, regardons les données cartographiques qui représentent le territoire selon la nature de la végétation.</p>
</section>
<section id="carte-domaines-bioclimatiques" class="level3">
<h3 class="anchored" data-anchor-id="carte-domaines-bioclimatiques">Carte : domaines bioclimatiques</h3>
<p>Les données de la <a href="https://www.donneesquebec.ca/recherche/dataset/systeme-hierarchique-de-classification-ecologique-du-territoire/resource/b336d842-9f1d-4d0e-88c1-d771d8ade785">Classification écologique du territoire québécois (DQC)</a> vont nous donner un fond à mettre sur notre carte.</p>
<p>Je n’ai pas gardé le fichier complet puisque les données sont très lourdes. Le script <code>scripts/partie_1/Preparation_eco_region.R</code> prépare les données originales en un plus petit géopackage (<code>classification_eco.gpkg</code>) pour ce projet.</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;"># Fonctionne si vous téléchargez les jeux de données originaux localement. </span></span>
<span id="cb9-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">source</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">file =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'scripts/partie_1/Preparation_eco_region.R'</span>)</span></code></pre></div></div>
</div>
<p>Les données simplifiées sont mises en mémoire avec <code>st_read()</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">cls_eco <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_read</span>(</span>
<span id="cb10-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dsn =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/partie_1/ecologie/CLASSI_ECO_QC/classification_eco.gpkg"</span>, </span>
<span id="cb10-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">layer =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'N3_DOM_BIO'</span>, </span>
<span id="cb10-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quiet =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb10-5">)</span></code></pre></div></div>
</div>
<p>Puis nous allons utiliser le système de coordonnées ou CRS (<em>coordinate reference system</em>) de la couche de domaines bioclimatiques comme référence pour toutes les couches de notre projet.</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="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Obtenir notre CRS chouchou et l'utiliser comme base pour faire la carte </span></span>
<span id="cb11-2">projetCRS <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_crs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> cls_eco)</span>
<span id="cb11-3"></span>
<span id="cb11-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ce CRS est en fait le code EPSG 32198 qui est un système de coordonnées</span></span>
<span id="cb11-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># projetées 'Conique conforme de Lambert du Québec' NAD83</span></span>
<span id="cb11-6">projetCRS <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;">st_crs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32198</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] TRUE</code></pre>
</div>
<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="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Tester si le CRS est équivalent entre des couches </span></span>
<span id="cb13-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_crs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> cls_eco) <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;">st_crs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> regqc)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] FALSE</code></pre>
</div>
<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"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># On transforme le CRS de la région du Québec </span></span>
<span id="cb15-2">regqc_t <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <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;">x =</span> regqc, </span>
<span id="cb15-3">                       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">crs =</span> projetCRS)</span></code></pre></div></div>
</div>
<p>Vous pouvez aussi exporter la représentation <em>Well-known Text</em> (WKT) du système CRS avec <code>st_as_text()</code> pour stocker l’information dans un fichier texte.</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="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Écrire le WKT maitre sur lequel on peut faire référence </span></span>
<span id="cb16-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">writeLines</span>(</span>
<span id="cb16-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extraire le WKT comme texte seulement </span></span>
<span id="cb16-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">text =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_as_text</span>(projetCRS), </span>
<span id="cb16-5">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fichier de sortie pour écrire le texte (aussi appeler 'Connection') </span></span>
<span id="cb16-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">con =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/param_0/projetCRS.txt"</span></span>
<span id="cb16-7">) </span>
<span id="cb16-8"></span>
<span id="cb16-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Lire le fichier CRS maitre  </span></span>
<span id="cb16-10">projetCRS_read  <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">readLines</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">con =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/param_0/projetCRS.txt"</span>)</span>
<span id="cb16-11"></span>
<span id="cb16-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># On peut directement utiliser ce CRS de la région du Québec </span></span>
<span id="cb16-13">regqc_t <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <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;">x =</span> regqc, </span>
<span id="cb16-14">                       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">crs =</span> projetCRS_read)</span></code></pre></div></div>
</div>
<p>Nous pouvons superposer les cartes de régions administratives avec la classification des domaines écologiques avec <code>mapview()</code>. Vous pouvez activer ou désactiver les couches en passant votre curseur sur l’icône des couches spatiales (sous les contrôles plus et moins pour zoomer dans la carte) et en appuyant sur le bouton à bascule (boite à cocher) des couches désirées.</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="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Régions admin du QC</span></span>
<span id="cb17-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mapview</span>(</span>
<span id="cb17-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> regqc_t, </span>
<span id="cb17-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">zcol =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'MRS_NM_MRC'</span>, </span>
<span id="cb17-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">layer.name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'MRC du Québec'</span>,</span>
<span id="cb17-6">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Change la palette de couleur (voir les palettes ici `sort(hcl.pals())`)</span></span>
<span id="cb17-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col.regions =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">hcl.colors</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(regqc_t), </span>
<span id="cb17-8">                           <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;">"Spectral"</span>),</span>
<span id="cb17-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb17-10">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb17-11">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Classification Écologique</span></span>
<span id="cb17-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mapview</span>(</span>
<span id="cb17-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> cls_eco, </span>
<span id="cb17-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">zcol =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'NOM_DB'</span>, </span>
<span id="cb17-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">layer.name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Domaines biologiques'</span></span>
<span id="cb17-16">  )</span></code></pre></div></div>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/output/partie_1/carte_mv_class_reg.png" class="img-fluid figure-img"></p>
<figcaption>Carte de la classification des domaines écologiques et des régions du Québec</figcaption>
</figure>
</div>
<p>Cette carte n’est pas vraiment belle puisque les polygones sont superposés et empêche de bien voir les détails. Nous pourrions faire une carte qui superpose les <em>bordures</em> des régions administratives sur les domaines écologiques. C’est ce que nous allons faire avec une carte statique.</p>
</section>
<section id="cartes-statiques" class="level3">
<h3 class="anchored" data-anchor-id="cartes-statiques">Cartes statiques</h3>
<p>Le progiciel <code>ggplot2</code> <span class="citation" data-cites="ggplot22016 R-ggplot2">(Wickham 2016; Wickham et al. 2024)</span> a plusieurs fonctions pour ajouter des couches spatiales (par exemple <code>geom_sf</code>). Aussi, <code>ggplot()</code> ajoute les couches une par-dessus les autres : donc l’ordre dans lequel les couches sont placées pour faire la carte est important.</p>
<p>Pour que les cartes s’affichent correctement, il faut mettre les couches spatiales dans le même système de référence spatial ou CRS (<em>coordinate reference system</em>). Nous allons aussi utiliser <code>st_crs()</code> pour extraire le CRS d’une couche spatiale. Nous pouvons vérifier que nos couches spatiales sont dans le même CRS si <code>st_crs(cls_eco_simp) == st_crs(regqc)</code> est <code>TRUE</code> (ce n’est pas le cas dans l’exemple qui suit).</p>
<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"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Vérification du CRS de couches spatiales (FALSE si différentes)</span></span>
<span id="cb18-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_crs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> cls_eco) <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;">st_crs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> regqc)    </span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] FALSE</code></pre>
</div>
<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"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ici on avait déjà transformé la couche regqc_t.</span></span>
<span id="cb20-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_crs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> cls_eco) <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;">st_crs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> regqc_t)  </span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] TRUE</code></pre>
</div>
</div>
<p>Comme nous l’avons vu, la fonction <code>sf::st_transform()</code> nous permet de reprojeter une de nos couches spatiales avec le CRS d’une autre. Avant d’exécuter cette fonction, nous allons aussi simplifier nos couches spatiales. Cela peut être utile si on a des couches spatiales très détaillées qui pourraient ralentir <code>ggplot2</code>. La fonction <code>sf::st_simplify()</code> simplifie nos données spatiales et donc accélère l’affichage des cartes. À noter que la simplification n’est pas nécessaire à faire pour toutes les cartes.</p>
<p>Voici comment simplifier les couches spatiales et rendre le CRS identique entre 2 couches :</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;"># Pour la simplification des géométries </span></span>
<span id="cb22-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (nombre qui donne un bon résultat suite à des tests)</span></span>
<span id="cb22-3">tolerance <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span></span>
<span id="cb22-4"></span>
<span id="cb22-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Simplifier une forme pour faire le graphique </span></span>
<span id="cb22-6">cls_eco_simp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> cls_eco <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb22-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_simplify</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dTolerance =</span> tolerance)</span>
<span id="cb22-8"></span>
<span id="cb22-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Reprojection pour avoir le même CRS </span></span>
<span id="cb22-10">regqc_simp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> regqc <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_simplify</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dTolerance =</span> tolerance) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb22-12">  <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> projetCRS)</span>
<span id="cb22-13"></span>
<span id="cb22-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ou en utilisation le CRS d'une couche directement </span></span>
<span id="cb22-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># au lieu de l'objet 'projetCRS'</span></span>
<span id="cb22-16">regqc_simp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> regqc <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;">st_simplify</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dTolerance =</span> tolerance) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb22-18">  <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="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_crs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> cls_eco))</span></code></pre></div></div>
</div>
<p>Une fois les couches dans le même système de référence, nous pouvons dessiner notre carte avec <code>ggplot()</code> et <code>geom_sf()</code>. Je place chaque couche cartographique dans son objet ce qui facilitera la construction de la carte finale. Cela permet aussi de réutiliser des couches entre les graphiques.</p>
<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="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Faire le graphique de base ggplot </span></span>
<span id="cb23-2">gg_base <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>()</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Couche de domaines bioclimatiques </span></span>
<span id="cb24-2">gg_cls_eco <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_sf</span>(</span>
<span id="cb24-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> cls_eco,               <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Données </span></span>
<span id="cb24-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;">fill =</span> NOM_DB), <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># couleur selon les domaines biologiques</span></span>
<span id="cb24-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>,                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Transparence à 90% </span></span>
<span id="cb24-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Pas de ligne, plus beau! </span></span>
<span id="cb24-7">)                </span>
<span id="cb24-8"></span>
<span id="cb24-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Couche des régions administratives du Québec </span></span>
<span id="cb24-10">gg_reg_qc <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_sf</span>(</span>
<span id="cb24-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> regqc_simp,            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Données </span></span>
<span id="cb24-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>,                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Pas de remplissage des polygones</span></span>
<span id="cb24-13">  <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;">'grey100'</span>,           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Couleur des lignes</span></span>
<span id="cb24-14">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># largeur fine pour les lignes</span></span>
<span id="cb24-15">)</span></code></pre></div></div>
</div>
<p>Puis on assemble les couches pour faire la carte.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajout des couches ggplot dans l'ordre voulu </span></span>
<span id="cb25-2">gg_qc_db <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> gg_base <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb25-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajout de la classification écologique</span></span>
<span id="cb25-4">  gg_cls_eco <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb25-5">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajout des régions admin, par-dessus pour voir les bordures</span></span>
<span id="cb25-6">  gg_reg_qc</span></code></pre></div></div>
</div>
<p>Notez que la couche <code>gg_cls_eco</code> est dessinée en premier et <code>gg_reg_qc</code> après. Cela permet de voir les délimitations des régions administratives par-dessus les domaines bioclimatiques. Le graphique est dans l’objet <code>gg_qc_db</code>. Notez qu’on ajoute une palette de couleur et change le thème de base pour notre carte.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb26-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Afficher la carte </span></span>
<span id="cb26-2">gg_qc_db <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>          </span>
<span id="cb26-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Change le remplissage pour la palette viridis </span></span>
<span id="cb26-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_fill_viridis_d</span>(</span>
<span id="cb26-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajout d'un titre à la légende </span></span>
<span id="cb26-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">guide =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">guide_legend</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Domaine biologique'</span>)</span>
<span id="cb26-7">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-8">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Thème minimal </span></span>
<span id="cb26-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_void</span>()</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/Guide_biodiv_qc_1_files/figure-html/carte_statique_qc_affiche-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>Super! Un fond de carte pas pire pour l’ensemble du Québec! Par contre, il manque quelque chose pour s’y retrouver : l’eau et des villes.</p>
<section id="carte-hydrologie-et-villes" class="level4">
<h4 class="anchored" data-anchor-id="carte-hydrologie-et-villes">Carte : hydrologie et villes</h4>
<p>Notre carte de base manque de contexte. Plusieurs endroits au Québec sont facilement reconnaissables par leur structure hydrologique, ce qui permettrait de mieux se situer sur la carte.</p>
<p>La Géobase du réseau hydrographique du Québec (GRHQ) est un large ensemble de données de référence de l’hydrographie disponibles sur le site de <a href="https://www.donneesquebec.ca/recherche/fr/dataset/grhq">Données Québec (DQC)</a>. Nous allons seulement télécharger manuellement les données pour le sud du Québec (incluant les zones 00, 01, 02, 03, 04, 05, 06, 07_1, 07_2, 08, 14 de <a href="https://www.donneesquebec.ca/recherche/dataset/grhq/resource/4ef6703f-0ecb-46a0-bdb4-7074f00ff514">l’index de téléchargement (DQC)</a>). Un script (<code>scripts/partie_1/Preparation_hydrologique.R</code>) permet de préparer les données en géopackage (<code>data/partie_1/hydro/grhq_sud_qc.gpkg</code>) pour ce projet. Lors de la préparation pour réduire la taille du fichier, j’ai appliqué un filtre pour garder les polygones de <img src="https://latex.codecogs.com/png.latex?1e6%20m%5E2"> d’aire et plus, ce qui permet d’afficher l’essentiel des polygones pour notre carte et de réduire considérablement la taille du fichier.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fonctionne si vous téléchargez les jeux de données originaux localement. </span></span>
<span id="cb27-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">source</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">file =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'scripts/partie_1/Preparation_hydrologique.R'</span>)</span></code></pre></div></div>
</div>
<p>Les données préparées sont chargées et transformées avec le même CRS du projet.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb28-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Lire les données retravaillées du GRHQ</span></span>
<span id="cb28-2">hq_filt_complete <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_read</span>(</span>
<span id="cb28-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dsn =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'data/partie_1/hydro/grhq_sud_qc.gpkg'</span>, </span>
<span id="cb28-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quiet =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb28-5">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb28-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> projetCRS)</span></code></pre></div></div>
</div>
<p>Aussi, nous pourrions inclure le nom de villes avec une grande population sur la carte, ce qui serait super pour visualiser les données. Le site de <a href="https://portraits.ouranos.ca/fr/">portraits climatiques d’Ouranos</a> a un fichier qui nous facilitera la tâche. Nous pouvons télécharger les données directement avec le lien. Nous allons ensuite extraire certaines villes pour afficher sur la carte.</p>
<p>Le script <code>scripts/partie_1/Preparation_villes.R</code> prépare un fichier géopackage (<code>data/partie_1/villes/villes_qc_ouranos.gpkg</code>) que nous pouvons charger directement. Le script importe un fichier <code>GeoJSON</code> disponible sur le site d’Ouranos directement à partir d’un lien html (voir l’objet <code>lien_villes</code> dans le script de préparation). La création d’un géopackage pour ce projet permet de stocker ces données et d’y faire référence même si le serveur Ouranos change ou devient inaccessible.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fonctionne si vous téléchargez les jeux de données originaux localement. </span></span>
<span id="cb29-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">source</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">file =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'scripts/partie_1/Preparation_villes.R'</span>)</span></code></pre></div></div>
</div>
<p>Nous pouvons charger notre géopackage et sélectionner des villes qui nous intéresse pour mettre sur notre carte.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb30-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Lecture du fichier des villes et populations du site d'Ouranos</span></span>
<span id="cb30-2">villes_qc <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_read</span>(</span>
<span id="cb30-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dsn =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'data/partie_1/villes/villes_qc_ouranos.gpkg'</span>,</span>
<span id="cb30-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quiet =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb30-5"></span>
<span id="cb30-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Afficher le nom des villes au besoin </span></span>
<span id="cb30-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># sort(villes_qc$name)</span></span>
<span id="cb30-8"></span>
<span id="cb30-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Vecteur avec le nom des villes </span></span>
<span id="cb30-10">villes_selection <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</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;">'Montréal'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Québec'</span>, </span>
<span id="cb30-11">                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Gatineau'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Sherbrooke'</span>, </span>
<span id="cb30-12">                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Saguenay'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Trois-Rivière'</span>, </span>
<span id="cb30-13">                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Rouyn-Noranda"</span>, </span>
<span id="cb30-14">                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Gaspé'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Témiscaming'</span>, </span>
<span id="cb30-15">                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Sept-Îles'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Rimouski'</span>)</span>
<span id="cb30-16"></span>
<span id="cb30-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extraction du nom de villes à ajouter sur la carte</span></span>
<span id="cb30-18">villes_qc_lst_flt <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> villes_qc <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb30-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(name <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> villes_selection)</span></code></pre></div></div>
</div>
<p>J’ai remarqué qu’une partie du réseau hydrique de la GRHQ déborde en Ontario. Il faut donc extraire ou filtrer les données qui se retrouvent seulement au Québec. Le site <a href="https://www12.statcan.gc.ca/census-recensement/2021/geo/sip-pis/boundary-limites/index2021-fra.cfm?year=21">Statistique Canada</a> permet de télécharger les limites du recensement du Canada (voir <em>Recensement de 2021 - Fichiers des limites</em>). Le script <code>scripts/partie_1/Preparation_admin_region.R</code> prépare les données dans un géopackage avec nom <code>can_lim.gpkg</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb31-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Lire le fichier </span></span>
<span id="cb31-2">can_bord <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_read</span>(</span>
<span id="cb31-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dsn =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/partie_1/admin_geo/admin_reg_can/can_lim.gpkg"</span>, </span>
<span id="cb31-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quiet =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb31-5">)</span>
<span id="cb31-6"></span>
<span id="cb31-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extraire les limites du Québec et de l'Ontario </span></span>
<span id="cb31-8">qcont_bord <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> can_bord <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb31-9">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PRFNOM: Nom de la province ou du territoire, en français.</span></span>
<span id="cb31-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(PRFNOM <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</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;">"Québec"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ontario"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb31-11">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Changer le CRS </span></span>
<span id="cb31-12">  <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> projetCRS) </span></code></pre></div></div>
</div>
<p>Étant donné qu’une partie du réseau hydrique est en Ontario, on fait une intersection pour «&nbsp;couper&nbsp;» les géométries selon la province (<code>st_intersection()</code>), puis on filtre pour ne garder que le nom de la province de notre choix (<code>filter()</code>).</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb32-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extraction de l'hydrologie du Québec seulement</span></span>
<span id="cb32-2">hq_filt_qc <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> hq_filt_complete <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb32-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Intersection avec le fichier de l'Ontario et du Québec</span></span>
<span id="cb32-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_intersection</span>(qcont_bord) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb32-5">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Garder seulement ce qui se retrouve au Québec</span></span>
<span id="cb32-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(PRFNOM <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;">"Québec"</span>)</span></code></pre></div></div>
</div>
<p>Avec cette couche filtrée, nous allons créer un objet <code>geom_sf()</code> qu’on ajoutera à la carte.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb33-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Couche ggplot de l'hydrologie du Québec</span></span>
<span id="cb33-2">gg_hq <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_sf</span>(</span>
<span id="cb33-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> hq_filt_qc, </span>
<span id="cb33-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb33-5">  <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;">'lightblue'</span>, <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Couleur de l'eau </span></span>
<span id="cb33-6">  <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;">'lightblue'</span></span>
<span id="cb33-7">)</span>
<span id="cb33-8"></span>
<span id="cb33-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajout le point des villes </span></span>
<span id="cb33-10">gg_villes <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_sf</span>(</span>
<span id="cb33-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> villes_qc_lst_flt</span>
<span id="cb33-12">)</span></code></pre></div></div>
</div>
<p>Pour ne pas que les étiquettes des villes se chevauchent, nous allons utiliser une fonction (<code>geom_text_repel</code>) qui utilise des nombres aléatoires. Pour une reproductibilité de la carte, un point de départ est choisi pour obtenir des nombres aléatoires avec <code>set.seed()</code>. Ce point de départ (<em>seed</em>, germe ou graine aléatoire) est un nombre entier comme <code>12345</code> ou <code>247966138</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb34-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Établir le germe aléatoire</span></span>
<span id="cb34-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set.seed</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seed =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12345</span>)</span></code></pre></div></div>
</div>
<p>Maintenant, nous avons les informations nécessaires pour faire une carte avec :</p>
<ol type="1">
<li>les domaines biologiques (<code>gg_cls_eco</code>),</li>
<li>le réseau hydrique d’importance au Québec (<code>gg_hq</code>),</li>
<li>les régions administratives (<code>gg_reg_qc</code>),</li>
<li>les points et noms de villes sélectionnées (<code>gg_villes</code> et les étiquettes avec <code>geom_text_repel()</code>).</li>
</ol>
<p>Notez encore une fois l’ordre des couches.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb35-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Faire le graphique de la carte </span></span>
<span id="cb35-2">gg_qc_db <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> gg_base <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb35-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajout de la classification écologique</span></span>
<span id="cb35-4">  gg_cls_eco <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb35-5">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajouter la GRHQ rognée</span></span>
<span id="cb35-6">  gg_hq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb35-7">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajout des régions admin, par-dessus pour voir les bordures</span></span>
<span id="cb35-8">  gg_reg_qc <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb35-9">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajouter le nom des villes </span></span>
<span id="cb35-10">  gg_villes <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb35-11">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajouter les étiquettes du nom des villes </span></span>
<span id="cb35-12">  ggrepel<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;">geom_text_repel</span>(</span>
<span id="cb35-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> villes_qc_lst_flt, </span>
<span id="cb35-14">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Définir les étiquettes et les coordonnées spatiales </span></span>
<span id="cb35-15">    <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;">label =</span> name, </span>
<span id="cb35-16">                  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">geometry =</span> geometry),</span>
<span id="cb35-17">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extraction des coordonnées spatiales pour dessiner les étiquettes</span></span>
<span id="cb35-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stat =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sf_coordinates"</span>, </span>
<span id="cb35-19">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Taille des étiquettes</span></span>
<span id="cb35-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb35-21">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajout de tampon blanc pour les noms de villes </span></span>
<span id="cb35-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bg.color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span>,</span>
<span id="cb35-23">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Étendue du tampon </span></span>
<span id="cb35-24">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bg.r =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span></span>
<span id="cb35-25">  )</span></code></pre></div></div>
</div>
<p>La carte s’affiche avec l’objet <code>gg_qc_db</code>. Nous pouvons ensuite modifier les couleurs de la carte avec <code>scale_fill_viridis_d()</code> et sa thématique avec <code>theme_void()</code> pour partir d’une carte sans thème puis modifier l’espacement des items de la légende avec <code>theme()</code> et l’argument <code>legend.key.spacing.y</code>. La légende (voir <code>guide_legend()</code> dans <code>scale_fill_viridis_d()</code>) peut aussi être placée en bas (<code>position = 'bottom'</code>) pour laisser plus de place à notre carte.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb36" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb36-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Carte avec thématique </span></span>
<span id="cb36-2">gg_qc_db <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb36-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Change le remplissage pour la palette viridis </span></span>
<span id="cb36-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_fill_viridis_d</span>(</span>
<span id="cb36-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">guide =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">guide_legend</span>(</span>
<span id="cb36-6">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Domaine biologique'</span>,</span>
<span id="cb36-7">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title.position =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"top"</span>,</span>
<span id="cb36-8">      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Légende en bas</span></span>
<span id="cb36-9">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">position =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bottom'</span>,</span>
<span id="cb36-10">      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Nombre de rangées pour les étiquettes de la légende </span></span>
<span id="cb36-11">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>,</span>
<span id="cb36-12">      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Orientation horizontale</span></span>
<span id="cb36-13">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">direction =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'horizontal'</span></span>
<span id="cb36-14">    )</span>
<span id="cb36-15">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb36-16">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Thème au minium </span></span>
<span id="cb36-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_void</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb36-18">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Changer l'espacement entre les étiquettes de la légende </span></span>
<span id="cb36-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend.key.spacing.y =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unit</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">units =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cm"</span>))</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/Guide_biodiv_qc_1_files/figure-html/afficher_carte_ggplot_complet-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="couper-pour-le-québec-méridional" class="level4">
<h4 class="anchored" data-anchor-id="couper-pour-le-québec-méridional">Couper pour le Québec méridional</h4>
<p>Le Québec est tellement beau et grand! Et justement, il est tellement grand qu’il serait judicieux de se concentrer sur la partie Sud, soit la plus peuplée. <!-- Après tout, nous nous intéressons aux endroits qui ont le plus d'observations. --></p>
<p>Pour ces couches spatiales, nous allons donc extraire la partie sud (méridionale) du Québec. Celle-ci correspond a 50.5 degrés de latitude (axe Y), selon l’Atlas des oiseaux nicheurs du Quebec <span class="citation" data-cites="robertDeuxiemeAtlasOiseaux2019">(2019)</span>.</p>
<p>Le CRS des domaines biologiques <code>st_crs(cls_eco)</code> est en <code>epsg:32198</code> ou <em>NAD83 / Quebec Lambert</em>. Il faut convertir 50.5 degrés en <code>epsg:32198</code>. Mais comment? Il y a des convertisseurs en ligne, mais nous pouvons le programmer!</p>
<p>Prenons les limites géographiques du Québec, ce qu’on appelle la boite limite ou <em>bounding box</em> (‘bbox’) peut s’extrait avec <code>st_bbox()</code>. Notre stratégie sera d’aller chercher la boite limite en coordonnées du <em>World Geodetic System 1984 (WGS84)</em> ou <code>epsg:4326</code> qui sont en degrés.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb37-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Trouver les limites du Québec en WSG84</span></span>
<span id="cb37-2">bbox_qc_wsg84 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> cls_eco_simp <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb37-3">  <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;">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;"># Ici on transforme de 32198 vers 4326</span></span>
<span id="cb37-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_bbox</span>()</span></code></pre></div></div>
</div>
<p>Comparez les limites en <em>epsg:4326</em> vs <em>epsg:32198</em>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb38" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb38-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Boite limite 'bounding box' en epsg:4326 (mètres)</span></span>
<span id="cb38-2">bbox_qc_wsg84</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>     xmin      ymin      xmax      ymax 
-79.76288  44.99136 -57.10750  62.58169 </code></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb40" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb40-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extraire la boite limite 'bounding box' en epsg:32198 (mètres)</span></span>
<span id="cb40-2">(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bbox_qc =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_bbox</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">obj =</span> cls_eco_simp))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>     xmin      ymin      xmax      ymax 
-830291.4  117964.2  783722.4 2090978.4 </code></pre>
</div>
</div>
<p>Ensuite nous trouvons le centre entre la limite de latitude minimum et maximum, puis nous faisons un point au centre et au nord de la limite que nous souhaitons mettre.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb42" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb42-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Trouver le centre entre xmin et xmax (ou l'étendue longitude du Québec en WSG84)</span></span>
<span id="cb42-2">centre <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(bbox_qc_wsg84[<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;">'xmin'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'xmax'</span>)])</span>
<span id="cb42-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(centre, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># environ -68.5</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] -68.4</code></pre>
</div>
</div>
<p>Puis, un point fictif est créé avec <code>st_point()</code> avec notre centre (longitude = -68.4, près du méridien central EPSG:32198) et la limite nord (latitude = 50.5). Ce point est transformé en <em>epsg:32198</em></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb44" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb44-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Faire un point fictif au Québec</span></span>
<span id="cb44-2">pts <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_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;">c</span>(centre, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">50.5</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb44-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Mettre le CRS </span></span>
<span id="cb44-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_sfc</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;">4326</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb44-5">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Transformer en epsg:32198</span></span>
<span id="cb44-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> projetCRS) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb44-7">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extraire les coordonnées seulement </span></span>
<span id="cb44-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_coordinates</span>()</span></code></pre></div></div>
</div>
<!-- # Avec terra (voir https://stackoverflow.com/questions/79737412/transformation-of-extent-in-data-is-not-recovered-when-transforming-back-to-the) -->
<!-- lulc.e <- ext(-830291.4, 783722.4, 117964.2, 2090650.1) -->
<!-- target_4326 <- vect(cbind(-69, 50.5), crs = "epsg:4326") -->
<!-- target_32198 <- project(target_4326, "epsg:32198") -->
<!-- new_ymax <- crds(target_32198)[2] -->
<!-- lulc_mer <- ext(lulc.e[1], lulc.e[2], lulc.e[3], new_ymax) -->
<!-- lulc_mer -->
<p>La valeur <code>Y</code> de ce point fictif (créé en <em>epsg:4326</em> vers <em>epsg:32198</em>) remplacera le <code>ymax</code> de l’objet <code>bbox_qc</code>. Cette nouvelle boite limite servira à rogner (<code>st_crop()</code>) la carte pour enlever tout ce qui se retrouve au-dessus du 50.5 latitude (ou <code>pts[2]</code> = 721304.84 mètres selon le <code>projetCRS</code>).</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb45" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb45-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Remplacer la valeur de la borne supérieure </span></span>
<span id="cb45-2">bbox_qc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> pts[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span></code></pre></div></div>
</div>
<p>Nous sommes prêts à faire notre carte pour le Québec méridional. Je rogne les couches <code>cls_eco</code> et <code>regqc</code> (sans simplification) pour avoir les données les plus propres possible pour la carte finale.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb46" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb46-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Péparation des domaines bioclimatiques pour le Québec méridional</span></span>
<span id="cb46-2">cls_eco_meridional <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> cls_eco <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb46-3">  <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> projetCRS) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb46-4">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># boite gabarit pour rogner</span></span>
<span id="cb46-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_crop</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> bbox_qc) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb46-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb46-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calcul de l'aire de chaque polygone des domaines bioclimatiques</span></span>
<span id="cb46-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">aire_cls_eco =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_area</span>(geom), </span>
<span id="cb46-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Proportion d'aire pour chaque polygone</span></span>
<span id="cb46-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Note : une polygone (NOM_DB == 'Toundra forestière') est </span></span>
<span id="cb46-11">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># très petit et peut être enlevé sans affecter la visualisation </span></span>
<span id="cb46-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">prop =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(aire_cls_eco<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;">sum</span>(aire_cls_eco), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)<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;">100</span></span>
<span id="cb46-13">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb46-14">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Enlever NOM_DB == 'Toundra forestière'</span></span>
<span id="cb46-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(NOM_DB <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;">"Toundra forestière"</span>)</span>
<span id="cb46-16"></span>
<span id="cb46-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Péparation/Rogner des régions administratives pour le Québec méridional</span></span>
<span id="cb46-18">regqc_meridional <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> regqc <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb46-19">  <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> projetCRS) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb46-20">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># boite gabarit pour rogner</span></span>
<span id="cb46-21">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_crop</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> bbox_qc)</span></code></pre></div></div>
</div>
<p>Puis on refait les couches pour mettre dans le graphique <code>ggplot2</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb47" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb47-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Domaines biologiques rognés</span></span>
<span id="cb47-2">gg_cls_eco_merid <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_sf</span>(</span>
<span id="cb47-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> cls_eco_meridional,  </span>
<span id="cb47-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;">fill =</span> NOM_DB), <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># couleur en fonction des domaines biologiques</span></span>
<span id="cb47-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> .<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>,                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Transparence à 90% </span></span>
<span id="cb47-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Pas de ligne, plus beau</span></span>
<span id="cb47-7">)</span>
<span id="cb47-8"></span>
<span id="cb47-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Régions agministratives rognées </span></span>
<span id="cb47-10">gg_regqc_merid <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_sf</span>(</span>
<span id="cb47-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> regqc_meridional,  </span>
<span id="cb47-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>,                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Pas de remplissage</span></span>
<span id="cb47-13">  <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;">'grey100'</span>,           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Couleur des lignes</span></span>
<span id="cb47-14">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fine ligne</span></span>
<span id="cb47-15">  </span>
<span id="cb47-16">)</span></code></pre></div></div>
</div>
<p>Finalement, on met tout ensemble pour obtenir notre carte du Québec méridional.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb48" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb48-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Établir le germe aléatoire</span></span>
<span id="cb48-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set.seed</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12345</span>)</span>
<span id="cb48-3"></span>
<span id="cb48-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Faire le graphique </span></span>
<span id="cb48-5">gg_qc_db <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> gg_base <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb48-6">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Domaines biologiques rognés</span></span>
<span id="cb48-7">  gg_cls_eco_merid <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb48-8">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajouter la GRHQ rognée</span></span>
<span id="cb48-9">  gg_hq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb48-10">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajout des régions admin, par-dessus pour voir les bordures</span></span>
<span id="cb48-11">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Régions agministratives rognées </span></span>
<span id="cb48-12">  gg_regqc_merid <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb48-13">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajouter le nom des villes </span></span>
<span id="cb48-14">  gg_villes <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb48-15">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajouter le texte du nom des villes </span></span>
<span id="cb48-16">  ggrepel<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;">geom_text_repel</span>(</span>
<span id="cb48-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> villes_qc_lst_flt, </span>
<span id="cb48-18">    <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;">label =</span> name, </span>
<span id="cb48-19">                  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">geometry =</span> geometry),</span>
<span id="cb48-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stat =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sf_coordinates"</span>, </span>
<span id="cb48-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb48-22">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajout de fond blanc pour les noms de villes </span></span>
<span id="cb48-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bg.color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span>,</span>
<span id="cb48-24">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bg.r =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span></span>
<span id="cb48-25">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>   </span>
<span id="cb48-26">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Change le remplissage pour la palette viridis </span></span>
<span id="cb48-27">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_fill_viridis_d</span>(</span>
<span id="cb48-28">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">guide =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">guide_legend</span>(</span>
<span id="cb48-29">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Domaine biologique'</span>,</span>
<span id="cb48-30">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title.position =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"top"</span>,</span>
<span id="cb48-31">      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Légende en bas</span></span>
<span id="cb48-32">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">position =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bottom'</span>,</span>
<span id="cb48-33">      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Nombre de rangées pour les étiquettes de la légende </span></span>
<span id="cb48-34">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb48-35">      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Orientation horizontale</span></span>
<span id="cb48-36">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">direction =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'horizontal'</span></span>
<span id="cb48-37">    )</span>
<span id="cb48-38">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb48-39">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Thème au minium </span></span>
<span id="cb48-40">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_void</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb48-41">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Changement d'autres paramètres du thème</span></span>
<span id="cb48-42">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme</span>(</span>
<span id="cb48-43">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Changer l'espacement entre les étiquettes de la légende </span></span>
<span id="cb48-44">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend.key.spacing.y =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unit</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">units =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cm"</span>), </span>
<span id="cb48-45">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Taille du texte</span></span>
<span id="cb48-46">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend.text =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>),</span>
<span id="cb48-47">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Taille du titre</span></span>
<span id="cb48-48">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend.title =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb48-49">  )</span></code></pre></div></div>
</div>
<p>Puis on admire notre résultat :</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb49" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb49-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Afficher la carte</span></span>
<span id="cb49-2">gg_qc_db</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/Guide_biodiv_qc_1_files/figure-html/gg_afficher_la_superbe_carte-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>Enfin! Une carte qui a de la gueule. Maintenant, exportons la carte avec <code>ggsave()</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb50" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb50-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Exportation en PNG</span></span>
<span id="cb50-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggsave</span>(</span>
<span id="cb50-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Changer l'extension '.png' pour '.pdf' ou '.svg' au besoin. </span></span>
<span id="cb50-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">filename =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"output/partie_1/carte_domEco_Qc.png"</span>, </span>
<span id="cb50-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plot =</span> gg_qc_db, </span>
<span id="cb50-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">width =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, </span>
<span id="cb50-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">height =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, </span>
<span id="cb50-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dpi =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span></span>
<span id="cb50-9">)</span></code></pre></div></div>
</div>
</section>
</section>
</section>
<section id="zones-critiques-de-biodiversité" class="level2">
<h2 class="anchored" data-anchor-id="zones-critiques-de-biodiversité">1.2 Zones critiques de biodiversité</h2>
<section id="carte-sites-dobservations-ebird" class="level3">
<h3 class="anchored" data-anchor-id="carte-sites-dobservations-ebird">Carte : sites d’observations eBird</h3>
<p>Notre carte de fond est pas mal, mais elle ne dit pas grand-chose côté biodiversité. Un des objectifs du dépliant est de présenter les zones critiques de biodiversité. Mais où seraient situées ces zones? Lorsque les ornithologues amateurs font des observations sur la plateforme eBird, ils enregistrent leurs observations dans des <a href="https://ebird.org/hotspots">points de sites publics</a> <span class="citation" data-cites="eBirdHotspotsGeospatial2025">(eBird Cornell Lab of Ornithology 2025)</span>. Ainsi, les observations enregistrées à ces sites pourraient servir de proxy d’endroits intéressants pour la biodiversité : s’il y a beaucoup d’espèces d’oiseaux, c’est qu’il doit y avoir beaucoup de nourriture pour soutenir cette diversité d’organismes et ainsi, augmenter nos chances de voir d’autres choses intéressantes.</p>
<p>Il est possible d’aller cherche ces points de sites publics eBird directement avec l’API de eBird. Le fichier <code>data/partie_1/biodiv/eBird_hotspots_CA_QC*.csv</code> a été obtenu en suivant les explications sous la section ‘<em>Is there a list of all eBird Hotspots?</em>’ au lien <a href="https://support.ebird.org/en/support/solutions/articles/48001009443-ebird-hotspot-faqs">eBird Hotspot FAQs</a>. Cela requiert une clé API de eBird (voir <code>VOTRECLEAPI</code> dans la commande plus bas). Le fichier <code>eBird regions and region codes_18Apr2023.xlsx</code> (<a href="https://support.ebird.org/helpdesk/attachments/48293281603">téléchargeable ici</a> ) contient les codes régionaux (comme <code>CA-QC</code>) et permet de choisir la bonne zone à télécharger directement. La commande ‘terminal’ (en utilisant le langage <code>bash</code> et non dans la console R) suivante permet (avec quelques modifications expliquées dans les liens ci-haut) d’obtenir le fichier <code>eBird_hotspots_CA_QC*.csv</code> à jour.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb51" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb51-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Prendre la date actuelle </span></span>
<span id="cb51-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">DATE_VAR</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">date</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-I</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb51-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Téléchargement du fichier des sites publics eBird avec la date de téléchargement</span></span>
<span id="cb51-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">curl</span>  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--header</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'X-eBirdApiToken: VOTRECLEAPI'</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\ </span></span>
<span id="cb51-5"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">--location</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-g</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'https://api.ebird.org/v2/ref/hotspot/CA-QC?fmt=csv'</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb51-6">eBird_hotspots_CA_QC_<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${DATE_VAR}</span>.csv</span></code></pre></div></div>
</div>
<p>Puis, ce ficher <code>.csv</code> est importé et le nom des colonnes ajouté.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb52" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb52-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Mettre les données des points chauds de eBird en mémoire</span></span>
<span id="cb52-2">pts_chauds_ebird <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/partie_1/biodiv/eBird_hotspots_CA_QC_2025-10-13.csv"</span></span>
<span id="cb52-3"></span>
<span id="cb52-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Mettre le fichier en mémoire </span></span>
<span id="cb52-5">ebird_hp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read.csv</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">file =</span> pts_chauds_ebird, </span>
<span id="cb52-6">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">header =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb52-7"></span>
<span id="cb52-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajouter un nom aux colonnes </span></span>
<span id="cb52-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>(ebird_hp) <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;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"locId"</span>, </span>
<span id="cb52-10">                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"countryCode"</span>, </span>
<span id="cb52-11">                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"subnational1Code"</span>, </span>
<span id="cb52-12">                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"subnational2Code"</span>, </span>
<span id="cb52-13">                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lat"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lng"</span>,        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Données spatiales!</span></span>
<span id="cb52-14">                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"locName"</span>,           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Nom des sites</span></span>
<span id="cb52-15">                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"latestObsDt"</span>,       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Date de la dernière observation</span></span>
<span id="cb52-16">                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"numSpeciesAllTime"</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Nombre d'espèces </span></span></code></pre></div></div>
</div>
<p>Ce fichier CSV contient de l’information spatiale (<code>lng</code>, <code>lat</code>). Les fonctions <code>st_as_sf</code> et <code>st_set_crs</code>, définissent les données spatiales (POINT) du CSV importé.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb53" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb53-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Préparer les données spatiales pour une cartographie </span></span>
<span id="cb53-2">ebird_hp_prep <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> ebird_hp <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span>  </span>
<span id="cb53-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Mettre tableau en format spatial </span></span>
<span id="cb53-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_as_sf</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">coords =</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;">'lng'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lat'</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb53-5">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Choisir le CRS </span></span>
<span id="cb53-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_set_crs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">value =</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>
<span id="cb53-7">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Formatter la colonne de date </span></span>
<span id="cb53-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb53-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date_obs_recent =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.POSIXct</span>(</span>
<span id="cb53-10">      latestObsDt,</span>
<span id="cb53-11">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">format=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%Y-%m-%d %H:%M"</span>,</span>
<span id="cb53-12">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">tz =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Sys.timezone</span>()</span>
<span id="cb53-13">    )</span>
<span id="cb53-14">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb53-15">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Projection du jeu de données selon le CRS du projet </span></span>
<span id="cb53-16">  <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> projetCRS) </span></code></pre></div></div>
</div>
<p>Pour la cartographie interactive, nous pourrions créer une étiquette en combinant le nom des sites de points eBird et le nombre d’espèces dans une nouvelle colonne nommée <code>labs</code>. <!-- '<br>' ajoute un retour de ligne  --></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb54" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb54-1">ebird_hp_sf <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> ebird_hp_prep <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb54-2">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Nouvelle colonne d'étiquette </span></span>
<span id="cb54-3">  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;">mutate</span>(</span>
<span id="cb54-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sprintf</span>(</span>
<span id="cb54-5">      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Joindre le nom d'un point eBird et le nombre d'espèces.</span></span>
<span id="cb54-6">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fmt =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s — %s sp."</span>, </span>
<span id="cb54-7">      locName, </span>
<span id="cb54-8">      numSpeciesAllTime)</span>
<span id="cb54-9">  )</span></code></pre></div></div>
</div>
<p>Une petite exploration des données montre qu’en filtrant les sites ayant beaucoup d’espèces (150 et +) et dont la dernière visite est après 2020, on obtient :</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb55" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb55-1">ebird_hp_sf <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb55-2">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Application du filtrer </span></span>
<span id="cb55-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(numSpeciesAllTime <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;">150</span>,           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Nombre d'espèces</span></span>
<span id="cb55-4">         date_obs_recent <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;">'2020-01-01'</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;"># Date </span></span>
<span id="cb55-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 677</code></pre>
</div>
</div>
<p>Le chiffre de 150 espèces pourrait aussi être choisi en fonction d’un certain quantile. Avec une probabilité de 0.85, on obtient : 146.</p>
<!-- Les quantiles donne une idée de la distribution des valeurs dans les données.  -->
<!-- ```{r oiseaux_quantiles} -->
<!-- (quant = summary(ebird_hp_sf$numSpeciesAllTime)) -->
<!-- ``` -->
<p>On peut voir que des sites n’ont pas été visités depuis longtemps avec la carte ci-dessous (notez que si vous téléchargez les données eBird longtemps dans le futur, les conclusions seront différentes)! Cela pourrait être intéressant d’aller visiter ces sites et d’ajouter des observations 🦅.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb57" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb57-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 20 sites avec vieilles dates de visites (pas de liste eBird depuis ce temps!)</span></span>
<span id="cb57-2">sites_perdus <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> ebird_hp_sf <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb57-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Étiquette avec l'année d'observation</span></span>
<span id="cb57-4">  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;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yr_last =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">substr</span>(latestObsDt, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), </span>
<span id="cb57-5">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sprintf</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fmt =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s — %s"</span>, yr_last, labs),</span>
<span id="cb57-6">                <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labs_yr_sp =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sprintf</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fmt =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s — %s"</span>, yr_last, numSpeciesAllTime)</span>
<span id="cb57-7">                ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb57-8">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Montre les 20 premiers avec les dates les plus petites</span></span>
<span id="cb57-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_min</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">order_by =</span> date_obs_recent, </span>
<span id="cb57-10">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>)</span></code></pre></div></div>
</div>
<p>Vous pouvez afficher la carte avec ce code :</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb58" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb58-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Faire une carte </span></span>
<span id="cb58-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mapview</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> sites_perdus, </span>
<span id="cb58-3">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">zcol =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yr_last"</span>, </span>
<span id="cb58-4">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">layer.name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Nb Esp.'</span>,</span>
<span id="cb58-5">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"labs"</span>)</span></code></pre></div></div>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/output/partie_1/carte_mv_sites_perdus.png" class="img-fluid figure-img"></p>
<figcaption>Carte des sites ayant des observations les plus vielles</figcaption>
</figure>
</div>
<p>Le code plus bas montre la carte avec tous les points. Cela fait beaucoup de points!</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb59" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb59-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Préparation des données simplifier (moins de colonnes)</span></span>
<span id="cb59-2">ebird_hp_sf_simple <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> ebird_hp_sf <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb59-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Sélection de colonnes pour l'affichage de détail dans la carte </span></span>
<span id="cb59-4">  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;">select</span>(locId, latestObsDt, numSpeciesAllTime, labs) </span></code></pre></div></div>
</div>
<p>Je vous laisse explorer avec ce code :</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb60" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb60-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Regarder les points chauds d'observations eBird </span></span>
<span id="cb60-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mapview</span>(</span>
<span id="cb60-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> ebird_hp_sf_simple, </span>
<span id="cb60-4">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajout de la couleur en fonction du nombre d'espèces vues</span></span>
<span id="cb60-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">zcol =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'numSpeciesAllTime'</span>,  </span>
<span id="cb60-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"labs"</span>,</span>
<span id="cb60-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">layer.name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Nb Esp.'</span>)</span></code></pre></div></div>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/output/partie_1/carte_mv_sites_tous.png" class="img-fluid figure-img"></p>
<figcaption>Carte des sites eBird</figcaption>
</figure>
</div>
<p>On peut aussi répondre à des questions de coin de table : où sont les sites avec plus de 250 espèces différentes? Promenez le curseur sur les points pour voir plus de détails sur les sites.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb61" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb61-1">ebird_hp_chaud <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> ebird_hp_sf <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb61-2">  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>(numSpeciesAllTime <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;">250</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb61-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Sélection de colonnes pour l'affichage de détail dans la carte </span></span>
<span id="cb61-4">  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;">select</span>(locId, latestObsDt, numSpeciesAllTime, labs)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb62" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb62-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Faire la carte </span></span>
<span id="cb62-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mapview</span>(</span>
<span id="cb62-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> ebird_hp_chaud, </span>
<span id="cb62-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">zcol =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"numSpeciesAllTime"</span>, </span>
<span id="cb62-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"labs"</span>,</span>
<span id="cb62-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labelOptions =</span> leaflet<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;">labelOptions</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">noHide =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb62-7">                                       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">opacity =</span> .<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">85</span>, </span>
<span id="cb62-8">                                       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">textOnly =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>),</span>
<span id="cb62-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">layer.name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Nb Esp.&lt;br&gt; filtre(&gt;=250)'</span>)</span></code></pre></div></div>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/output/partie_1/carte_mv_sites_hot.png" class="img-fluid figure-img"></p>
<figcaption>Carte des sites eBird</figcaption>
</figure>
</div>
<p>Avec ce dernier filtre, les points se situent près de parcs abondamment fréquentés par les citoyens, et près des habitations. Aussi, la totalité des points se retrouve près de cours d’eau, marais, réservoirs ou un milieu humide. Ce qui démontre une fois de plus l’importance des milieux humides pour la biodiversité.</p>
<p>Regardons maintenant où sont les sites avec plus de 150 observations, peu importe la dernière date de visite.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb63" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb63-1">ebird_hp_sf_chaud_bio <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> ebird_hp_sf <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb63-2">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Sélection de colonnes pour l'affichage de détail dans la carte </span></span>
<span id="cb63-3">  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;">select</span>(locId, latestObsDt, numSpeciesAllTime, labs) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb63-4">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Regarder seulement les sites qui ont plus de 150 espèces </span></span>
<span id="cb63-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(numSpeciesAllTime <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;">150</span>)</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb64" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb64-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mapview</span>(</span>
<span id="cb64-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> ebird_hp_sf_chaud_bio, </span>
<span id="cb64-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">zcol =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'numSpeciesAllTime'</span>, </span>
<span id="cb64-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"labs"</span>,</span>
<span id="cb64-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">layer.name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Nb Esp.&lt;br&gt; filtre(&gt;=150)'</span>)</span></code></pre></div></div>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/output/partie_1/carte_mv_sites_plus150.png" class="img-fluid figure-img"></p>
<figcaption>Carte des sites eBird plus de 150 espèces</figcaption>
</figure>
</div>
<p>Les sites avec le plus d’espèces sont plus au sud. Deux explications rapides :</p>
<ol type="1">
<li>il y a plus de personnes qui notent des observations au sud du Québec à différents moments dans l’année, ce qui augmente l’effort d’échantillonnage (et donc la probabilité de trouver des espèces plus rares).</li>
<li>la diversité des oiseaux change en fonction de la latitude. Donc, plus les points se retrouvent dans le nord, moins d’espèces devraient se retrouver. Nous pourrions regarder cela avec un modèle linéaire. Restons sur les objectifs de notre projet.</li>
</ol>
<p>Pour avancer à la prochaine étape, il pourrait être intéressant de garder les sites avec le plus d’observations pour une MRC (disons environ une vingtaine).</p>
</section>
<section id="zones-critiques-de-biodiversité-ebird-pour-une-seule-région" class="level3">
<h3 class="anchored" data-anchor-id="zones-critiques-de-biodiversité-ebird-pour-une-seule-région">Zones critiques de biodiversité eBird pour une seule région</h3>
<p>Nous avons un problème : aucun point eBird n’est associé avec les MRC des régions administratives. Par contre, il est possible de faire une jointure spatiale en utilisant les sites eBirds et les régions du Québec avec la fonction <code>st_join()</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb65" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb65-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Joindre les informations de MRC pour chaque point d'observation eBird</span></span>
<span id="cb65-2">eb_qc <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> ebird_hp_sf <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span>  </span>
<span id="cb65-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_join</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> regqc_t)</span></code></pre></div></div>
</div>
<p>Nous pouvons exporter ces données pour les mettre dans un logiciel GIS (comme QGIS), ou les intégrer à une base de données ce qui permettrait d’afficher chaque MRC. Ces données pourraient servir dans une application Shiny.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb66" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb66-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Exportation des données en géopackage </span></span>
<span id="cb66-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_write</span>(</span>
<span id="cb66-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">obj =</span> eb_qc, </span>
<span id="cb66-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dsn =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"output/partie_1/site_pub_ebird_MRC.gpkg"</span>, </span>
<span id="cb66-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">delete_dsn =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb66-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quiet =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb66-7">)</span></code></pre></div></div>
</div>
<p>Voici une image montrant les sites eBird avec les MRC dans QGIS en utilisant quelques règles de format d’étiquettes pour afficher les sites :</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/images/QGIS_exemple_sites_eBird.png" class="img-fluid quarto-figure quarto-figure-center figure-img" alt="Sites eBird avec MRC"></p>
</figure>
</div>
<p>Pour ce projet, nous allons extraire seulement les 20 sites ayant le plus d’espèces d’oiseaux.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb67" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb67-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Donne le top n des sites en fonction du nombre d'espèces vues</span></span>
<span id="cb67-2">eb_qc_topn <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> eb_qc <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span>  </span>
<span id="cb67-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Groupe par MRC pour faire le sommaire (filtration) </span></span>
<span id="cb67-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(MRS_NM_MRC) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb67-5">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extraire 20 points avec le plus d'espèces d'oiseaux par MRC </span></span>
<span id="cb67-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_max</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, </span>
<span id="cb67-7">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">order_by =</span> numSpeciesAllTime)</span></code></pre></div></div>
</div>
<p>Puis afficher le résultat pour tout le Québec sur notre carte interactive.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb68" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb68-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mapview</span>(regqc_t, </span>
<span id="cb68-2">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, </span>
<span id="cb68-3">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">zcol =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'MRS_NM_MRC'</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb68-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mapview</span>(eb_qc_topn,</span>
<span id="cb68-5">          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, </span>
<span id="cb68-6">          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cex =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'numSpeciesAllTime'</span>,</span>
<span id="cb68-7">          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">zcol =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'MRS_NM_MRC'</span>, </span>
<span id="cb68-8">          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'locName'</span>) </span></code></pre></div></div>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/output/partie_1/carte_mv_sites_reg.png" class="img-fluid figure-img"></p>
<figcaption>Carte des sites eBird et des régions du Québec</figcaption>
</figure>
</div>
<section id="ajout-des-sites-ebird-sur-la-carte-de-base" class="level4">
<h4 class="anchored" data-anchor-id="ajout-des-sites-ebird-sur-la-carte-de-base">Ajout des sites eBird sur la carte de base</h4>
<p>À titre d’exemple, nous allons afficher seulement les sites eBirds qui se retrouvent dans l’emprise de Montréal et Laval. En utilisant les données de régions administratives, on peut filtrer et faire une boite limite avec seulement les régions voulues.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb69" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb69-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extraire l'emprise spatiale autour de Montréal et Laval </span></span>
<span id="cb69-2">emprise_region_villes <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> regqc_t <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb69-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(MRS_NM_MRC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</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;">"Montréal"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Laval'</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb69-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_bbox</span>()</span></code></pre></div></div>
</div>
<p>Il faut ensuite rogner les cartes avec :</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb70" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb70-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Rogner l'information hydrologique pour cette région </span></span>
<span id="cb70-2">hq_lvl_mtl <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> hq_filt_qc <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_crop</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> emprise_region_villes)</span>
<span id="cb70-3">reg_mtl <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> regqc_t <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_crop</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> emprise_region_villes)</span>
<span id="cb70-4"></span>
<span id="cb70-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Prendre les 20 points les plus élevés en nombre d'espèces pour Montréal et Laval </span></span>
<span id="cb70-6">eb_qc_topn_lvl_mtl <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> eb_qc_topn <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb70-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(MRS_NM_MRC <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</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;">"Montréal"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Laval'</span>)) </span></code></pre></div></div>
</div>
<p>À noter que si on regarde de très près la région de Montréal et Laval, la classification des domaines écologiques est assez uniforme. Donc pas besoin de l’ajouter à notre carte.</p>
<p>Bonus : Pour se rendre à ces sites, on pourrait y aller en vélo? J’utiliserai donc les fichiers spatiaux du <a href="https://www.donneesquebec.ca/recherche/dataset/vmtl-pistes-cyclables">réseau cyclable de Montréal (DQC)</a> <span class="citation" data-cites="MTLReseauCyclableJeu2013">(Ville de Montréal 2013)</span> et les <a href="https://www.donneesquebec.ca/recherche/dataset/pistes-cyclables-et-pietonnieres">pistes cyclables et piétonnières de Laval (DQC)</a> <span class="citation" data-cites="villedelavalPistesCyclablesPietonnieres12017">(Ville de Laval 2017)</span>. Cela démontre aussi que même les GeoJSON peuvent être importés avec sf.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb71" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb71-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Chemin d'accès aux fichiers de réseaux cyclables</span></span>
<span id="cb71-2">res_cycl <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/partie_1/infrastructure/res_cyclable"</span></span>
<span id="cb71-3">lien_res_cycl_mtl <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(res_cycl, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'reseau_cyclable.geojson'</span>)</span>
<span id="cb71-4">lien_res_cycl_lvl <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(res_cycl, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pistes-cyclables-et-pietonnieres.geojson'</span>)</span>
<span id="cb71-5"></span>
<span id="cb71-6">res_cyclable_mtl <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_read</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dsn =</span> lien_res_cycl_mtl, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quiet =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb71-7">res_cyclable_lvl <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">st_read</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dsn =</span> lien_res_cycl_lvl, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quiet =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span></code></pre></div></div>
</div>
<p>Il ne reste plus qu’à faire notre carte!</p>
<p>Je commence par définir une carte de base sans le nom des sites.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb72" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb72-1">gg_carte_points_inret_ebird_base <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <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="cb72-2">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Polygones des MRCs </span></span>
<span id="cb72-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> reg_mtl) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb72-4">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Polygones d'eau</span></span>
<span id="cb72-5">  <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> hq_lvl_mtl, <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;">'lightblue'</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb72-6">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Lignes du Réseau cyclable</span></span>
<span id="cb72-7">  <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> res_cyclable_mtl, <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;">"#A1D998"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> .<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb72-8">  <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> res_cyclable_lvl, <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;">"#A1D998"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> .<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb72-9">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Top Points eBirds</span></span>
<span id="cb72-10">  <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> eb_qc_topn_lvl_mtl, </span>
<span id="cb72-11">          <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;">size =</span> numSpeciesAllTime, </span>
<span id="cb72-12">              <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">shape =</span> MRS_NM_MRC,</span>
<span id="cb72-13">              <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> numSpeciesAllTime)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> </span>
<span id="cb72-14">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Couleur des points</span></span>
<span id="cb72-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_colour_viridis_c</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb72-16">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Thème minimal </span></span>
<span id="cb72-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_void</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb72-18">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajout de titre aux légendes</span></span>
<span id="cb72-19">  <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;">"Nb espèces"</span>, </span>
<span id="cb72-20">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nb espèces"</span>,</span>
<span id="cb72-21">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">shape =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"MRC"</span>)</span></code></pre></div></div>
</div>
<p>On ajoute le nom des sites sur la carte de base.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb73" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb73-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Établir le germe aléatoire</span></span>
<span id="cb73-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set.seed</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">123456</span>)</span>
<span id="cb73-3">gg_carte_points_inret_ebird <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> gg_carte_points_inret_ebird_base <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb73-4">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Texte nom des sites </span></span>
<span id="cb73-5">  ggrepel<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;">geom_text_repel</span>(</span>
<span id="cb73-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> eb_qc_topn_lvl_mtl, </span>
<span id="cb73-7">    <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;">label =</span> labs, </span>
<span id="cb73-8">                  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">geometry =</span> geometry),</span>
<span id="cb73-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stat =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sf_coordinates"</span>, </span>
<span id="cb73-10">    <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;">2.25</span>,</span>
<span id="cb73-11">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajout de fond blanc pour les noms de villes </span></span>
<span id="cb73-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bg.color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span>,</span>
<span id="cb73-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bg.r =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span>) </span></code></pre></div></div>
</div>
<p>Puis, on l’affiche.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb74" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb74-1">gg_carte_points_inret_ebird</span></code></pre></div></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/Guide_biodiv_qc_1_files/figure-html/gg_carte_affiche_sites_ebirds_et_villes-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>La carte est un peu chargée avec tous les longs noms des sites. Je propose donc de faire un petit ménage dans les noms longs en enlevant les parties qui sont inutiles de représenter. La fonction <code>gsub()</code> permet de faire une sorte de ‘recherche et remplacer’ comme dans un éditeur de texte. Je détermine en premier des patrons à retirer (voir l’objet <code>patt_v</code>) puis les combines ensemble avec le caractère <code>|</code> pour trouver tout en même temps (voir l’objet <code>patt</code>).</p>
<p>Aussi, je veux un ID unique pour chaque site. Dans le jeu de données, chaque site a un numéro de rangée (<code>row_number()</code>). J’utilise ce numéro comme identifiant.</p>
<p>Finalement, je vais faire une nouvelle étiquette en utilisant <code>sprintf()</code> avec les numéros de lignes et notre nouvelle colonne d’étiquettes corrigées.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb75" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb75-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Texte à rechercher et remplacer </span></span>
<span id="cb75-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pour limiter la taille des étiquettes à afficher</span></span>
<span id="cb75-3">patt_v <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb75-4">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", Laval"</span>, </span>
<span id="cb75-5">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" </span><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;">(accès restreint</span><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;">)"</span>, </span>
<span id="cb75-6">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" </span><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;">(aucun accès en voiture</span><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;">)"</span>, </span>
<span id="cb75-7">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" </span><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;">(LISTES HISTORIQUES SEULEMENT; SVP utiliser un site plus précis pour les listes actuelles</span><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;">)"</span>)</span>
<span id="cb75-8"></span>
<span id="cb75-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Faire un patron de recherche pour tout enlever d'un seul coup</span></span>
<span id="cb75-10">patt <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(</span>
<span id="cb75-11">  patt_v, </span>
<span id="cb75-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|"</span></span>
<span id="cb75-13">)</span>
<span id="cb75-14"></span>
<span id="cb75-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># À partir de notre jeu de données</span></span>
<span id="cb75-16">eb_qc_topn_lvl_mtl_id <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> eb_qc_topn_lvl_mtl <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb75-17">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Enlève les groupes présents</span></span>
<span id="cb75-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ungroup</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb75-19">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajout des colonnes</span></span>
<span id="cb75-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb75-21">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Chaque site avec nom corrigé</span></span>
<span id="cb75-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">site_corr =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">gsub</span>(   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># gsub permet de chercher et remplacer</span></span>
<span id="cb75-23">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pattern =</span> patt,   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Patron de recherche</span></span>
<span id="cb75-24">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">replacement =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span>, <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Remplacer par rien </span></span>
<span id="cb75-25">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> locName       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># De la colonne des noms de sites</span></span>
<span id="cb75-26">    ),</span>
<span id="cb75-27">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajoute un numéro unique (ici le numéro de ligne est suffisant)</span></span>
<span id="cb75-28">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rnb =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.factor</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">row_number</span>()), <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Mettre en facteur met en ordre les chiffres</span></span>
<span id="cb75-29">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Création de nouvelles étiquettes </span></span>
<span id="cb75-30">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">site_labs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sprintf</span>(</span>
<span id="cb75-31">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fmt =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%s: %s"</span>, </span>
<span id="cb75-32">      rnb, site_corr</span>
<span id="cb75-33">    ))</span></code></pre></div></div>
</div>
<p>Notre jeu de données est maintenant prêt à faire la carte.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb76" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb76-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Noter le nombre de lignes dans le jeu de données </span></span>
<span id="cb76-2">nrep <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(eb_qc_topn_lvl_mtl_id)</span>
<span id="cb76-3"></span>
<span id="cb76-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># En reprenant la carte de base, on ajoute les étiquettes et une légende </span></span>
<span id="cb76-5">gg_carte_points_inret_ebird <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> gg_carte_points_inret_ebird_base <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Carte de base</span></span>
<span id="cb76-6">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Texte nom de villes </span></span>
<span id="cb76-7">  ggrepel<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;">geom_label_repel</span>(</span>
<span id="cb76-8">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Nouveau jeu de données </span></span>
<span id="cb76-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> eb_qc_topn_lvl_mtl_id, </span>
<span id="cb76-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajouter les étiquettes</span></span>
<span id="cb76-11">    <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>
<span id="cb76-12">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> rnb,             <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Étiquette sur la carte : seulement des chiffres </span></span>
<span id="cb76-13">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">geometry =</span> geometry,     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Où vont les étiquettes</span></span>
<span id="cb76-14">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">factor</span>(site_labs) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># La légende sera les étiquettes complètes</span></span>
<span id="cb76-15">    ), </span>
<span id="cb76-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stat =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sf_coordinates"</span>, </span>
<span id="cb76-17">    <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;">2.25</span>                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Taille des étiquettes sur la carte </span></span>
<span id="cb76-18">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb76-19">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Légende pour le nom des sites </span></span>
<span id="cb76-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_fill_manual</span>(</span>
<span id="cb76-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Site Name'</span>,       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Nom de la légende </span></span>
<span id="cb76-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(             <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Couleur des étiquettes </span></span>
<span id="cb76-23">      scales<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;">alpha</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span>, </span>
<span id="cb76-24">                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> .<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>), </span>
<span id="cb76-25">      nrep), </span>
<span id="cb76-26">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> eb_qc_topn_lvl_mtl_id<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>site_labs <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Nom des étiquettes en ordre </span></span>
<span id="cb76-27">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb76-28">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Changement de l'apparence de la légende pour les étiquettes des sites </span></span>
<span id="cb76-29">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">guides</span>(</span>
<span id="cb76-30">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Redéfinir comment la légende de remplissage affiche </span></span>
<span id="cb76-31">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">guide_legend</span>(</span>
<span id="cb76-32">      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Mettre la légende de remplissage en bas </span></span>
<span id="cb76-33">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">position =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bottom"</span>,</span>
<span id="cb76-34">      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Changer des paramètres de thématique seulement pour la partie de remplissage</span></span>
<span id="cb76-35">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">theme =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme</span>(</span>
<span id="cb76-36">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Change la taille du texte des étiquettes dans la légende</span></span>
<span id="cb76-37">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend.text =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>),</span>
<span id="cb76-38">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Change la distance horizontale entre les étiquettes de la légende</span></span>
<span id="cb76-39">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend.key.width  =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unit</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cm"</span>),</span>
<span id="cb76-40">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Change la distance verticale entre les étiquettes de la légende</span></span>
<span id="cb76-41">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend.key.height =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unit</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cm"</span>),</span>
<span id="cb76-42">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Position du titre </span></span>
<span id="cb76-43">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend.title.position =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"top"</span>,</span>
<span id="cb76-44">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Justification à gauche ==0 (droite ==1, centre == 0.5)</span></span>
<span id="cb76-45">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend.title =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), </span>
<span id="cb76-46">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ajouter une marge pour éviter de couper le texte </span></span>
<span id="cb76-47">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend.margin =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">margin</span>(</span>
<span id="cb76-48">          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">t =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb76-49">          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">r =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>,</span>
<span id="cb76-50">          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">b =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb76-51">          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">l =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, </span>
<span id="cb76-52">          <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">unit =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'cm'</span>)</span>
<span id="cb76-53">      ),</span>
<span id="cb76-54">      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Changer la taille des étiquettes </span></span>
<span id="cb76-55">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">override.aes =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb76-56">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Change la taille des 'Clés' de la légende</span></span>
<span id="cb76-57">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> scales<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;">alpha</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;">alpha =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Change la couleur des 'Clés'</span></span>
<span id="cb76-58">      )</span>
<span id="cb76-59">    )</span>
<span id="cb76-60">  )</span></code></pre></div></div>
</div>
<p>On affiche le produit.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb77" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb77-1">gg_carte_points_inret_ebird</span></code></pre></div></div>
</div>
<div class="cell">
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/Guide_biodiv_qc_1_files/figure-html/gg_carte_affiche_sites_ebirds_finale_WEB-1.png" class="img-fluid figure-img" width="960"></p>
</figure>
</div>
</div>
</div>
<p>Puis on exporte l’image.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb78" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb78-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Exportation en PNG</span></span>
<span id="cb78-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggsave</span>(</span>
<span id="cb78-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Changer l'extension '.png' pour '.pdf' ou '.svg' au besoin. </span></span>
<span id="cb78-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">filename =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"output/partie_1/carte_pt_ebird_Qc.png"</span>, </span>
<span id="cb78-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plot =</span> gg_carte_points_inret_ebird, </span>
<span id="cb78-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">width =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, </span>
<span id="cb78-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">height =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, </span>
<span id="cb78-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dpi =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span></span>
<span id="cb78-9">)</span></code></pre></div></div>
</div>
<p>Et pour finir une carte interactive!</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb79" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb79-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># On ajoute une étiquette avec le nombre d'espèces</span></span>
<span id="cb79-2">zhpb <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> eb_qc_topn_lvl_mtl_id <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> </span>
<span id="cb79-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb79-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labs2 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sprintf</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'%s; sp : %s'</span>, </span>
<span id="cb79-5">                    site_corr, </span>
<span id="cb79-6">                    numSpeciesAllTime)</span>
<span id="cb79-7">  )</span></code></pre></div></div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb80" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb80-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># carte interactive pour le plaisir</span></span>
<span id="cb80-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mapview</span>(</span>
<span id="cb80-3">  zhpb, </span>
<span id="cb80-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">zcol =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'numSpeciesAllTime'</span>, </span>
<span id="cb80-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">layer.name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NB espèces"</span>, </span>
<span id="cb80-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"labs2"</span></span>
<span id="cb80-7">)</span></code></pre></div></div>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/output/partie_1/carte_zhpb.png" class="img-fluid figure-img"></p>
<figcaption>Carte zone de haut potentiel de biodiversité eBird</figcaption>
</figure>
</div>
<p>Voilà!</p>
</section>
</section>
</section>
<section id="prochaines-étapes" class="level2">
<h2 class="anchored" data-anchor-id="prochaines-étapes">Prochaines étapes</h2>
<p>Cette première partie avait pour but de faire un grand tour dans les fonctions utiles pour faire des analyses spatiales. Ainsi, il est possible d’importer et de manipuler les couches spatiales dans R et de préparer des couches pour en faire des cartes. Vous pouvez toujours exporter les couches et continuer dans votre logiciel GIS préféré ensuite</p>
<p>Avec ces nouvelles connaissances, il sera plus facile de manipuler les données de biodiversité provenant de GBIF.</p>
<section id="références" class="level3">
<h3 class="anchored" data-anchor-id="références">Références</h3>
<div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-R-mapview" class="csl-entry">
Appelhans, Tim, Florian Detsch, Christoph Reudenbach, et Stefan Woellauer. 2023. <em><span>mapview</span>: Interactive Viewing of Spatial Data in R</em>. <a href="https://github.com/r-spatial/mapview">https://github.com/r-spatial/mapview</a>.
</div>
<div id="ref-R-rinat" class="csl-entry">
Barve, Vijay, et Edmund Hart. 2025. <em><span>rinat</span>: Access iNaturalist Data Through APIs</em>. <a href="https://docs.ropensci.org/rinat/">https://docs.ropensci.org/rinat/</a>.
</div>
<div id="ref-R-rgbif" class="csl-entry">
Chamberlain, Scott, Damiano Oldoni, et John Waller. 2025. <em><span>rgbif</span>: Interface to the Global Biodiversity Information Facility API</em>. <a href="https://github.com/ropensci/rgbif">https://github.com/ropensci/rgbif</a>.
</div>
<div id="ref-eBirdHotspotsGeospatial2025" class="csl-entry">
eBird Cornell Lab of Ornithology. 2025. <span>«&nbsp;<span>eBird</span>: <span>Hotspots</span> with Geospatial Coordinates (from <span>API</span>)&nbsp;»</span>. <a href="https://support.ebird.org/en/support/solutions/articles/48001009443-ebird-hotspot-faqs">https://support.ebird.org/en/support/solutions/articles/48001009443-ebird-hotspot-faqs</a>.
</div>
<div id="ref-GouvCanRessNatCan2025" class="csl-entry">
Gouvernement du Canada. 2025. <span>«&nbsp;Base de Donn<span>é</span>es Toponymiques Du <span>Canada</span> (<span>BDTC</span>) [<span>Jeu</span> de Donn<span>é</span>es]&nbsp;»</span>. <a href="https://ressources-naturelles.canada.ca/carte-outils-publications/outils-logiciels/base-donnees-toponymiques-canada">https://ressources-naturelles.canada.ca/carte-outils-publications/outils-logiciels/base-donnees-toponymiques-canada</a>.
</div>
<div id="ref-MRNFClassEcoTerritoire2016" class="csl-entry">
Ministère des Ressources Naturelles et des Forêts. 2016. <span>«&nbsp;Classification <span>É</span>cologique Du Territoire Qu<span>é</span>b<span>é</span>cois, [<span>Jeu</span> de Donn<span>é</span>es], Dans <span>Donn<span>é</span>es Qu<span>é</span>bec</span>&nbsp;»</span>. <a href="https://www.donneesquebec.ca/recherche/fr/dataset/systeme-hierarchique-de-classification-ecologique-du-territoire">https://www.donneesquebec.ca/recherche/fr/dataset/systeme-hierarchique-de-classification-ecologique-du-territoire</a>.
</div>
<div id="ref-MRNFDecAdmin2018" class="csl-entry">
———. 2018. <span>«&nbsp;D<span>é</span>coupages Administratifs, [<span>Jeu</span> de Donn<span>é</span>es], Dans <span>Donn<span>é</span>es Qu<span>é</span>bec</span>&nbsp;»</span>. <a href="https://www.donneesquebec.ca/recherche/dataset/decoupages-administratifs">https://www.donneesquebec.ca/recherche/dataset/decoupages-administratifs</a>.
</div>
<div id="ref-MRNFGeobaseResHydro2019" class="csl-entry">
———. 2019. <span>«&nbsp;G<span>é</span>obase Du R<span>é</span>seau Hydrographique Du <span>Qu<span>é</span>bec</span> (<span>GRHQ</span>), [<span>Jeu</span> de Donn<span>é</span>es], Dans <span>Donn<span>é</span>es Qu<span>é</span>bec</span>&nbsp;»</span>. <a href="https://www.donneesquebec.ca/recherche/dataset/grhq">https://www.donneesquebec.ca/recherche/dataset/grhq</a>.
</div>
<div id="ref-myhrvoldAmnioteLifehistoryDatabase2015" class="csl-entry">
Myhrvold, Nathan P., Elita Baldridge, Benjamin Chan, Dhileep Sivam, Daniel L. Freeman, et S. K. Morgan Ernest. 2015. <span>«&nbsp;An Amniote Life-History Database to Perform Comparative Analyses with Birds, Mammals, and Reptiles: <span>Ecological Archives E096</span>-269&nbsp;»</span>. <em>Ecology</em> 96 (11): 3109‑9. <a href="https://doi.org/10.1890/15-0846R.1">https://doi.org/10.1890/15-0846R.1</a>.
</div>
<div id="ref-ouranosPlaces2024" class="csl-entry">
Ouranos. 2024. <span>«&nbsp;Places [<span>Jeu</span> de Donn<span>é</span>es]&nbsp;»</span>. <a href="https://portraits.ouranos.ca/fr/">https://portraits.ouranos.ca/fr/</a>.
</div>
<div id="ref-sf2018" class="csl-entry">
Pebesma, Edzer. 2018. <span>«&nbsp;<span>Simple Features for R: Standardized Support for Spatial Vector Data</span>&nbsp;»</span>. <em><span>The R Journal</span></em> 10 (1): 439‑46. <a href="https://doi.org/10.32614/RJ-2018-009">https://doi.org/10.32614/RJ-2018-009</a>.
</div>
<div id="ref-R-sf" class="csl-entry">
———. 2025. <em><span>sf</span>: Simple Features for R</em>. <a href="https://r-spatial.github.io/sf/">https://r-spatial.github.io/sf/</a>.
</div>
<div id="ref-sf2023" class="csl-entry">
Pebesma, Edzer, et Roger Bivand. 2023. <em><span>Spatial Data Science: With applications in R</span></em>. <span>Chapman and Hall/CRC</span>. <a href="https://doi.org/10.1201/9780429459016">https://doi.org/10.1201/9780429459016</a>.
</div>
<div id="ref-R-base" class="csl-entry">
R Core Team. 2024. <em><span>R</span>: A Language and Environment for Statistical Computing</em>. Vienna, Austria: R Foundation for Statistical Computing. <a href="https://www.R-project.org/">https://www.R-project.org/</a>.
</div>
<div id="ref-robertDeuxiemeAtlasOiseaux2019" class="csl-entry">
Robert, Michel, Marie-Hélène Hachey, Denis Lepage, et Andrew R. Couturier. 2019. <em>Deuxi<span>è</span>me Atlas Des Oiseaux Nicheurs Du <span>Qu<span>é</span>bec</span> M<span>é</span>ridional</em>. Montr<span>é</span>al: Regroupement Qu<span>é</span>becOiseaux.
</div>
<div id="ref-statistiquecanadaRecensement2021Fichier2025" class="csl-entry">
Statistique Canada. 2025. <span>«&nbsp;Recensement de 2021, <span>Fichier</span> Num<span>é</span>rique Des Limites (<span>FNL</span>; Lpr_000a21f_f)&nbsp;»</span>. <a href="https://www12.statcan.gc.ca/census-recensement/2021/geo/sip-pis/boundary-limites/index2021-fra.cfm?year=21">https://www12.statcan.gc.ca/census-recensement/2021/geo/sip-pis/boundary-limites/index2021-fra.cfm?year=21</a>.
</div>
<div id="ref-tobiasAVONETMorphologicalEcological2022" class="csl-entry">
Tobias, Joseph A., Catherine Sheard, Alex L. Pigot, Adam J. M. Devenish, Jingyi Yang, Ferran Sayol, Montague H. C. Neate-Clegg, et al. 2022. <span>«&nbsp;<span>AVONET</span>: Morphological, Ecological and Geographical Data for All Birds&nbsp;»</span>. Édité par Tim Coulson. <em>Ecology Letters</em> 25 (3): 581‑97. <a href="https://doi.org/10.1111/ele.13898">https://doi.org/10.1111/ele.13898</a>.
</div>
<div id="ref-villedelavalPistesCyclablesPietonnieres12017" class="csl-entry">
Ville de Laval. 2017. <span>«&nbsp;Pistes Cyclables et Pi<span>é</span>tonni<span>è</span>res, [<span>Jeu</span> de Donn<span>é</span>es], Dans <span>Donn<span>é</span>es Qu<span>é</span>bec</span>&nbsp;»</span>. <a href="https://www.donneesquebec.ca/recherche/dataset/pistes-cyclables-et-pietonnieres">https://www.donneesquebec.ca/recherche/dataset/pistes-cyclables-et-pietonnieres</a>.
</div>
<div id="ref-MTLReseauCyclableJeu2013" class="csl-entry">
Ville de Montréal. 2013. <span>«&nbsp;R<span>é</span>seau Cyclable, [<span>Jeu</span> de Donn<span>é</span>es], Dans <span>Donn<span>é</span>es Qu<span>é</span>bec</span>&nbsp;»</span>. <a href="https://www.donneesquebec.ca/recherche/dataset/vmtl-pistes-cyclables">https://www.donneesquebec.ca/recherche/dataset/vmtl-pistes-cyclables</a>.
</div>
<div id="ref-ggplot22016" class="csl-entry">
Wickham, Hadley. 2016. <em><span>ggplot2</span>: Elegant Graphics for Data Analysis</em>. Springer-Verlag New York. <a href="https://ggplot2-book.org">https://ggplot2-book.org</a>.
</div>
<div id="ref-R-ggplot2" class="csl-entry">
Wickham, Hadley, Winston Chang, Lionel Henry, Thomas Lin Pedersen, Kohske Takahashi, Claus Wilke, Kara Woo, Hiroaki Yutani, Dewey Dunnington, et Teun van den Brand. 2024. <em><span>ggplot2</span>: Create Elegant Data Visualisations Using the Grammar of Graphics</em>. <a href="https://ggplot2.tidyverse.org">https://ggplot2.tidyverse.org</a>.
</div>
<div id="ref-R-dplyr" class="csl-entry">
Wickham, Hadley, Romain François, Lionel Henry, Kirill Müller, et Davis Vaughan. 2023. <em><span>dplyr</span>: A Grammar of Data Manipulation</em>. <a href="https://dplyr.tidyverse.org">https://dplyr.tidyverse.org</a>.
</div>
</div>


</section>
</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Notes de bas de page</h2>

<ol>
<li id="fn1"><p>Un progiciel est un ensemble de fonctions qui servent à accomplir des tâches. Dans R, on les mets en mémoire en éxécutant <code>library(base)</code> dans la console. Un progiciel s’installe avec la commande <code>install.packages("dplyr")</code>.↩︎</p></li>
</ol>
</section><section class="quarto-appendix-contents" id="quarto-citation"><h2 class="anchored quarto-appendix-heading">Citation</h2><div><div class="quarto-appendix-secondary-label">BibTeX</div><pre class="sourceCode code-with-copy quarto-appendix-bibtex"><code class="sourceCode bibtex">@article{beausoleil2026,
  author = {Beausoleil, Marc-Olivier},
  title = {Guide d’identification de biodiversité du Québec - Partie 1 :
    les cartes},
  journal = {Évologie},
  date = {2026-01-19},
  url = {https://evologie.netlify.app},
  doi = {10.59350/qsh3j-3tk49},
  langid = {fr}
}
</code></pre><div class="quarto-appendix-secondary-label">Citation : </div><div id="ref-beausoleil2026" class="csl-entry quarto-appendix-citeas">
Beausoleil, Marc-Olivier. 2026. <span>“Guide d’identification de
biodiversité du Québec - Partie 1 : les cartes.”</span>
<em>Évologie</em>, January. <a href="https://doi.org/10.59350/qsh3j-3tk49">https://doi.org/10.59350/qsh3j-3tk49</a>.
</div></div></section></div> ]]></description>
  <category>biodiversité</category>
  <category>analyse</category>
  <category>cartes</category>
  <category>tutoriel</category>
  <guid>https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/Guide_biodiv_qc_1.html</guid>
  <pubDate>Mon, 19 Jan 2026 05:00:01 GMT</pubDate>
  <media:content url="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/images/achigans_DSCN1277_2016_08_06.jpeg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Guide d’identification de biodiversité du Québec - Prélude</title>
  <dc:creator>Marc-Olivier Beausoleil</dc:creator>
  <link>https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/Guide_biodiv_qc_0.html</link>
  <description><![CDATA[ 





<!-- IMPORTANT -->
<!-- NOTE ../../posts/ref_blg.bib should be ../ref_blg.bib in final product-->
<!-- NOTE ../../posts/evolution.csl should be ../evolution.csl in final product-->
<section id="six-milliards-de-solitudes-ça-fait-beaucoup" class="level2">
<h2 class="anchored" data-anchor-id="six-milliards-de-solitudes-ça-fait-beaucoup">Six milliards de solitudes, ça fait beaucoup</h2>
<p>Les chiffres en lien avec la biodiversité (appelé aussi «&nbsp;biodiv&nbsp;» pour les intimes) sont stupéfiants. Par exemple, les estimations du nombre d’espèces varient selon la source : allant de quelques millions—la référence <a href="https://www.checklistbank.org" target="_blank">ChecklistBank</a>, catalogue plus de 2.2&nbsp;millions d’organismes sur la terre—à plusieurs milliards! Un article propose même un potentiel de six milliards d’espèces (🤯), en excluant les virus <span class="citation" data-cites="larsenInordinateFondnessMultiplied2017">(Larsen et al. 2017)</span>.</p>
<p>Selon cette dernière source, le nombre d’espèces <em>formellement décrites</em> serait actuellement environ 1.5&nbsp;million. Le ratio de ce nombre d’espèces par rapport au nombre hypothétique total d’espèces (entre un à six milliards) est d’entre 0.15 % et 0.03 % respectivement. Ainsi, selon ces estimations, nous ne connaîtrions que moins de 0.2% de tous les organismes avec qui nous partageons notre unique planète habitable. Imaginez l’ampleur de la tâche. Les scientifiques ont besoin de tout le monde pour au minimum observer où se retrouvent toutes les espèces. Et la science citoyenne est un moyen pour aider les scientifiques à en apprendre sur notre monde biologique.</p>
<!-- Toute cette vie qui a survécu de manière ininterrompue depuis au moins 3.5 milliards d'années. -->
<!-- Et l'ensemble des populations capables de former une descendance viable forment une espèce biologique. -->
<p>On parle bien d’espèces ici : rappelons que la biodiversité comprend aussi tous les individus au sein de ces populations ainsi que leur habitat. Mais c’est quoi la biodiversité?</p>
<!-- LIER QUESTION?? -->
<!-- LIER QUESTION?? -->
<!-- LIER QUESTION?? -->
<!-- Pour répondre à notre question, commençons par définir la biodiversité. -->
<!-- LIER QUESTION?? -->
<!-- LIER QUESTION?? -->
<!-- LIER QUESTION?? -->
<p>La <a href="https://www.cbd.int/convention/articles?a=cbd-02" target="_blank">Convention sur la diversité biologique (CDB)</a> définit la biodiversité comme suit :</p>
<blockquote class="blockquote">
<p>Variabilité des organismes vivants de toute origine y compris, entre autres, les écosystèmes terrestres, marins et autres écosystèmes aquatiques et les complexes écologiques dont ils font partie; cela comprend la diversité au sein des espèces et entre espèces ainsi que celle des écosystèmes.</p>
</blockquote>
<p>Cette diversité s’interprète par la lentille de l’évolution. En particulier, le processus de la sélection naturelle explique comment la variabilité des organismes dans les populations est intimement liée avec l’environnement : ce sont les conditions de l’environnement qui favorisent ou défavorisent certains individus (et leur génétique) à un moment donné. Mais ce ne sont pas seulement les populations qui changent puisque les individus modifient leur environnement à leur tour pour faciliter leur transmission génétique. Quand les oiseaux fabriquent un nid, ou que les castors construisent un barrage ou qu’une plante produit des fleurs invitant les bibittes à polliniser d’autres fleurs, l’objectif reste toujours de donner la meilleure chance aux gènes d’être transmis.</p>
</section>
<section id="voyager-avec-son-bagage-génétique" class="level2">
<h2 class="anchored" data-anchor-id="voyager-avec-son-bagage-génétique">Voyager avec son bagage génétique</h2>
<p>Dans le voyage de la vie, chaque individu transporte un bagage unique : ses gènes (Figure&nbsp;1). Nous sommes, en quelque sorte, le véhicule pour ce bagage génétique <span class="citation" data-cites="Dawkins:2016vi">(Dawkins 2016)</span>! Ensemble, nous ne traversons pas seulement le territoire, mais prenons aussi part à une odyssée à travers les générations. Les différences entre nos bagages ne sont pas anodines : car sans variation, l’évolution n’est pas possible.</p>
<div style="float: right; width: 30%; margin-top: .6em; margin-left: 1em; margin-bottom: 1em;">
<div id="fig-hirbico" class="quarto-float quarto-figure quarto-figure-center anchored" alt="Hirondelle bicolore Cap Tourmente 2024">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-hirbico-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/images/hirondelle_bicolore_cap_tourmente_2024.JPG" class="img-fluid figure-img" alt="Hirondelle bicolore Cap Tourmente 2024" width="270">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-hirbico-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: Cette hirondelle bicolore <a href="https://inaturalist.ca/taxa/11935-Tachycineta-bicolor">(<em>Tachycineta bicolor</em>)</a> entreprend un voyage migratoire, mais fait aussi voyager ses gènes dans la prochaine génération en se reproduisant. MOB CC BY 4.0
</figcaption>
</figure>
</div>
</div>
<p>Imaginez un ensemble d’organismes tous strictement identiques. Dans ce monde étrange, aucune mutation n’est possible, ce qui empêche l’émergence de différences génétiques. Le code génétique est absolument pareil d’un individu à l’autre. Dans ce cas, contrairement à ce que nous observons actuellement, la sélection naturelle qui mènerait à l’émergence de nouvelles espèces ne peut pas fonctionner : aucun choix n’est possible entre organismes puisque tous les codes génétiques sont des clones<sup>1</sup> ! Le pire serait qu’il n’y aurait même pas de potentiel d’évolution suite à de grands changements environnementaux. Cela voudrait dire qu’en temps de changements climatiques, les populations qui ne seraient même pas capables de s’adapter aux nouvelles conditions verront leur chance de persister diminuer.</p>
<p>Heureusement, notre monde est plein de variations, les populations hébergent une diversité génétique. Autrement dit, l’évolution s’observe au niveau des populations puisqu’elles sont diversifiées. Les biologistes qui étudient l’évolution tentent d’expliquer les changements de la composition des populations à la lumière des mécanismes évolutifs. Ils se posent ce genre de questions : pourquoi certaines populations changent-elles tellement qu’elles deviennent de nouvelles espèces? Pourquoi d’autres s’éteignent-elles? Pourquoi des populations ont-elles plus de succès que d’autres? Pourquoi certaines populations préfèrent-elles plus tel environnement à un autre?</p>
<!-- ##################################################################################### -->
<!-- Imaginez-vous à l'épicerie un samedi matin : vous êtes parmi tous ces gens qui font leurs commissions en même temps au même endroit. Vous êtes tous des êtres uniques autant par votre manière d'être, mais aussi génétiquement. Si nous pouvions séquencer tous les codes génétiques des clients de l'épicerie, incluant le vôtre, nous pourrions établir le bassin génétique de cette « population » d'individus qui font leur épicerie à ce moment. -->
<!-- Tout comme dans l'exemple précédent,  -->
<p>À la base, la variation est génétique. La collection d’individus et leurs codes génétiques différents contribuent à un bassin génétique pour un habitat quelconque. <!-- , puisqu'ils sont tous génétiquement différents les uns des autres  --> C’est donc dans ce bassin de gènes que les individus sont sélectionnés naturellement en fonction des conditions de l’environnement. Cela détermine quel ensemble de bagages génétiques pourra voyager dans la prochaine génération. <!-- À quel point l'environnement est exigeant pour les organismes sélection naturelle est d'observer des changements génétiques au niveau des populations.  --></p>
<p>Rappelons donc que la biodiversité change constamment avec les mécanismes évolutifs (voir <a href="https://evologie.netlify.app/posts/2025_03_11_evologie/evologie" target="_blank">Qu’est-ce qui se cache sous le tapis de l’évolution?</a>). Il existe donc des conditions environnementales qui peuvent favoriser ou empêcher l’émergence de biodiversité. Si l’on regarde le nombre de taxons dans le dernier 500 millions d’années, une ligne en dent de scie montrerait des augmentations et diminutions. C’est ce que des chercheurs ont faire pour des invertébrés marins <span class="citation" data-cites="alroyPhanerozoicTrendsGlobal2008">(Alroy et al. 2008)</span>. Le constat est que de la biodiversité émerge et s’éteint à des taux différents : parfois une augmentation rapide, des fois des extinctions spectaculaires et d’autres fois des stagnations. Les scientifiques ont même donné des noms aux moments de la grande histoire géologique de la vie comme les <a href="https://fr.wikipedia.org/wiki/Extinction_massive">extinctions massives</a> (ou crises biologiques) et les ‘explosion’ de biodiversification qui sont des moments où il y a une augmentation rapide d’espèces. Par exemple, pour les animaux l’<a href="https://fr.wikipedia.org/wiki/Explosion_cambrienne">explosion du Cambrien</a> et la <a href="https://fr.wikipedia.org/wiki/Grande_biodiversification_ordovicienne">grande biodiversification ordovicienne</a>, puis pour les plantes lors de la <a href="https://en.wikipedia.org/wiki/Silurian-Devonian_Terrestrial_Revolution">diversification intense pendant le Silurien-Dévonien</a>) en sont des exemples bien connus <span class="citation" data-cites="fanHighresolutionSummaryCambrian2020">(Fan et al. 2020)</span>.</p>
<!-- De ce nombre, X sont des insectes. Comme le disait le scientifique Robert M. May [-@mayBiologicalDiversityHow1986] : -->
<!-- > Le nombre total d'espèces effectivement nommées et cataloguées est d'un peu plus d'un million. La plupart d'entre elles sont des insectes. En effet, à une bonne approximation, toutes les espèces sont des insectes ![^1] -->
<!-- [^1]: Citation originale *The total number of species actually named and catalogued is just over one million. Most of these are insects. Indeed, to a good approximation, all species are insects!* -->
<!-- (imaginez le défis collosal si on incluait les espèces fossiles ou éteintes 🦤!) -->
</section>
<section id="les-bassins-génétiques-sérodent" class="level2">
<h2 class="anchored" data-anchor-id="les-bassins-génétiques-sérodent">Les bassins génétiques s’érodent…</h2>
<p>Cependant, plusieurs experts sont inquiets : alors que les scientifiques n’ont même pas accès à un portrait complet des espèces vivantes actuellement sur la terre, nous en perdons à un rythme jamais enregistré de l’histoire de l’humanité.</p>
<p>Le rapport de la <em>Plateforme intergouvernementale scientifique et politique sur la biodiversité et les services écosystémiques</em> (IPBES), colligé par un groupe international d’experts, rapporte qu’environ 1 million d’espèces animales et végétales sont actuellement menacées d’extinction <span class="citation" data-cites="ipbesResumeDecideurs2016">(IPBES 2016)</span>. Au Canada, depuis les années 1970, la taille de certaines populations animales a chuté de 62% et plus de la moitié des 910 espèces étudiées ont décliné en abondance <span class="citation" data-cites="wwf-canadaRapportPlaneteVivante2025">(WWF-Canada 2025a)</span>. Le <em>Rapport Planète vivante Canada 2025</em> est clair <span class="citation" data-cites="wwf-canada2025">(2025b)</span> :</p>
<blockquote class="blockquote">
<p>Le constat est qu’il y a des déclins persistants des populations d’espèces suivies depuis plus d’un demi-siècle.</p>
</blockquote>
<p>La perte de biodiversité est un enjeu majeur de notre époque. Comme le rappel le rapport du Cadre mondial de la biodiversité de Kunming-Montréal <span class="citation" data-cites="conventiondivbioCBM2022">(Convention sur la diveristé biologique 2022)</span> :</p>
<blockquote class="blockquote">
<p>La biodiversité est essentielle au bien-être humain, à la santé de la planète et à la prospérité économique de tous les peuples, notamment à la réalisation de modes de vie équilibrés et en harmonie avec la Terre nourricière.</p>
</blockquote>
<p>En d’autres mots, nous ne pouvons pas nous passer de la biodiversité. Et sa perte est liée à la nôtre. Il semble donc impératif d’en apprendre plus sur ces êtres vivants, petits et grands.</p>
<!-- Une des missions de [Biodiversité Québec](https://biodiversite-quebec.ca/fr/a_propos) est l'agrégation de données de biodiversités de plusieurs sources dont le Système mondial d’information sur la biodiversité <a href='https://www.gbif.org' target='_blank'>GBIF (Global Biodiversity Information Facility)</a>, le Ministère des Forêts, de la Faune et des Parcs, le Regroupement QuébecOiseaux, le Service canadien de la faune et bien d'autres.  En plus, Biodiversité Québec donne [accès aux données publiques de l'Atlas](https://biodiversite-quebec.ca/fr/documentation/acces-atlas) en langage de programmation R. -->
</section>
<section id="guide-didentification-intégrant-les-données-de-science-citoyennes" class="level2">
<h2 class="anchored" data-anchor-id="guide-didentification-intégrant-les-données-de-science-citoyennes">Guide d’identification intégrant les données de science citoyennes</h2>
<p>Qu’est-ce qui pourrait aider à en apprendre plus sur nos voisins et cousins animaux, plantes, champignons avec qui nous partageons l’environnement? Où débuter en tant que naturalistes en herbe? <!-- et aider des scientifiques à faire des études en conservation.  --> Pour en connaitre plus sur la vie qui nous entoure, nous avons besoin de les identifier. Et pour cela, nous avons besoin d’un guide.</p>
<p>Les guides d’identification contiennent une source importante d’information sur la biodiversité. Par contre, pour un débutant qui n’est pas accompagné d’un spécialiste, on peut rapidement être submergé par toutes les espèces et les nuances de ses formes. En plus, les livres d’identification sont souvent plutôt lourds à apporter dans un sac. Mais ne pas avoir de guide n’est pas une option si notre but est de connaître les organismes que nous pourrions rencontrer pour une région donnée.</p>
<p>Un juste milieu entre un guide complet sous forme de livre et ne pas avoir de guide pourrait être des petits dépliants avec les espèces locales les plus probables d’être observées dans un milieu. Ce dépliant serait aussi un bon point de départ pour parler de diversité lors de sorties sur le terrain avec un groupe de personnes, dont des enfants, ou pour montrer à des visiteurs curieux ce que nous observons. <!-- C'est une manière de compararer les organismes et leurs liens écologiques, etc. Bref, c'est une sorte de présentation PowerPoint de biodiversité qui vous suit. --></p>
<p>Serait-il possible de faire un court guide avec des espèces souvent observées pour le Québec? Est-ce possible d’utiliser les données de présence d’espèces pour faire un dépliant de biodiversité? Comme inspiration, la collection de <a href="https://www.broquet.ca/collection/guide-eclair/" target="_blank">Guides éclair (Broquet)</a> sur le thème de la nature ou les guides de <a href="https://www.waterfordpress.com" target="_blank">Waterford Press</a> sont le genre de dépliant qui pourrait être fait avec les données de science citoyenne (comme <a href="https://www.inaturalist.org" target="_blank">iNaturalist</a>). Certains dépliants ajoutent de l’information comme des cartes avec des endroits intéressants pour aller faire des observations en nature.</p>
<p>Un dépliant basé sur des données de science citoyenne se distingue de ceux produits par Broquet et Waterford Press de deux manières. D’abord, les espèces dans un dépliant d’une région peuvent être différentes d’une autre. Par exemple, les espèces qui se retrouvent en Gaspésie ne se retrouvent pas à Montréal comme le fou de Bassan. En deuxième lieu, si une région manque de données d’observation d’espèce, cela peut servir de point de motivation pour aller en collecter et cibler la collecte de données de science citoyenne. Avant l’effort collectif amené par la science citoyenne, l’acquisition de données de biodiversité dans les endroits peu échantillonnés aurait été une tâche monastique. Les outils et les bases de données de biodiversité, maintenant accessible, rendent ce genre de projet possible.</p>
</section>
<section id="réaliser-le-dépliant-en-trois-étapes" class="level2">
<h2 class="anchored" data-anchor-id="réaliser-le-dépliant-en-trois-étapes">Réaliser le dépliant en trois étapes</h2>
<p>Pour réaliser ce guide sous forme de dépliant, j’utilise le langage de programmation <a href="https://cran.r-project.org">R</a> puisqu’il permet de manipuler des données spatiales et de biodiversité avec des fonctions développées par une communauté de programmeur passionnée. Tout au long de cette série de billets, nous allons explorer les extensions du langage R permettant ainsi de réaliser le dépliant.</p>
<p>Voici mon plan pour réaliser ce dépliant. Nous allons aborder trois grands thèmes dans cette série :</p>
<ol type="1">
<li>La <strong>cartographie</strong> de <strong>zones critiques de biodiversité</strong>,</li>
<li>la synthèse de <strong>listes d’espèces observées</strong> par la science citoyenne et</li>
<li>la construction du <strong>guide d’identifications</strong> avec les espèces choisies.</li>
</ol>
<p>Dans le <a href="../../../posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/Guide_biodiv_qc_1.html">prochain billet</a>, nous allons apprendre comment manipuler des données spatiales avec R et faire des cartes ! La figure 2 en montre un exemple :</p>
<div id="fig-carteqc" class="quarto-float quarto-figure quarto-figure-center anchored" alt="Carte sud du Québec">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-carteqc-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/images/ggplot_sf_carte.png" class="img-fluid figure-img" alt="Carte sud du Québec">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-carteqc-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;2: Exemple de carte du prochain billet
</figcaption>
</figure>
</div>
<p>Nous allons voir dans cette série que les données d’observation d’organismes ont une composante spatiale. Il sera plus facile de placer ces observations une fois les cartes produites!</p>
<!-- Pour les oiseaux, des guides montrent les espèces les plus fréquemment observées dans différents groupes taxonomiques : 1. la sauvagine et les oiseaux de rivage (environ entre 45 et 60 espèces; pour ceux-ci, les femelles canards sont souvent montrées), 2. le gibier (2-4 espèces), 3. les colombes, pics, martin-pêcheurs, colibris, martinets, etc. (11-12 espèces), 4. les oiseaux de proie (12-13 espèces), 5. Les oiseaux percheurs (45-54). -->



</section>


<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">Les références</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-alroyPhanerozoicTrendsGlobal2008" class="csl-entry">
Alroy, John, Martin Aberhan, David J. Bottjer, Michael Foote, Franz T. Fürsich, Peter J. Harries, Austin J. W. Hendy, et al. 2008. <span>«&nbsp;Phanerozoic <span>Trends</span> in the <span>Global Diversity</span> of <span>Marine Invertebrates</span>&nbsp;»</span>. <em>Science</em> 321 (5885): 97‑100. <a href="https://doi.org/10.1126/science.1156963">https://doi.org/10.1126/science.1156963</a>.
</div>
<div id="ref-conventiondivbioCBM2022" class="csl-entry">
Convention sur la diveristé biologique. 2022. <span>«&nbsp;<span>Cadre mondial de la biodiversit<span>é</span> (CBD/COP/DEC/15/4)</span>&nbsp;»</span>. Organisation des Nations unies (ONU). <a href="https://www.cbd.int/doc/decisions/cop-15/cop-15-dec-04-fr.pdf">https://www.cbd.int/doc/decisions/cop-15/cop-15-dec-04-fr.pdf</a>.
</div>
<div id="ref-Dawkins:2016vi" class="csl-entry">
Dawkins, Richard. 2016. <em><span>The Selfish Gene</span></em>. 40th Anniversary edition (Oxford Landmark Science). Oxford: Oxford University Press. <a href="https://global.oup.com/academic/product/the-selfish-gene-9780198788607">https://global.oup.com/academic/product/the-selfish-gene-9780198788607</a>.
</div>
<div id="ref-fanHighresolutionSummaryCambrian2020" class="csl-entry">
Fan, Jun-xuan, Shu-zhong Shen, Douglas H. Erwin, Peter M. Sadler, Norman MacLeod, Qiu-ming Cheng, Xu-dong Hou, et al. 2020. <span>«&nbsp;A High-Resolution Summary of <span>Cambrian</span> to <span>Early Triassic</span> Marine Invertebrate Biodiversity&nbsp;»</span>. <em>Science</em> 367 (6475): 272‑77. <a href="https://doi.org/10.1126/science.aax4953">https://doi.org/10.1126/science.aax4953</a>.
</div>
<div id="ref-ipbesResumeDecideurs2016" class="csl-entry">
IPBES. 2016. <span>«&nbsp;<span>R<span>é</span>sum<span>é</span> <span>à</span> l’intention des d<span>é</span>cideurs du rapport d’<span>é</span>valuation de la Plateforme intergouvernementale scientifique et politique sur la biodiversit<span>é</span> et les services <span>é</span>cosyst<span>é</span>miques concernant les pollinisateurs, la pollinisation et la production alimentaire</span>&nbsp;»</span>. Zenodo. <a href="https://doi.org/10.5281/ZENODO.2616458">https://doi.org/10.5281/ZENODO.2616458</a>.
</div>
<div id="ref-larsenInordinateFondnessMultiplied2017" class="csl-entry">
Larsen, Brendan B., Elizabeth C. Miller, Matthew K. Rhodes, et John J. Wiens. 2017. <span>«&nbsp;Inordinate <span>Fondness Multiplied</span> and <span>Redistributed</span>: The <span>Number</span> of <span>Species</span> on <span>Earth</span> and the <span>New Pie</span> of <span>Life</span>&nbsp;»</span>. <em>The Quarterly Review of Biology</em> 92 (3): 229‑65. <a href="https://doi.org/10.1086/693564">https://doi.org/10.1086/693564</a>.
</div>
<div id="ref-wwf-canadaRapportPlaneteVivante2025" class="csl-entry">
WWF-Canada. 2025a. <span>«&nbsp;<span>Rapport plan<span>è</span>te vivante Canada 2025 les esp<span>è</span>ces dans leur habitat : Synth<span>è</span>se</span>&nbsp;»</span>. Currie J. &amp; Snider J. World Wildlife Fund Canada.
</div>
<div id="ref-wwf-canada2025" class="csl-entry">
WWF-Canada. 2025b. <span>«&nbsp;Rapport plan<span>è</span>te vivante Canada 2025 les esp<span>è</span>ces dans leur habitat : Synth<span>è</span>se&nbsp;»</span>. <a href="https://wwf.ca/wp-content/uploads/2025/09/WWF_LPRC_Executive-Summary-FR.pdf">https://wwf.ca/wp-content/uploads/2025/09/WWF_LPRC_Executive-Summary-FR.pdf</a>.
</div>
</div></section><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Notes de bas de page</h2>

<ol>
<li id="fn1"><p>L’épigénétique pourrait être un moyen d’avoir tout de même des différences d’expressions des gènes, mais imaginons que nous n’avons même pas ce genre de variation↩︎</p></li>
</ol>
</section><section class="quarto-appendix-contents" id="quarto-citation"><h2 class="anchored quarto-appendix-heading">Citation</h2><div><div class="quarto-appendix-secondary-label">BibTeX</div><pre class="sourceCode code-with-copy quarto-appendix-bibtex"><code class="sourceCode bibtex">@article{beausoleil2026,
  author = {Beausoleil, Marc-Olivier},
  title = {Guide d’identification de biodiversité du Québec - Prélude},
  journal = {Évologie},
  date = {2026-01-19},
  url = {https://evologie.netlify.app},
  langid = {fr}
}
</code></pre><div class="quarto-appendix-secondary-label">Citation : </div><div id="ref-beausoleil2026" class="csl-entry quarto-appendix-citeas">
Beausoleil, Marc-Olivier. 2026. <span>“Guide d’identification de
biodiversité du Québec - Prélude.”</span> <em>Évologie</em>, January. <a href="https://evologie.netlify.app">https://evologie.netlify.app</a>.
</div></div></section></div> ]]></description>
  <category>biodiversité</category>
  <guid>https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/Guide_biodiv_qc_0.html</guid>
  <pubDate>Mon, 19 Jan 2026 05:00:00 GMT</pubDate>
  <media:content url="https://evologie.netlify.app/posts/guide_biodiv_qc/2025_05_24_Guide_biodiv_qc/images/Ecureuil_Roux_Americain_IMGP9724_2018_09_14_ban.jpeg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Pic moi la curiosité</title>
  <dc:creator>Marc-Olivier Beausoleil</dc:creator>
  <link>https://evologie.netlify.app/posts/2025_03_16_picbois/le_pic-bois.html</link>
  <description><![CDATA[ 





<section id="une-vague-de-bitume" class="level2">
<h2 class="anchored" data-anchor-id="une-vague-de-bitume">Une vague de bitume</h2>
<p>Là où vit Paul, une forêt se réveillait tous les matins avec un vent calme dans les branches, les encouragements des oiseaux et le doux son de l’eau qui coulait dans les veines de la terre gardant les poumons sylvicoles bien hydratés. Une foule de créatures habitait cet endroit d’une beauté à en faire pleurer les écureuils.</p>
<p>Hélas, on a jeté un sort pétrifiant à cette forêt. Une catastrophe changea cet habitat plein de mystères : de grandes vagues de roches liquides se sont emparées du paysage tapissant ainsi le sol, écrasant au passage toutes les maisons des créatures qui s’y trouvaient. Aucun volcan dans les parages ne fut à accuser Ces vagues ne laissèrent pas la biodiversité indifférente : des raz de marée de bétons par-ci et de bitume par-là ont morcelé d’anciens villages qui se sont forgés pendant des millénaires.</p>
<p>Encore aujourd’hui, le déluge bitumineux laisse une cicatrice dans ce tableau. Et de cette blessure sont nés de nouvelles maisons, puis des quartiers. Tout un système routier où des créatures métalliques roulent à l’or noir, brûlant l’âme d’une vie ancienne qui dormait paisiblement depuis des millénaires. Un réseau surchauffé par des pilotes pressés d’arriver à divers arrêts.</p>
<p>Jadis, une bonne partie de la diversité de vivants de cette forêt se composait d’insectes. Ne sachant plus où aller, certaines de ces bestioles à six pattes ont élu domicile dans les maisons des nouveaux occupants de cette mare de béton : dans la cave, dans les charpentes, dans les murs, etc. D’autres ont dû choisir un nouvel habitat. Comme des parasites, certaines ont même trouvé logis dans la tête des citadins. Quel beau dommage!</p>
</section>
<section id="le-chant-du-pic-bois" class="level2">
<h2 class="anchored" data-anchor-id="le-chant-du-pic-bois">Le chant du pic bois</h2>
<div style="float: right; margin: 5px; width: 250px;">
<div id="fig-grandpic" class="quarto-float quarto-figure quarto-figure-center anchored" alt="Grand pic">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-grandpic-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://evologie.netlify.app/posts/2025_03_16_picbois/Grand_pic_2013.jpg" class="img-fluid figure-img" alt="Grand pic">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-grandpic-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: Grand pic mâle (<a href="https://inaturalist.ca/taxa/17855-Dryocopus-pileatus"><em>Dryocopus pileatus</em></a>). MOB CC BY 4.0
</figcaption>
</figure>
</div>
</div>
<p>La chanson <a href="https://www.youtube.com/watch?v=a0tgrlcgINw">«&nbsp;Le <strong>Picbois</strong>&nbsp;»</a> du groupe Beau Dommage <span class="citation" data-cites="BeauDommage:LPB1974">(1974)</span> raconte l’histoire d’un citadin que je me plais à nommer Paul. N’ayant baigné que dans une mare de béton et d’asphalte depuis sa naissance, Paul part parfumer ses vêtements d’effluves provenant des essences de la forêt. Et cette fois-ci, ce ne sera pas le Mont-Royal qui sera ladite forêt choisie. Paul rêve d’aller plus loin. Il doit couper le cordon avec la ville et découvrir l’au-delà de l’île. À l’aventure !</p>
<p>Arrivé à destination, le protagoniste s’apaise devant ce vert-chlorophylle çà et là qui discrètement saute aux yeux. <a href="https://macaulaylibrary.org/asset/88977181">Koi-—kan—kan-kan-kan-kan-kan-kan-kan-kan-kan-kan-kan-kan-kan-kan-kan-kan-kan-kan–kan–kan!</a>. Une voix étrange résonne dans cette cathédrale feuillue. Un peu comme si quelqu’un se moquait ostensiblement de lui. Une ombre foncée imposante se déplace. Pas de doute, c’est un oiseau. Puis, un roulement de tambour sylvicole retentit. Paul se fait enchanter par les rythmes envoutants du pic (Figure&nbsp;1).</p>
<p>Des pensées folles l’animent. Peut-être que les insectes réfugiés de la ville, pris dans sa tête, veulent sortir? Inviter ce marteau piqueur aviaire à venir taper sur sa tête permettrait sûrement de se débarrasser de ces bibittes qui parasitent son esprit.</p>
<p>Paul repart poursuivre sa positive péripétie et se voit ravi de vivre ce privilège en présence de Dame Nature. Aidé par l’oiseau, le voilà donc émerveillé, la curiosité piquée, débutant ainsi une avalanche de questions.</p>
</section>
<section id="les-avantages-du-pic-bois" class="level2">
<h2 class="anchored" data-anchor-id="les-avantages-du-pic-bois">Les avantages du pic bois</h2>
<p>Par une heureuse coïncidence, Paul me croise, alors que j’observe les oiseaux aux jumelles lors de cette splendide journée. Voulant en connaître davantage sur sa découverte, il s’interroge sur le nom du pic en question. Je m’exclame : «&nbsp;Ah! Son nom, c’est une chose, ce qui m’intéresse, ce sont ses super pouvoirs!&nbsp;» Perplexe, Paul exige des explications. Voyez-vous, les pics sont les champions du tapage de tête sur le mur. Mais cela a dû prendre du temps à développer. On ne se met pas à taper son nez à pleine vitesse dans le bois du jour au lendemain <span class="citation" data-cites="bockFunctionalEvolutionaryMorphology1999">(Bock 1999)</span>.</p>
<p>Leur bec, plus solide que d’autres espèces d’oiseaux, permet d’excaver des cavités (Figure&nbsp;2) pour extraire de la nourriture tout l’an, mais en même temps de construire un abri. Pour creuser des trous, ça prend un bon casque. En fait, la tête des pics s’équipe d’une protection utile pour un chantier de construction : le cou est musclé et le crâne plus robuste.</p>
<!-- ::: {layout="[ [40,60]]"} -->
<div style="float: left; margin: 5px;">
<div id="fig-troupic" class="quarto-float quarto-figure quarto-figure-center anchored" alt="Trous de pic">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-troupic-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://evologie.netlify.app/posts/2025_03_16_picbois/trous_arbre_2025_02_22.jpg" class="img-fluid figure-img" alt="Trous de pic" width="250">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-troupic-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;2: Trous de pic. MOB CC BY 4.0
</figcaption>
</figure>
</div>
</div>
<p>Paul en profite pour approfondir le sujet. «&nbsp;Est-ce que les pics ont un dispositif qui permet d’absorber les chocs pour ne pas s’éclater la cervelle?&nbsp;» Aussi étrange que ça puisse paraître, il n’absorberait pas les chocs. Cela est pour maximiser l’impact du bec sur le bois <span class="citation" data-cites="vanwassenberghWoodpeckersMinimizeCranial2022">(Van Wassenbergh et al. 2022)</span>! Par contre, le cerveau se protège probablement avec d’autres mécanismes, dont la forme et la position de leur cerveau dans le crâne. Et avec une accélération trois fois au niveau du seuil de commotion chez l’humain, clairement nous aurions besoin d’une protection pour ne pas finir avec une soupe cérébrale <span class="citation" data-cites="savitskyContraryPopularBelief2022">(Savitsky 2022)</span>. Bien que les recherches ont surtout été faites sur les impacts du bec sur du bois, d’autres recherches doivent déterminer si l’impact du bec sur du métal demande une protection supplémentaire, comme lorsque certains pics utilisent des poteaux pour marquer leur territoire.</p>
<p>Les <a href="https://www.youtube.com/watch?v=KX16_FfS6yo">vidéos avec ralenti montrent</a> que les pics ferment leurs yeux à chaque impact. Des équipes de recherche s’intéressent aux adaptations des yeux du pic pour comprendre comment ils sont protégés des impacts <span class="citation" data-cites="wygnanski-jaffeProtectiveOcularMechanisms2007">(Wygnanski-Jaffe et al. 2007)</span>. Parmi ceux-ci, certains mouvements de l’œil sont limités et le blanc de l’œil (la sclère) se déforme moins que celle de l’humain.</p>
<p>Paul n’a pas de mots : ils se sont fait piquer. Et ce n’est pas tout!</p>
<p>La plupart des oiseaux percheurs portent au pied trois doigts en avant et un en arrière. Mais chez les pics, leurs pieds sont différents : la plupart de ces espèces ont deux doigts en avant et deux en arrière (zygodactyle, ce qui veut dire «&nbsp;jonction de doigts&nbsp;») facilitant le déplacement sur un tronc (escaladeur de tronc).</p>
<p>Les plumes de la queue sont aussi plus rigides et effilées permettant de les utiliser comme un appui pour escalader les troncs et pour faire une sorte de trépied avec son corps pour se stabiliser en martelant <span class="citation" data-cites="Associationquebecoisedesgroupesdornithologues:1995vx">(Gauthier et Aubry 1995)</span>.</p>
<p>Sans compter les différentes formes de langues des pics selon leur mode d’alimentation (avec salive collante pour manger des fourmis comme le grand pic [<a href="https://inaturalist.ca/taxa/17855-Dryocopus-pileatus"><em>Dryocopus pileatus</em></a>] ou <a href="https://www.hiltonpond.org/ThisWeek070215.html" title="Voir les photos, dont une montrant la langue!">pinceau</a> pour obtenir de la sève, comme le pic maculé [<a href="https://inaturalist.ca/taxa/18463-Sphyrapicus-varius"><em>Sphyrapicus varius</em></a>] fait).</p>
<p>Qui plus est, le pic fascinait Darwin qui introduisait cet oiseau au <a href="https://en.wikisource.org/wiki/Page%3AOrigin_of_Species_1859_facsimile.djvu/13">début de l’Origine des espèces</a> comme exemple de la sélection naturelle :</p>
<blockquote class="blockquote">
<p>[…] il est absurde d’attribuer à de simples conditions extérieures la structure, par exemple, du pic, avec ses pieds, sa queue, son bec et sa langue, si admirablement adaptés pour attraper des insectes sous l’écorce des arbres. <span class="citation" data-cites="darwin1859">(Darwin et al. 1859)</span></p>
</blockquote>
</section>
<section id="le-pic-un-allié-à-la-crise-du-logement" class="level2">
<h2 class="anchored" data-anchor-id="le-pic-un-allié-à-la-crise-du-logement">Le pic : un allié à la crise du logement</h2>
<p>De par son alimentation, le grand pic perce des trous dans les arbres pour se nourrir de fourmis charpentières (<a href="https://inaturalist.ca/taxa/129902-Camponotus-pennsylvanicus"><em>Camponotus pennsylvanicus</em></a> ou fourmi noire gâte-bois). Comme beaucoup d’autres pics insectivores, une grande quantité d’insectes foreurs finissent dans son bec.</p>
<!-- ::: {layout="[ [70,30]]"} -->
<div style="float: right; margin: 5px;">
<div id="fig-picche" class="quarto-float quarto-figure quarto-figure-center anchored" alt="Pic chevelu">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-picche-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://evologie.netlify.app/posts/2025_03_16_picbois/pic_chevelu_2020_05_27_Sutton.JPG" class="img-fluid figure-img" alt="Pic chevelu" width="270">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-picche-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;3: Pic chevelu <a href="https://inaturalist.ca/taxa/792988-Dryobates-pubescens">(<em>P. villosus</em>)</a> MOB CC BY 4.0
</figcaption>
</figure>
</div>
<!-- ![Pic mineur (*Picoides pubescens*) MOB CC BY 4.0](pic_mineur_2021_04_26.JPG){#fig-picmin fig-alt="Pic mineur" width="250px"} -->
</div>
<p>Une forêt avec un grand pic a de la chance. Cet oiseau maître charpentier est considéré comme une espèce clé de voute. C’est-à-dire que ces pics jouent un rôle d’influence qui est disproportionnellement large comparé à son abondance ou sa biomasse. Et pour compte, plus de 25 autres espèces bénéficient de ses cavités lorsque le grand pic décide de déménager <span class="citation" data-cites="Aubry2002ThePW bonar2000 Bull_1997">(Bull et al. 1997; Bonar 2000; Aubry et Raley 2002)</span>. De ces espèces, on ne compte pas seulement des espèces d’oiseaux cavicoles, dont le canard branchu (<a href="https://inaturalist.ca/taxa/7107-Aix-sponsa"><em>Aix sponsa</em></a>), mais aussi des mammifères comme la martre d’Amérique (<a href="https://inaturalist.ca/taxa/41798-Martes-americana"><em>Martes americana</em></a>) et le grand polatouche (<a href="https://inaturalist.ca/taxa/46266-Glaucomys-sabrinus"><em>Glaucomys sabrinus</em></a>).</p>
<p>En ce qui concerne les services que les pics rendent, il y a non seulement les trous laissés dans les arbres pour d’autres animaux, mais aussi la dispersion des semences de végétaux. Voici un petit fait intéressant : bien que le pic chevelu (<a href="https://inaturalist.ca/taxa/792990-Dryobates-villosus"><em>Picoides villosus</em></a>, Figure&nbsp;3) adore les brochettes de bibittes, il peut manger les fruits de l’<a href="https://www.quebec.ca/habitation-territoire/milieu-de-vie-sain/reconnaitre-et-eliminer-l-herbe-a-la-puce">herbe à la puce</a> <a href="https://inaturalist.ca/taxa/58732-Toxicodendron-radicans">(Toxicodendron radicans (L.))</a> sans brûlement d’estomac <span class="citation" data-cites="beal1911">(Beal et Fuertes 1911)</span>! Il contribue à disperser les semences de cette plante que personne n’ose s’y frotter. Heureusement, des méthodes existent pour <a href="https://www.plantesenvahissantes.ulaval.ca/wp-content/uploads/sites/3/2021/02//HERBE_A_PUCE2.pdf">lutter contre cette plante</a>.</p>
</section>
<section id="la-forêt-enchantée" class="level2">
<h2 class="anchored" data-anchor-id="la-forêt-enchantée">La forêt enchantée</h2>
<p>Paul ne sait plus où donner de la tête. «&nbsp;Wow ! Ce sont des superhéros, ces pics. Et moi j’arrive comme ça, dans leurs grandes maisons, sans connaître leur nom…&nbsp;». Paul est curieux de savoir qui compose cette communauté d’êtres exceptionnels. «&nbsp;Voilà la vraie richesse de notre planète&nbsp;». Je sens alors que Paul ne pense qu’à planter les piquets d’une tente au pied du temple de Dame Nature. Prêt à inventer des prétextes pour ne pas revenir en ville. Un peu pour s’imprégner de cette vénusté terrienne naturelle.</p>
<p>Les pics réservent encore bien des surprises à qui veut bien les étudier. Ils ont une histoire évolutive à s’en fendre le crâne, étant un modèle d’évolution par sélection naturelle et sont des acteurs importants du fonctionnement des écosystèmes.</p>
<p>Comme les pics, nous sommes le résultat d’une suite d’ancêtres ininterrompue depuis l’origine de la vie. Une chaine fragile qui parfois se brise. <a href="https://www.iucnredlist.org/search?query=woodpecker&amp;searchType=species">Les effectifs de plusieurs populations déclinent</a> et certaines espèces de pics sont portées disparues depuis plusieurs décennies comme le <a href="https://inaturalist.ca/taxa/18288-Campephilus-principalis">pic à bec ivoire (<em>Campephilus principalis</em>)</a> et le <a href="https://inaturalist.ca/taxa/18284-Campephilus-imperialis">pic impérial (<em>Campephilus imperialis</em>)</a>.</p>
<p>Paul me remercie et affiche un grand sourire. À mieux connaître les êtres vivants, avec qui nous partageons nos quartiers, nous comprenons que nos besoins sont similaires. Nos voisins aviaires, nos confrères mammifères, nos amis les champignons; nous voulons simplement un petit bout de terre où il ferait bon vivre.</p>
<blockquote class="blockquote">
<p>Laisse-moi pas revenir en ville Tape-moi sur ma tête de bois Picbois, laisse-moi pas tranquille Picbois, j’veux pus m’en aller <span class="citation" data-cites="BeauDommage:LPB1974">(Beau Dommage 1974)</span></p>
</blockquote>
<section id="références" class="level3">
<h3 class="anchored" data-anchor-id="références">Références</h3>
<div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0" data-line-spacing="2">
<div id="ref-Aubry2002ThePW" class="csl-entry">
Aubry, K. B., et C. M. Raley. 2002. <a href="https://api.semanticscholar.org/CorpusID:85823514">The Pileated Woodpecker as a Keystone Habitat Modifier in the Pacific Northwest</a>.
</div>
<div id="ref-beal1911" class="csl-entry">
Beal, F. E. L., et L. A. Fuertes. 1911. <a href="https://doi.org/10.5962/bhl.title.55219">Food of the woodpeckers of the United States /</a>. U.S. Dept. of Agriculture, Biological Survey, Washington, D.C. :
</div>
<div id="ref-BeauDommage:LPB1974" class="csl-entry">
Beau Dommage, P. B., Robert Léger. 1974. Le Picbois. CD.
</div>
<div id="ref-bockFunctionalEvolutionaryMorphology1999" class="csl-entry">
Bock, W. J. 1999. <a href="https://doi.org/10.1080/00306525.1999.9639746">Functional and Evolutionary Morphology of Woodpeckers</a>. Ostrich 70:23‑31.
</div>
<div id="ref-bonar2000" class="csl-entry">
Bonar, R. L. 2000. <a href="https://doi.org/10.2307/3802974">Availability of Pileated Woodpecker Cavities and Use by Other Species</a>. The Journal of Wildlife Management 64:52.
</div>
<div id="ref-Bull_1997" class="csl-entry">
Bull, E. L., C. G. Parks, et T. R. Torgersen. 1997. <a href="https://doi.org/10.2737/pnw-gtr-391">Trees and logs important to wildlife in the interior Columbia River basin.</a> U.S. Department of Agriculture, Forest Service, Pacific Northwest Research Station.
</div>
<div id="ref-darwin1859" class="csl-entry">
Darwin, C., D. Becquemont, E. Barbier, et J.-M. Drouin. 1859. <a href="https://cegeps.scholarvox.com/catalog/book/docid/45000157?searchterm=Darwin,%20Charles">L’origine des esp<span>è</span>ces au moyen de la s<span>é</span>lection naturelle ou La pr<span>é</span>servation des races favoris<span>é</span>es dans la lutte pour la vie</a>. <span>É</span>d. mise <span>à</span> jour en 2008. Flammarion, Paris.
</div>
<div id="ref-Associationquebecoisedesgroupesdornithologues:1995vx" class="csl-entry">
Gauthier, J., et Y. Aubry. 1995. <a href="https://www.atlas-oiseaux.qc.ca"><span>Les oiseaux nicheurs du Qu<span>é</span>bec: Atlas des oiseaux nicheurs du Qu<span>é</span>bec m<span>é</span>ridional</span></a>. Association qu<span>é</span>b<span>é</span>coise des groupes d’ornithologues, Soci<span>é</span>t<span>é</span> qu<span>é</span>b<span>é</span>coise de protection des oiseaux, Service canadien de la Faune Environnement Canada, Montr<span>é</span>al, Qu<span>é</span>bec.
</div>
<div id="ref-savitskyContraryPopularBelief2022" class="csl-entry">
Savitsky, Z. 2022. Contrary to Popular Belief, Woodpeckers Don’t Protect Their Brains When Headbanging Trees. https://www.science.org/content/article/contrary-popular-belief-woodpeckers-don-t-protect-their-brains-when-headbanging-trees.
</div>
<div id="ref-vanwassenberghWoodpeckersMinimizeCranial2022" class="csl-entry">
Van Wassenbergh, S., E. J. Ortlieb, M. Mielke, C. Böhmer, R. E. Shadwick, et A. Abourachid. 2022. <a href="https://doi.org/10.1016/j.cub.2022.05.052">Woodpeckers Minimize Cranial Absorption of Shocks</a>. Current Biology 32:3189‑3194.e4.
</div>
<div id="ref-wygnanski-jaffeProtectiveOcularMechanisms2007" class="csl-entry">
Wygnanski-Jaffe, T., C. J. Murphy, C. Smith, M. Kubai, P. Christopherson, C. R. Ethier, et A. V. Levin. 2007. <a href="https://doi.org/10.1038/sj.eye.6702163">Protective Ocular Mechanisms in Woodpeckers</a>. Eye 21:83‑89.
</div>
</div>


</section>
</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-citation"><h2 class="anchored quarto-appendix-heading">Citation</h2><div><div class="quarto-appendix-secondary-label">BibTeX</div><pre class="sourceCode code-with-copy quarto-appendix-bibtex"><code class="sourceCode bibtex">@article{beausoleil2025,
  author = {Beausoleil, Marc-Olivier},
  title = {Pic moi la curiosité},
  journal = {Évologie},
  date = {2025-07-31},
  url = {https://evologie.netlify.app},
  doi = {10.59350/xx3k5-kkp49},
  langid = {fr}
}
</code></pre><div class="quarto-appendix-secondary-label">Citation : </div><div id="ref-beausoleil2025" class="csl-entry quarto-appendix-citeas">
Beausoleil, M.-O. 2025. Pic moi la curiosité. Évologie, doi: <a href="https://doi.org/10.59350/xx3k5-kkp49">10.59350/xx3k5-kkp49</a>.
</div></div></section></div> ]]></description>
  <category>biodiversité</category>
  <category>évolution</category>
  <category>histoire</category>
  <guid>https://evologie.netlify.app/posts/2025_03_16_picbois/le_pic-bois.html</guid>
  <pubDate>Thu, 31 Jul 2025 04:00:00 GMT</pubDate>
  <media:content url="https://evologie.netlify.app/posts/2025_03_16_picbois/Grand_pic_2013_ban.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Qu’est-ce qui se cache sous le tapis de l’évolution?</title>
  <dc:creator>Marc-Olivier Beausoleil</dc:creator>
  <link>https://evologie.netlify.app/posts/2025_03_11_evologie/evologie.html</link>
  <description><![CDATA[ 





<section id="levons-le-tapis-de-lévolution" class="level2">
<h2 class="anchored" data-anchor-id="levons-le-tapis-de-lévolution">Levons le tapis de l’évolution</h2>
<p>Ce mot me hante depuis longtemps. Ce mot a suscité des éons de tourment et de fascination. Ce redoutable mot est l’évolution. Comment pourrait-il autant me casser la tête ainsi qu’à de nombreuses personnes curieuses? Discutant de ce sujet, Stephen J. Gould <span class="citation" data-cites="Gould:2000uo">(2000)</span> explique que l’étymologie du mot «&nbsp;évolution&nbsp;» se réconcilie difficilement avec la signification moderne de ce terme. Darwin avait même dédaigné le mot «&nbsp;évolution&nbsp;» dans son livre l’origine des espèces et se contente d’utiliser le mot «&nbsp;évolué&nbsp;» qu’à la toute fin de l’ouvrage à l’intérieur de cette fameuse phrase :</p>
<!-- > *"\[...\] whilst this planet has gone cycling on according to the fixed law of gravity, from so simple a beginning endless forms most beautiful and most wonderful have been, and are being, evolved."* [@Darwin:1859uh] -->
<blockquote class="blockquote">
<p><em>“[…] tandis que cette planète tournait en rond selon les lois établies de la gravité, une infinité de formes regorgeant de beauté et de merveilles, à partir d’un commencement si simple, ont évolué et évoluent encore”</em> <span class="citation" data-cites="Darwin:1859uh">(Darwin 1859)</span></p>
</blockquote>
<p>Cette phrase est célèbre entre autres parce que Darwin comprenait la <a href="https://www.youtube.com/watch?v=CimqEnhIAgw" target="_blank">portée philosophique de sa théorie</a> en distinguant l’évolution cosmique et l’évolution biologique. Dans ses pensées, l’évolution cosmique était peu surprenante : elle se déroulait de manière prédictible et directionnelle selon des lois physiques inchangées. En revanche, selon l’image que Darwin nous peint de sa théorie, l’évolution biologique a une prévisibilité limitée, elle est dynamique, génère de la diversité en formes et fonctions tout en étant «&nbsp;aveugle&nbsp;». En d’autres mots, elle ne peut pas être prédite sur le long terme.</p>
</section>
<section id="lévolution-biologique-est-aveugle" class="level2">
<h2 class="anchored" data-anchor-id="lévolution-biologique-est-aveugle">L’évolution biologique est aveugle</h2>
<p>Les biologistes entendent, par l’expression <em>évolution biologique</em>, des changements d’une population d’organismes au niveau de leur forme, fonction et comportement entre générations. Autrement dit, ce sont les populations qui changent dans l’espace et le temps au niveau de leur composition génétique. Plusieurs mécanismes expliquent ces changements génétiques, dont <a href="https://www.youtube.com/watch?v=5NdMnlt2keE" target="_blank">cinq principaux</a>.</p>
<ol type="1">
<li>les <em>mutations</em> qui sont des modifications du code génétique,</li>
<li>le <em>mouvement des populations</em> où des organismes partent en voyage avec leur bagage génétique vers d’autres populations,</li>
<li>l’<em>appariement entre organismes</em> c’est-à-dire le choix du partenaire par exemple sur la base de leur apparence ou de leur localisation,</li>
<li>la <em>dérive génique</em> qui affecte surtout les petites populations. Par exemple, imaginons une population d’oiseaux d’une dizaine d’individus où certains préfèreraient un plumage rouge et d’autres un plumage orange: si une tornade passe et au hasard élimine tous les individus qui ont une préférence pour le rouge, il y aurait alors dérive génique; et</li>
<li>la <em>sélection naturelle</em> qui est le seul mécanisme générant des adaptations : c’est la partie «&nbsp;<em>créative</em>&nbsp;» de l’évolution qui a produit des chefs-d’œuvre à couper le souffle!</li>
</ol>
<p>Bref, à chaque génération, les ancêtres se reproduisent. Leurs progénitures sont à leur image, mais elle est tout de même différente génétiquement : c’est la descendance avec modification. Les cinq grands mécanismes évolutifs permettent de comprendre comment ces différences émergent, perdurent ou disparaissent dans le temps. Il arrive même que, lentement, une accumulation de différences assez grande entre populations provoque l’émergence de nouvelle espèce : c’est la spéciation <span class="citation" data-cites="coyneWhyEvolutionTrue2010">(Coyne 2010)</span>. Même en connaissant ces mécanismes évolutifs, pouvons-nous prédire l’émergence d’une espèce dans 1 million d’années? Pour le moment, non.</p>
<!-- Évidemment, j'exclus tous les individus qui ne laisseront pas de descendance -->
<p>Ainsi, l’évolution est difficile à prédire à long terme puisqu’elle est le résultat de facteurs environnementaux et climatiques qui sont eux-mêmes chaotiques <span class="citation" data-cites="gleickChaosMakingNew2008">(Gleick 2008)</span>. Par contre, en regardant l’étymologie du mot «&nbsp;évolution&nbsp;» on apprend qu’il vient du latin <em>evolvere</em> ce qui veut dire «&nbsp;dérouler&nbsp;» <span class="citation" data-cites="evolutionAntidote2024">(Antidote 11, version 6.1.1 [Logiciel] 2024)</span> comme un tapis qui se déroule. Or, en se basant sur cette étymologie, une personne pourrait penser faussement que l’évolution est une suite d’événements prédictibles et qu’il existe un ordre prédéterminé. On imaginerait un tapis qui a été tissé selon un patron puis enroulé : le déroulement du tapis représenterait cette absurde représentation de l’évolution! En revanche, cette conception de «&nbsp;déroulement&nbsp;» s’accorde plus avec l’évolution du système solaire selon les «&nbsp;lois fixes de la gravité&nbsp;» comme le disait Darwin.</p>
<p>Une vision contemporaine de l’évolution s’articule autour de changements populationnels en réponse à des conditions environnementales locales et actuelles. Dans tous les cas, ces mécanismes sont sans regard aux potentiels besoins futurs d’organismes.</p>
<!-- (finalement il y a plein de tapis différents en couleurs, formes, etc.) -->
</section>
<section id="la-spéciation-du-mot-évolution" class="level2">
<h2 class="anchored" data-anchor-id="la-spéciation-du-mot-évolution">La spéciation du mot «&nbsp;évolution&nbsp;»</h2>
<p>Nous sommes confrontés à deux dimensions distinctes entourant le terme évolution divergeant d’un ancêtre commun. Nous devons donc préciser quel type d’évolution nous parlons.</p>
<p>La formation ou l’émergence de nouvelle espèce à partir d’un ancêtre commun est ce que l’on entend par le mot «&nbsp;spéciation&nbsp;». Parmi les types de spéciation, la spéciation écologique retient particulièrement l’attention de la recherche en biodiversité puisqu’elle fait écho à un ensemble de règles qui permet de déterminer ce qu’est une espèce biologique. L’une de ces règles est l’émergence de barrière à la reproduction. Cela veut dire que pour distinguer des espèces les unes des autres, il suffit d’observer si, dans un même environnement, des organismes peuvent se reproduire entre elles ou d’observer l’état de santé de la progéniture. Prenons les fous comme exemple.</p>
<div style="float: right; margin: 5px;">
<div id="fig-foupb" class="quarto-float quarto-figure quarto-figure-center anchored" alt="Un fou (ou deux; île Mosquera, Galàpagos)">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-foupb-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://evologie.netlify.app/posts/2025_03_11_evologie/fou_pieds_bleus_MB_2019.JPG" class="img-fluid figure-img" alt="Un fou (ou deux; île Mosquera, Galàpagos)" width="250">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-foupb-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: Fou à pieds bleus <br>(île Mosquera, Galàpagos). <br>MOB CC BY 4.0
</figcaption>
</figure>
</div>
</div>
<p>Les fous à pieds bleus (<em>Sula nebouxii</em>, Figure&nbsp;1) ne s’accouplent qu’après un rituel dansant : le <a href="https://www.youtube.com/watch?v=lcPHFQP9GN0" target="_blank">mâle exécute une parade nuptiale</a> où il présente délicatement et en alternance ses pieds bleu poudre. Il exhibe ses pantoufles en les levant de manière exagérée, mais doucement, vers la femelle <span class="citation" data-cites="hernandezdiazBluefootedBoobySula2020">(Hernández Dı́az et Salazar Gómez 2020)</span>. Et la femelle juge de la qualité du mâle en fonction de la couleur de ses pieds. En effet, il a été démontré que les jeunes de pères aux pieds plus bleus pesaient plus lourd <span class="citation" data-cites="velandoMaleColorationChick2005 velandoPigmentbasedSkinColour2006">(Velando et al. 2005, 2006)</span>. Et être plus lourd pour un bébé, <a href="https://toughlittlebirds.com/2013/07/10/the-fledgling-problem/" target="_blank">c’est une bonne affaire</a>.</p>
<p>La couleur des pieds est déterminée par la structure de certaines protéines dans leurs pattes (collagène), mais aussi par des pigments qui sont plus ou moins présents selon l’alimentation. Ainsi, les fous à pieds bleus ne se reproduisent pas avec d’autres espèces de fous, ce qui produit une barrière comportementale à la reproduction avec d’autres espèces. Ceci est observable par l’absence d’hybride entre ce fou et les autres espèces de fous <span class="citation" data-cites="mccarthyHandbookAvianHybrids2006">(McCarthy 2006)</span>. C’est ce qui est nommé l’isolement éthologique ou «&nbsp;par leur comportement&nbsp;»: un mâle fou de Bassan (<em>Morus bassanus</em>) ne connaissant pas la danse préférée d’une fou (folle?) à pieds bleus n’arrivera pas à la séduire. Elle n’est pas intéressée par ce mâle qui a oublié de mettre ses beaux souliers bleus. En plus, peut-être que la femelle n’appréciera pas la manière de donner <a href="https://www.youtube.com/watch?v=1YYZtu_mVmk" target="_blank">des coups de bec</a> du mâle fou de Bassan. Ainsi, les femelles aux pattes bleues refuseraient les avances grossières du mâle fou de Bassan et éviterait de se reproduire avec.</p>
<p>Cet exemple de barrière de reproduction pourrait illustrer cette spéciation de fous! Ces deux espèces, le fou à pieds bleus et le fou de Bassan possèdent des différences qui les empêchent de procréer. Pour mieux les différencier, ils ont été nommés <em>Sula nebouxii</em> et <em>Morus bassanus</em> respectivement suivant la nomenclature pour donner un nom aux espèces avec un genre (<em>Sula</em> vs <em>Morus</em>) et une épithète spécifique (<em>nebouxii</em> vs <em>bassanus</em>). C’est Carl von Linné qui a popularisé cette nomenclature binomiale Linéenne. Pas fou. Mais un peu comme ces fous, les mots aussi peuvent changer dans le temps. Il semblerait que le mot «&nbsp;évolution&nbsp;» a connu un événement de spéciation idéologique et demande une épithète pour distinguer ces nouvelles «&nbsp;espèces&nbsp;». En utilisant le même format de nomenclature Linéenne, les termes <em>évolution cosmique</em> ou <em>évolution biologique</em> semblent appropriées pour établir une distinction claire entre l’héritage étymologique et leur compréhension contemporaine. Ainsi, pour décrire l’étude de l’«&nbsp;évolution biologique&nbsp;», je propose le mot «&nbsp;évologie&nbsp;». Ce mot établit une cassure avec son ancêtre étymologique, mais garde une sonorité partagée.</p>
</section>
<section id="lévologie" class="level2">
<h2 class="anchored" data-anchor-id="lévologie">L’évologie</h2>
<p>Le mot <em>évologie</em> a envahi mon esprit et changé ma vision de l’évolution en creusant jusqu’à ses racines. Essentiellement, l’évologie, ou l’<em>étude de l’évolution biologique</em>, est le domaine d’étude qui cherche à comprendre comment l’information génétique (ou moléculaire) change à travers le temps. Autrement dit, l’évologie s’intéresse aux phénomènes de transformation de l’information qui produit de nouvelles significations distincte ou de nouvelles espèces. Et comme l’a dit Martin Nowak :</p>
<blockquote class="blockquote">
<p>Partout où l’information se reproduit, il y a évolution <span class="citation" data-cites="nowakEvolutionaryDynamicsExploring2006">(Nowak 2006)</span></p>
</blockquote>
<!-- > Wherever information reproduces, there is evolution [@nowakEvolutionaryDynamicsExploring2006] -->
<p>Si l’écologiste étudie l’écologie, et bien l’«&nbsp;évologiste&nbsp;» s’intéresse à l’«&nbsp;évologie&nbsp;». Une mutation d’une seule lettre (éco –&gt; évo) qui donne lieu à ce nouveau terme. Je dirais même que nous assistons à l’émergence de domaines hybrides. En anglais, cela s’appelle «&nbsp;évo-éco-dévo&nbsp;» pour faire référence à l’interrelation entre l’évolution, l’écologie et le développement de la vie. Peut-être un jour, nous verrons un nouvel événement de spéciation où un programme d’«&nbsp;évoécologie&nbsp;» ou autre émergera. Peut-être que ce domaine d’étude s’intéressera à comprendre comment nos actions ont des impacts dans l’environnement et qui ont, par le fait même, un effet sur le succès reproducteur (fitness) des organismes qui y vivent?</p>
<!-- Une mutation dans le mot écologie pour devenir évologie -->
<p>Dans ce cas, je fais fi de pédantisme étymologique et je me proclame un «&nbsp;évologiste&nbsp;».</p>
<!-- ### Remerciement -->
<!-- Merci aux révisions et commentaires faits par Benjamin J. Allard et Clara L. Leblanc. -->
<section id="références" class="level3">
<h3 class="anchored" data-anchor-id="références">Références</h3>
<div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0" data-line-spacing="2">
<div id="ref-evolutionAntidote2024" class="csl-entry">
Antidote 11, version 6.1.1 [Logiciel]. 2024. Article « <span>É</span>volution ». Druide informatique, Montr<span>é</span>al.
</div>
<div id="ref-coyneWhyEvolutionTrue2010" class="csl-entry">
Coyne, J. A. 2010. Why Evolution Is True. 2ᵉ éd. Oxford University Press, Oxford.
</div>
<div id="ref-Darwin:1859uh" class="csl-entry">
Darwin, C. 1859. <a href="https://en.wikisource.org/wiki/On_the_Origin_of_Species_(1859)"><span>On the origin of species by means of natural selection</span></a>. Oxford University Press; Oxford University Press, New York.
</div>
<div id="ref-gleickChaosMakingNew2008" class="csl-entry">
Gleick, J. 2008. Chaos: Making a New Science. Penguin Books, New York, N.Y.
</div>
<div id="ref-Gould:2000uo" class="csl-entry">
Gould, S. J. 2000. <a href="https://www.jstor.org/stable/j.ctt2jbt50"><span>What does the dreaded "E" word mean, anyway</span></a>. Natural History 109:28‑44.
</div>
<div id="ref-hernandezdiazBluefootedBoobySula2020" class="csl-entry">
Hernández Dı́az, J. A., et E. N. Salazar Gómez. 2020. <a href="https://doi.org/10.2173/bow.bfoboo.01">Blue-Footed <span>Booby</span> (<span>Sula</span> Nebouxii)</a>. <em>in</em> S. M. Billerman, B. K. Keeney, P. G. Rodewald, et T. S. Schulenberg, éd. Birds of the <span>World</span>. Cornell Lab of Ornithology.
</div>
<div id="ref-mccarthyHandbookAvianHybrids2006" class="csl-entry">
McCarthy, E. M. 2006. <a href="https://www.spinus.info/Images/books/AH743697479746.pdf">Handbook of Avian Hybrids of the World</a>. Oxford university press, Oxford.
</div>
<div id="ref-nowakEvolutionaryDynamicsExploring2006" class="csl-entry">
Nowak, M. A. 2006. <a href="https://www.hup.harvard.edu/books/9780674023383">Evolutionary Dynamics: Exploring the Equations of Life</a>. The Belknap Press of Harvard University Press, Cambridge, Massachusetts London, England.
</div>
<div id="ref-velandoPigmentbasedSkinColour2006" class="csl-entry">
Velando, A., R. Beamonte-Barrientos, et R. Torres. 2006. <a href="https://doi.org/10.1007/s00442-006-0457-5">Pigment-Based Skin Colour in the Blue-Footed Booby: An Honest Signal of Current Condition Used by Females to Adjust Reproductive Investment</a>. Oecologia 149:535‑542.
</div>
<div id="ref-velandoMaleColorationChick2005" class="csl-entry">
Velando, A., R. Torres, et I. Espinosa. 2005. <a href="https://doi.org/10.1007/s00265-005-0911-0">Male Coloration and Chick Condition in Blue-Footed Booby: A Cross-Fostering Experiment</a>. Behavioral Ecology and Sociobiology 58:175‑180.
</div>
</div>


</section>
</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-citation"><h2 class="anchored quarto-appendix-heading">Citation</h2><div><div class="quarto-appendix-secondary-label">BibTeX</div><pre class="sourceCode code-with-copy quarto-appendix-bibtex"><code class="sourceCode bibtex">@article{beausoleil2025,
  author = {Beausoleil, Marc-Olivier},
  title = {Qu’est-ce qui se cache sous le tapis de l’évolution?},
  journal = {Évologie},
  date = {2025-06-17},
  url = {https://evologie.netlify.app},
  doi = {10.59350/vtb1v-re509},
  langid = {fr}
}
</code></pre><div class="quarto-appendix-secondary-label">Citation : </div><div id="ref-beausoleil2025" class="csl-entry quarto-appendix-citeas">
Beausoleil, M.-O. 2025. Qu’est-ce qui se cache sous le tapis de
l’évolution? Évologie, doi: <a href="https://doi.org/10.59350/vtb1v-re509">10.59350/vtb1v-re509</a>.
</div></div></section></div> ]]></description>
  <category>histoire</category>
  <category>évologie</category>
  <category>biodiversité</category>
  <guid>https://evologie.netlify.app/posts/2025_03_11_evologie/evologie.html</guid>
  <pubDate>Tue, 17 Jun 2025 04:00:00 GMT</pubDate>
  <media:content url="https://evologie.netlify.app/posts/2025_03_11_evologie/fou_pieds_bleus_MB_2019_ban.JPG" medium="image"/>
</item>
</channel>
</rss>
