Commit 5fb5f916 authored by Roelandt nicolas's avatar Roelandt nicolas
Browse files

Merge branch 'cours_pyqgis' into 'master'

Update cours_pyqgis

See merge request !5
parents ba36a967 3e220f9e
Pipeline #384914 passed with stages
in 52 seconds
This diff is collapsed.
......@@ -124,7 +124,7 @@
\postauthor{\par}
\predate{\centering\large\emph}
\postdate{\par}
\date{2019-12-18}
\date{2019-12-17}
\usepackage{booktabs}
......@@ -1905,8 +1905,7 @@ Ajouter la méthode \emph{display\_point} à la fin de la classe.
Vous remarquez qu'il est fait référence à \emph{dlg}.
il s'agit de la boite de dialogue.
Pour récupérer sa référence, ajouter cette ligne après les lignes de traduction
dans le \texttt{def\ \_\_init\_\_}, avant le \texttt{self.action\ =\ {[}{]}}.
Pour récupérer sa référence, ajouter cette ligne après les lignes de traduction.
\begin{Shaded}
\begin{Highlighting}[]
......@@ -1936,51 +1935,11 @@ Puis cliquez n'importe où sur la carte.
\item
Créez un bouton qui copie les coordonnées dans le presse-papier quand il est cliqué. (Voir classe \emph{QClipboard} dans la documentation de Qt).
\item
Transformer \texttt{proximite.py} en plugin, fonctionnalités attendues:
\begin{itemize}
\tightlist
\item
icone personnalisée
\item
charger une couche de point d'intérêt
\item
charger une couche de superposition
\item
saisir une distance \texttt{X}
\item
calculer les éléments de la couche de superposition à distance \texttt{X} des points d'intérêts
\item
la couche doit être chargée dans le projet à l'issue du calcul
\item
sélectionner un chemin vers un fichier de sauvegarde (si vide, la couche sera conservée en mémoire)
\item
gérer les erreurs de saisie de la distance (conversion \texttt{,} -\textgreater{} `.', génération d'un message si caractère non valide)
\end{itemize}
\end{itemize}
\begin{figure}
\centering
\includegraphics{images/42_proximite_interface.png}
\caption{Exemple d'interface pour le plugin \texttt{Proximité}}
\end{figure}
\begin{itemize}
\tightlist
Transformer \texttt{proximite.py} en plugin
\item
Créer un plugin \texttt{Lieux\ propices} à partir des consignes et du code de l'exercice \ref{exercice-propice}
\end{itemize}
Vous pouvez vous inspirer des ressources suivantes:
\begin{itemize}
\tightlist
\item
\href{https://gis-ops.com/qgis-simple-plugin/}{GIS.OPS : QGIS 3 Plugins -- Plugin Development Part 1}
\item
\href{https://www.qgistutorials.com/en/docs/3/building_a_python_plugin.html}{qgistutorials.com - Building a Python Plugin (QGIS3)}
\end{itemize}
\hypertarget{rendu}{%
\chapter{Rendu}\label{rendu}}
......@@ -1997,7 +1956,7 @@ Les travaux réalisés par les élèves sont attendus.
\item
plugin \texttt{proximite}
\item
(plugin \texttt{lieux\_propices} suivant avancement)
plugin \texttt{lieux\_propices}
\end{itemize}
Le code doit être commenté et fonctionnel.
......@@ -2009,8 +1968,6 @@ Ou soit un lien vers un dépôt git.
Le lien est à envoyer par mail à \texttt{roelandtn\ (point)\ pro\ (at)\ gmail\ (point)\ com}.
Date limite de rendu : \textbf{05/01/2020}
\hypertarget{conclusion}{%
\chapter{Conclusion}\label{conclusion}}
......@@ -2027,8 +1984,7 @@ Pour une meilleure intégration et diffusion auprès des utilisateurs, le dével
d'un plugin est à envisager.
\hypertarget{pour-aller-plus-loin}{%
\section*{Pour aller plus loin}\label{pour-aller-plus-loin}}
\addcontentsline{toc}{section}{Pour aller plus loin}
\section{Pour aller plus loin}\label{pour-aller-plus-loin}}
Il existe des ressources de très bonne qualité expliquant comment créer un script
ou un plugin pyQGIS, n'héistez pas à y recourir. La documentation officielle est
......@@ -2044,10 +2000,6 @@ une bonne source d'information.
\href{https://anitagraser.com/pyqgis-101-introduction-to-qgis-python-programming-for-non-programmers/}{PyQGIS 101 : introduction to QGIS Python programming for non programmers}
\item
\href{https://locatepress.com/ppg3}{The PyQGIS Programmer's Guide}
\item
\href{https://www.qgistutorials.com/en/docs/3/building_a_python_plugin.html}{Building a Python Plugin (QGIS3)}
\item
\href{https://gis-ops.com/qgis-simple-plugin/}{GIS.OPS : QGIS 3 Plugins -- Plugin Development Part 1}
\end{itemize}
\bibliography{book.bib,packages.bib}
......
......@@ -24,7 +24,7 @@
<meta name="author" content="Nicolas Roelandt" />
<meta name="date" content="2019-12-18" />
<meta name="date" content="2019-12-17" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
......@@ -181,7 +181,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
</ul></li>
<li class="chapter" data-level="4" data-path="rendu.html"><a href="rendu.html"><i class="fa fa-check"></i><b>4</b> Rendu</a></li>
<li class="chapter" data-level="5" data-path="conclusion.html"><a href="conclusion.html"><i class="fa fa-check"></i><b>5</b> Conclusion</a><ul>
<li class="chapter" data-level="" data-path="conclusion.html"><a href="conclusion.html#pour-aller-plus-loin"><i class="fa fa-check"></i>Pour aller plus loin</a></li>
<li class="chapter" data-level="5.1" data-path="conclusion.html"><a href="conclusion.html#pour-aller-plus-loin"><i class="fa fa-check"></i><b>5.1</b> Pour aller plus loin</a></li>
</ul></li>
<li class="chapter" data-level="" data-path="references.html"><a href="references.html"><i class="fa fa-check"></i>References</a></li>
<li class="divider"></li>
......@@ -534,8 +534,7 @@ Ajouter la méthode <em>display_point</em> à la fin de la classe.</p>
<span id="cb36-8"><a href="creer-un-plugin.html#cb36-8"></a> <span class="va">self</span>.dlg.show() <span class="co"># affiche de nouveau la boite de dialogue</span></span></code></pre></div>
<p>Vous remarquez qu’il est fait référence à <em>dlg</em>.
il s’agit de la boite de dialogue.
Pour récupérer sa référence, ajouter cette ligne après les lignes de traduction
dans le <code>def __init__</code>, avant le <code>self.action = []</code>.</p>
Pour récupérer sa référence, ajouter cette ligne après les lignes de traduction.</p>
<div class="sourceCode" id="cb37"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb37-1"><a href="creer-un-plugin.html#cb37-1"></a> <span class="co"># Creer la boite de dialoge (après les traductions)</span></span>
<span id="cb37-2"><a href="creer-un-plugin.html#cb37-2"></a> <span class="va">self</span>.dlg <span class="op">=</span> OuSuisJeDialog()</span></code></pre></div>
<p>Copier le plugin dans le répertoire de QGIS et rechargez le avec Plugin Reloader.
......@@ -553,30 +552,9 @@ Puis cliquez n’importe où sur la carte.</p>
<li>Changer l’icone pour une icone mieux adaptée (pensez à recompiler les ressources)</li>
<li>Afficher les coordonnées avec seulement 3 décimales</li>
<li>Créez un bouton qui copie les coordonnées dans le presse-papier quand il est cliqué. (Voir classe <em>QClipboard</em> dans la documentation de Qt).</li>
<li>Transformer <code>proximite.py</code> en plugin, fonctionnalités attendues:
<ul>
<li>icone personnalisée</li>
<li>charger une couche de point d’intérêt</li>
<li>charger une couche de superposition</li>
<li>saisir une distance <code>X</code></li>
<li>calculer les éléments de la couche de superposition à distance <code>X</code> des points d’intérêts</li>
<li>la couche doit être chargée dans le projet à l’issue du calcul</li>
<li>sélectionner un chemin vers un fichier de sauvegarde (si vide, la couche sera conservée en mémoire)</li>
<li>gérer les erreurs de saisie de la distance (conversion <code>,</code> -&gt; ‘.’, génération d’un message si caractère non valide)</li>
</ul></li>
</ul>
<div class="figure">
<img src="images/42_proximite_interface.png" alt="" />
<p class="caption">Exemple d’interface pour le plugin <code>Proximité</code></p>
</div>
<ul>
<li>Transformer <code>proximite.py</code> en plugin</li>
<li>Créer un plugin <code>Lieux propices</code> à partir des consignes et du code de l’exercice <a href="scripts-python.html#exercice-propice">2.4.4</a></li>
</ul>
<p>Vous pouvez vous inspirer des ressources suivantes:</p>
<ul>
<li><a href="https://gis-ops.com/qgis-simple-plugin/">GIS.OPS : QGIS 3 Plugins – Plugin Development Part 1</a></li>
<li><a href="https://www.qgistutorials.com/en/docs/3/building_a_python_plugin.html">qgistutorials.com - Building a Python Plugin (QGIS3)</a></li>
</ul>
</div>
</div>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
div.sourceCode {
position: relative;
}
.copy-to-clipboard-button {
position: absolute;
right: 0;
top: 0;
visibility: hidden;
}
.copy-to-clipboard-button:focus {
outline: 0;
}
div.sourceCode:hover > .copy-to-clipboard-button {
visibility: visible;
}
/*!
* clipboard.js v2.0.4
* https://zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(n){var o={};function r(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=n,r.c=o,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}}(),a=o(n(1)),c=o(n(3)),u=o(n(4));function o(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function o(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));return n.resolveOptions(e),n.listenClick(t),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,c.default),i(o,[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===r(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,u.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new a.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return s("action",t)}},{key:"defaultTarget",value:function(t){var e=s("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return s("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),o}();function s(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}t.exports=l},function(t,e,n){"use strict";var o,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}}(),a=n(2),c=(o=a)&&o.__esModule?o:{default:o};var u=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}return i(e,[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,c.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,c.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),e}();t.exports=u},function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,a=o.length;i<a;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=n},function(t,e,n){var d=n(5),h=n(6);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!d.string(e))throw new TypeError("Second argument must be a String");if(!d.fn(n))throw new TypeError("Third argument must be a Function");if(d.node(t))return s=e,f=n,(l=t).addEventListener(s,f),{destroy:function(){l.removeEventListener(s,f)}};if(d.nodeList(t))return a=t,c=e,u=n,Array.prototype.forEach.call(a,function(t){t.addEventListener(c,u)}),{destroy:function(){Array.prototype.forEach.call(a,function(t){t.removeEventListener(c,u)})}};if(d.string(t))return o=t,r=e,i=n,h(document.body,o,r,i);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,a,c,u,l,s,f}},function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e,n){var a=n(7);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=a(t.target,n),t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r)}}}t.exports=function(t,e,n,o,r){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,o,r)}))}},function(t,e){if("undefined"!=typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}}])});
......@@ -28,6 +28,18 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
}
});
// add the View button (file view on Github)
var view = config.view;
if (view && view.link) gitbook.toolbar.createButton({
icon: 'fa fa-eye',
label: view.text || 'View Source',
position: 'left',
onClick: function(e) {
e.preventDefault();
window.open(view.link);
}
});
// add the Download button
var down = config.download;
var normalizeDownload = function() {
......@@ -72,7 +84,7 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
if (config.search !== false) info.push('f: Toggle search input ' +
'(use <up>/<down>/Enter in the search input to navigate through search matches; ' +
'press Esc to cancel search)');
gitbook.toolbar.createButton({
if (config.info !== false) gitbook.toolbar.createButton({
icon: 'fa fa-info',
label: 'Information about the toolbar',
position: 'left',
......@@ -85,6 +97,8 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
// highlight the current section in TOC
var href = window.location.pathname;
href = href.substr(href.lastIndexOf('/') + 1);
// accentuated characters need to be decoded (#819)
href = decodeURIComponent(href);
if (href === '') href = 'index.html';
var li = $('a[href^="' + href + location.hash + '"]').parent('li.chapter').first();
var summary = $('ul.summary'), chaps = summary.find('li.chapter');
......
gitbook.require(["gitbook", "jQuery"], function(gitbook, $) {
var copyButton = '<button type="button" class="copy-to-clipboard-button" title="Copy to clipboard" aria-label="Copy to clipboard"><i class="fa fa-copy"></i></button>';
var clipboard;
gitbook.events.bind("page.change", function() {
if (!ClipboardJS.isSupported()) return;
// the page.change event is thrown twice: before and after the page changes
if (clipboard) {
// clipboard is already defined
// we can deduct that we are before page changes
clipboard.destroy(); // destroy the previous events listeners
clipboard = undefined; // reset the clipboard object
return;
}
$(copyButton).prependTo("div.sourceCode");
clipboard = new ClipboardJS(".copy-to-clipboard-button", {
text: function(trigger) {
return trigger.parentNode.textContent;
}
});
});
});
......@@ -96,7 +96,8 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
gitbook.events.bind("start", function(e, config) {
var opts = config.fontsettings;
if (!opts) return;
// Create buttons in toolbar
gitbook.toolbar.createButton({
icon: 'fa fa-font',
......
......@@ -15,7 +15,7 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
'icon': 'fa fa-facebook',
'onClick': function(e) {
e.preventDefault();
window.open("http://www.facebook.com/sharer/sharer.php?s=100&p[url]="+encodeURIComponent(location.href));
window.open("http://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(location.href));
}
},
'twitter': {
......@@ -23,15 +23,7 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
'icon': 'fa fa-twitter',
'onClick': function(e) {
e.preventDefault();
window.open("http://twitter.com/home?status="+encodeURIComponent(document.title+" "+location.href));
}
},
'google': {
'label': 'Google+',
'icon': 'fa fa-google-plus',
'onClick': function(e) {
e.preventDefault();
window.open("https://plus.google.com/share?url="+encodeURIComponent(location.href));
window.open("http://twitter.com/intent/tweet?text="+document.title+"&url="+encodeURIComponent(location.href)+"&hashtags=rmarkdown,bookdown");
}
},
'linkedin': {
......@@ -52,7 +44,7 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
},
'instapaper': {
'label': 'Instapaper',
'icon': 'fa fa-instapaper',
'icon': 'fa fa-italic',
'onClick': function(e) {
e.preventDefault();
window.open("http://www.instapaper.com/text?u="+encodeURIComponent(location.href));
......@@ -78,7 +70,7 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
var menu = _.chain(opts.all)
.map(function(id) {
var site = SITES[id];
if (!site) return;
return {
text: site.label,
onClick: site.onClick
......
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<html lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>References | Introduction à pyQGIS</title>
<meta name="description" content="Ce cours d’introduction à l’utilisation de python dans le logiciel QGIS. Il est destiné à des élèves de l’École Nationale des Sciences Géographiques" />
<meta name="generator" content="bookdown 0.13 and GitBook 2.6.7" />
<meta name="generator" content="bookdown 0.19 and GitBook 2.6.7" />
<meta property="og:title" content="References | Introduction à pyQGIS" />
<meta property="og:type" content="book" />
......@@ -24,7 +24,7 @@
<meta name="author" content="Nicolas Roelandt" />
<meta name="date" content="2019-12-18" />
<meta name="date" content="2021-01-31" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
......@@ -40,6 +40,9 @@
<link href="libs/gitbook-2.6.7/css/plugin-highlight.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-search.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-fontsettings.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-clipboard.css" rel="stylesheet" />
......@@ -50,9 +53,9 @@
<style type="text/css">
code.sourceCode > span { display: inline-block; line-height: 1.25; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
code.sourceCode > span:empty { height: 1.2em; }
a.sourceLine { display: inline-block; line-height: 1.25; }
a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }
a.sourceLine:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode { white-space: pre; position: relative; }
pre.sourceCode { margin: 0; }
......@@ -61,16 +64,14 @@ div.sourceCode { overflow: auto; }
}
@media print {
code.sourceCode { white-space: pre-wrap; }
code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
a.sourceLine { text-indent: -1em; padding-left: 1em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
pre.numberSource a.sourceLine
{ position: relative; left: -4em; }
pre.numberSource a.sourceLine::before
{ content: attr(data-line-number);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
border: none; pointer-events: all; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
......@@ -79,9 +80,9 @@ pre.numberSource code > span > a:first-child::before
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
{ }
@media screen {
code.sourceCode > span > a:first-child::before { text-decoration: underline; }
a.sourceLine::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
......@@ -131,57 +132,59 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<li class="divider"></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html"><i class="fa fa-check"></i>A propos</a><ul>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#prerequis"><i class="fa fa-check"></i>Prérequis</a></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#donnees-utilisees"><i class="fa fa-check"></i>Données utilisées</a></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#generation-du-document"><i class="fa fa-check"></i>Génération du document</a></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#prérequis"><i class="fa fa-check"></i>Prérequis</a></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#données-utilisées"><i class="fa fa-check"></i>Données utilisées</a></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#génération-du-document"><i class="fa fa-check"></i>Génération du document</a></li>
</ul></li>
<li class="chapter" data-level="" data-path="introduction.html"><a href="introduction.html"><i class="fa fa-check"></i>Introduction</a></li>
<li class="chapter" data-level="1" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html"><i class="fa fa-check"></i><b>1</b> Utiliser la console python</a><ul>
<li class="chapter" data-level="1.1" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#lancer-la-console"><i class="fa fa-check"></i><b>1.1</b> Lancer la console</a></li>
<li class="chapter" data-level="1.2" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#charger-une-couche"><i class="fa fa-check"></i><b>1.2</b> Charger une couche</a></li>
<li class="chapter" data-level="1.3" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#visualiser-les-donnees"><i class="fa fa-check"></i><b>1.3</b> Visualiser les données</a><ul>
<li class="chapter" data-level="1.3" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#visualiser-les-données"><i class="fa fa-check"></i><b>1.3</b> Visualiser les données</a><ul>
<li class="chapter" data-level="1.3.1" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#afficher-la-table-attributaire"><i class="fa fa-check"></i><b>1.3.1</b> Afficher la table attributaire</a></li>
<li class="chapter" data-level="1.3.2" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#afficher-le-nom-des-champs"><i class="fa fa-check"></i><b>1.3.2</b> Afficher le nom des champs</a></li>
<li class="chapter" data-level="1.3.3" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#afficher-des-donnees"><i class="fa fa-check"></i><b>1.3.3</b> Afficher des données</a></li>
<li class="chapter" data-level="1.3.3" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#afficher-des-données"><i class="fa fa-check"></i><b>1.3.3</b> Afficher des données</a></li>
</ul></li>
<li class="chapter" data-level="1.4" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#exercices"><i class="fa fa-check"></i><b>1.4</b> Exercices</a></li>
<li class="chapter" data-level="1.5" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#realiser-un-geotraitement"><i class="fa fa-check"></i><b>1.5</b> Réaliser un géotraitement</a></li>
<li class="chapter" data-level="1.4" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#exercice"><i class="fa fa-check"></i><b>1.4</b> Exercice</a></li>
<li class="chapter" data-level="1.5" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#réaliser-un-géotraitement"><i class="fa fa-check"></i><b>1.5</b> Réaliser un géotraitement</a></li>
<li class="chapter" data-level="1.6" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#historique-des-traitements"><i class="fa fa-check"></i><b>1.6</b> Historique des traitements</a></li>
<li class="chapter" data-level="1.7" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#exercices-1"><i class="fa fa-check"></i><b>1.7</b> Exercices</a></li>
<li class="chapter" data-level="1.8" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#recuperer-la-sortie"><i class="fa fa-check"></i><b>1.8</b> Récupérer la sortie</a></li>
<li class="chapter" data-level="1.9" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#exercice"><i class="fa fa-check"></i><b>1.9</b> Exercice</a></li>
<li class="chapter" data-level="1.7" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#exercices"><i class="fa fa-check"></i><b>1.7</b> Exercices</a></li>
<li class="chapter" data-level="1.8" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#récupérer-la-sortie"><i class="fa fa-check"></i><b>1.8</b> Récupérer la sortie</a></li>
<li class="chapter" data-level="1.9" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#exercice-1"><i class="fa fa-check"></i><b>1.9</b> Exercice</a></li>
<li class="chapter" data-level="1.10" data-path="utiliser-la-console-python.html"><a href="utiliser-la-console-python.html#conclusion-sur-lutilisation-de-la-console-python-de-qgis"><i class="fa fa-check"></i><b>1.10</b> Conclusion sur l’utilisation de la console Python de QGIS</a></li>
</ul></li>
<li class="chapter" data-level="2" data-path="scripts-python.html"><a href="scripts-python.html"><i class="fa fa-check"></i><b>2</b> Scripts python</a><ul>
<li class="chapter" data-level="2.1" data-path="scripts-python.html"><a href="scripts-python.html#scripter-ses-traitements"><i class="fa fa-check"></i><b>2.1</b> Scripter ses traitements</a></li>
<li class="chapter" data-level="2.2" data-path="scripts-python.html"><a href="scripts-python.html#creation-dun-script-simple"><i class="fa fa-check"></i><b>2.2</b> Création d’un script simple</a><ul>
<li class="chapter" data-level="2.2.1" data-path="scripts-python.html"><a href="scripts-python.html#importation-des-bibliotheques"><i class="fa fa-check"></i><b>2.2.1</b> Importation des bibliothèques</a></li>
<li class="chapter" data-level="2.2.2" data-path="scripts-python.html"><a href="scripts-python.html#chargement-des-donnees"><i class="fa fa-check"></i><b>2.2.2</b> Chargement des données</a></li>
<li class="chapter" data-level="2.2.3" data-path="scripts-python.html"><a href="scripts-python.html#controle-des-projections"><i class="fa fa-check"></i><b>2.2.3</b> Contrôle des projections</a></li>
<li class="chapter" data-level="2.2" data-path="scripts-python.html"><a href="scripts-python.html#création-dun-script-simple"><i class="fa fa-check"></i><b>2.2</b> Création d’un script simple</a><ul>
<li class="chapter" data-level="2.2.1" data-path="scripts-python.html"><a href="scripts-python.html#importation-des-bibliothèques"><i class="fa fa-check"></i><b>2.2.1</b> Importation des bibliothèques</a></li>
<li class="chapter" data-level="2.2.2" data-path="scripts-python.html"><a href="scripts-python.html#chargement-des-données"><i class="fa fa-check"></i><b>2.2.2</b> Chargement des données</a></li>
<li class="chapter" data-level="2.2.3" data-path="scripts-python.html"><a href="scripts-python.html#contrôle-des-projections"><i class="fa fa-check"></i><b>2.2.3</b> Contrôle des projections</a></li>
<li class="chapter" data-level="2.2.4" data-path="scripts-python.html"><a href="scripts-python.html#extraction-de-la-gare-de-la-part-dieu"><i class="fa fa-check"></i><b>2.2.4</b> Extraction de la gare de la Part-Dieu</a></li>
<li class="chapter" data-level="2.2.5" data-path="scripts-python.html"><a href="scripts-python.html#creation-de-la-zone-tampon"><i class="fa fa-check"></i><b>2.2.5</b> Création de la zone tampon</a></li>
<li class="chapter" data-level="2.2.5" data-path="scripts-python.html"><a href="scripts-python.html#création-de-la-zone-tampon"><i class="fa fa-check"></i><b>2.2.5</b> Création de la zone tampon</a></li>
<li class="chapter" data-level="2.2.6" data-path="scripts-python.html"><a href="scripts-python.html#renommer-la-couche-finale"><i class="fa fa-check"></i><b>2.2.6</b> Renommer la couche finale</a></li>
<li class="chapter" data-level="2.2.7" data-path="scripts-python.html"><a href="scripts-python.html#sauvegarde-de-la-couche"><i class="fa fa-check"></i><b>2.2.7</b> Sauvegarde de la couche</a></li>
</ul></li>
<li class="chapter" data-level="2.3" data-path="scripts-python.html"><a href="scripts-python.html#exercice-1"><i class="fa fa-check"></i><b>2.3</b> Exercice</a></li>
<li class="chapter" data-level="2.4" data-path="scripts-python.html"><a href="scripts-python.html#creer-un-script-pouvant-etre-appele-depuis-le-boite-a-outils"><i class="fa fa-check"></i><b>2.4</b> Créer un script pouvant être appelé depuis le boite à outils</a><ul>
<li class="chapter" data-level="2.3" data-path="scripts-python.html"><a href="scripts-python.html#exercice-2"><i class="fa fa-check"></i><b>2.3</b> Exercice</a></li>
<li class="chapter" data-level="2.4" data-path="scripts-python.html"><a href="scripts-python.html#créer-un-script-pouvant-être-appelé-depuis-le-boite-à-outils"><i class="fa fa-check"></i><b>2.4</b> Créer un script pouvant être appelé depuis le boite à outils</a><ul>
<li class="chapter" data-level="2.4.1" data-path="scripts-python.html"><a href="scripts-python.html#modification-du-script"><i class="fa fa-check"></i><b>2.4.1</b> Modification du script</a></li>
<li class="chapter" data-level="2.4.2" data-path="scripts-python.html"><a href="scripts-python.html#test-du-script"><i class="fa fa-check"></i><b>2.4.2</b> Test du script</a></li>
<li class="chapter" data-level="2.4.3" data-path="scripts-python.html"><a href="scripts-python.html#ajout-du-script-dans-la-boite-a-outils"><i class="fa fa-check"></i><b>2.4.3</b> Ajout du script dans la boite à outils</a></li>
<li class="chapter" data-level="2.4.3" data-path="scripts-python.html"><a href="scripts-python.html#ajout-du-script-dans-la-boite-à-outils"><i class="fa fa-check"></i><b>2.4.3</b> Ajout du script dans la boite à outils</a></li>
<li class="chapter" data-level="2.4.4" data-path="scripts-python.html"><a href="scripts-python.html#exercice-propice"><i class="fa fa-check"></i><b>2.4.4</b> Exercice</a></li>
</ul></li>
<li class="chapter" data-level="2.5" data-path="scripts-python.html"><a href="scripts-python.html#depuis-le-modeleur"><i class="fa fa-check"></i><b>2.5</b> Depuis le modeleur</a></li>
</ul></li>
<li class="chapter" data-level="3" data-path="creer-un-plugin.html"><a href="creer-un-plugin.html"><i class="fa fa-check"></i><b>3</b> Créer un plugin</a><ul>
<li class="chapter" data-level="3.1" data-path="creer-un-plugin.html"><a href="creer-un-plugin.html#plugins"><i class="fa fa-check"></i><b>3.1</b> Plugins</a></li>
<li class="chapter" data-level="3.2" data-path="creer-un-plugin.html"><a href="creer-un-plugin.html#creer-un-plugin-simple"><i class="fa fa-check"></i><b>3.2</b> Créer un plugin simple</a><ul>
<li class="chapter" data-level="3.2.1" data-path="creer-un-plugin.html"><a href="creer-un-plugin.html#creer-une-base-de-depart"><i class="fa fa-check"></i><b>3.2.1</b> Créer une base de départ</a></li>
<li class="chapter" data-level="3.2.2" data-path="creer-un-plugin.html"><a href="creer-un-plugin.html#implementation-du-code-python"><i class="fa fa-check"></i><b>3.2.2</b> Implémentation du code Python</a></li>
<li class="chapter" data-level="3" data-path="créer-un-plugin.html"><a href="créer-un-plugin.html"><i class="fa fa-check"></i><b>3</b> Créer un plugin</a><ul>
<li class="chapter" data-level="3.1" data-path="créer-un-plugin.html"><a href="créer-un-plugin.html#plugins"><i class="fa fa-check"></i><b>3.1</b> Plugins</a></li>
<li class="chapter" data-level="3.2" data-path="créer-un-plugin.html"><a href="créer-un-plugin.html#créer-un-plugin-simple"><i class="fa fa-check"></i><b>3.2</b> Créer un plugin simple</a><ul>
<li class="chapter" data-level="3.2.1" data-path="créer-un-plugin.html"><a href="créer-un-plugin.html#créer-une-base-de-départ"><i class="fa fa-check"></i><b>3.2.1</b> Créer une base de départ</a></li>
<li class="chapter" data-level="3.2.2" data-path="créer-un-plugin.html"><a href="créer-un-plugin.html#modification-de-linterface"><i class="fa fa-check"></i><b>3.2.2</b> Modification de l’interface</a></li>
<li class="chapter" data-level="3.2.3" data-path="créer-un-plugin.html"><a href="créer-un-plugin.html#implémentation-du-code-python"><i class="fa fa-check"></i><b>3.2.3</b> Implémentation du code Python</a></li>
</ul></li>
<li class="chapter" data-level="3.3" data-path="creer-un-plugin.html"><a href="creer-un-plugin.html#exercice-plugin"><i class="fa fa-check"></i><b>3.3</b> Exercice</a></li>
<li class="chapter" data-level="3.3" data-path="créer-un-plugin.html"><a href="créer-un-plugin.html#exercice-plugin"><i class="fa fa-check"></i><b>3.3</b> Exercice</a></li>
</ul></li>
<li class="chapter" data-level="4" data-path="rendu.html"><a href="rendu.html"><i class="fa fa-check"></i><b>4</b> Rendu</a></li>
<li class="chapter" data-level="4" data-path="évaluation.html"><a href="évaluation.html"><i class="fa fa-check"></i><b>4</b> Évaluation</a></li>
<li class="chapter" data-level="5" data-path="conclusion.html"><a href="conclusion.html"><i class="fa fa-check"></i><b>5</b> Conclusion</a><ul>
<li class="chapter" data-level="" data-path="conclusion.html"><a href="conclusion.html#pour-aller-plus-loin"><i class="fa fa-check"></i>Pour aller plus loin</a></li>
<li class="chapter" data-level="5.1" data-path="conclusion.html"><a href="conclusion.html#pour-aller-plus-loin"><i class="fa fa-check"></i><b>5.1</b> Pour aller plus loin</a></li>
</ul></li>
<li class="chapter" data-level="" data-path="references.html"><a href="references.html"><i class="fa fa-check"></i>References</a></li>
<li class="divider"></li>
......@@ -219,11 +222,13 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
</div>
<script src="libs/gitbook-2.6.7/js/app.min.js"></script>
<script src="libs/gitbook-2.6.7/js/lunr.js"></script>
<script src="libs/gitbook-2.6.7/js/clipboard.min.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-search.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-sharing.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-fontsettings.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-bookdown.js"></script>
<script src="libs/gitbook-2.6.7/js/jquery.highlight.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-clipboard.js"></script>
<script>
gitbook.require(["gitbook"], function(gitbook) {
gitbook.start({
......@@ -231,12 +236,11 @@ gitbook.start({
"github": false,
"facebook": true,
"twitter": true,
"google": false,
"linkedin": false,
"weibo": false,