forked from prog-geo/prog-geo.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qgis.html
189 lines (174 loc) · 12.2 KB
/
qgis.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<!DOCTYPE html>
<html class="writer-html5" lang="pt-BR" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>6. Programando com o QGIS — SER-347/CAP-419</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/copybutton.css" type="text/css" />
<link rel="stylesheet" href="_static/tabs.css" type="text/css" />
<link rel="stylesheet" href="_static/table_styling.css" type="text/css" />
<link rel="stylesheet" href="_static/prog-geo.css" type="text/css" />
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="canonical" href="https://prog-geo.github.io/qgis.html" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/clipboard.min.js"></script>
<script src="_static/copybutton.js"></script>
<script src="_static/translations.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Índice" href="genindex.html" />
<link rel="search" title="Buscar" href="search.html" />
<link rel="next" title="6.1. Preparação do Ambiente de Programação" href="qgis/preparacao-ambiente.html" />
<link rel="prev" title="5.7. Pandas" href="vetorial/pandas.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" style="background: #2980B9" >
<a href="index.html" class="icon icon-home"> SER-347/CAP-419
<img src="_static/logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Pesquisar documentos" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Menu de navegação">
<ul>
<li class="toctree-l1"><a class="reference internal" href="index.html">Introdução à Programação com Dados Geoespaciais</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Visão Geral do Curso:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="visao-geral.html">Visão Geral do Curso</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Aulas:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="instalacao.html">1. Instalando e Configurando o Ambiente de Programação</a></li>
<li class="toctree-l1"><a class="reference internal" href="introducao-programacao/index.html">2. Introdução à Programação com a Linguagem Python</a></li>
<li class="toctree-l1"><a class="reference internal" href="jupyter.html">3. Jupyter</a></li>
<li class="toctree-l1"><a class="reference internal" href="imagens.html">4. Imagens - Processamento e Visualização</a></li>
<li class="toctree-l1"><a class="reference internal" href="vetorial.html">5. Manipulação de Dados Vetoriais</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">6. Programando com o QGIS</a><ul>
<li class="toctree-l2"><a class="reference internal" href="qgis/preparacao-ambiente.html">6.1. Preparação do Ambiente de Programação</a></li>
<li class="toctree-l2"><a class="reference internal" href="qgis/python-console.html">6.2. Console Python no QGIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="qgis/criando-plugins.html">6.3. Construindo Plugins para o QGIS em Python</a></li>
<li class="toctree-l2"><a class="reference internal" href="qgis/plugin-debug.html">6.4. Preparando o Ambiente para Inspeção do Código de um Plugin</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="variados.html">7. Tópicos Variados</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Referências Bibliográficas</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="referencias.html">Referências Bibliográficas</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Listas de Exercícios:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="listas.html">Listas de Exercícios</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Lista de Projetos:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="projetos/2022/index.html">Turma 2022</a></li>
<li class="toctree-l1"><a class="reference internal" href="projetos/2021/index.html">Turma 2021</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Informações Gerais:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="licenca.html">Licença</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Agradecimentos:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="agradecimentos.html">Agradecimentos</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Menu de navegação móvel" style="background: #2980B9" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">SER-347/CAP-419</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content style-external-links">
<div role="navigation" aria-label="Navegação da página">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home"></a> »</li>
<li><span class="section-number">6. </span>Programando com o QGIS</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul><div class="rst-breadcrumbs-buttons" role="navigation" aria-label="Navegação sequencial da página">
<a href="vetorial/pandas.html" class="btn btn-neutral float-left" title="5.7. Pandas" accesskey="p"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Anterior</a>
<a href="qgis/preparacao-ambiente.html" class="btn btn-neutral float-right" title="6.1. Preparação do Ambiente de Programação" accesskey="n">Próximo <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="programando-com-o-qgis">
<span id="cap-qgis"></span><h1><span class="section-number">6. </span>Programando com o QGIS<a class="headerlink" href="#programando-com-o-qgis" title="Link permanente para este título"></a></h1>
<a class="reference internal image-reference" href="_images/qgis.svg"><img alt="QGIS" class="align-right" src="_images/qgis.svg" width="128" /></a>
<p>O aplicativo geográfico <a class="reference external" href="https://qgis.org/">QGIS</a> possui uma forte integração com a linguagem Python, permitindo utilizá-la de diversas maneiras. O console Python, disponível de dentro da interface gráfica do QGIS (<a class="reference internal" href="#fig-qgis-console-python-active-layer"><span class="std std-numref">Figura 6.1</span></a>), permite que o usuário entre com comandos válidos da linguagem Python.</p>
<div class="align-center figure align-default" id="fig-qgis-console-python-active-layer">
<a class="reference internal image-reference" href="_images/console-python-active-layer.png"><img alt="Console do Python dentro da interface gráfica do QGIS" src="_images/console-python-active-layer.png" style="width: 100%;" /></a>
<p class="caption"><span class="caption-number">Figura 6.1 - </span><span class="caption-text">Console do Python dentro da interface gráfica do QGIS.</span><a class="headerlink" href="#fig-qgis-console-python-active-layer" title="Link Permanente para essa imagem"></a></p>
</div>
<p>Também é possível criar <em>scripts</em> que utilizam a API do QGIS em Python para automação de tarefas tanto na inicialização do QGIS quanto para realização de processamentos em lote, como mostrado na <a class="reference internal" href="#fig-qgis-python-script-list-layers"><span class="std std-numref">Figura 6.2</span></a>.</p>
<div class="align-center figure align-default" id="fig-qgis-python-script-list-layers">
<a class="reference internal image-reference" href="_images/python-script-list-layers.png"><img alt="API do QGIS em Python para automação de tarefas" src="_images/python-script-list-layers.png" style="width: 100%;" /></a>
<p class="caption"><span class="caption-number">Figura 6.2 - </span><span class="caption-text">API do QGIS em Python para automação de tarefas.</span><a class="headerlink" href="#fig-qgis-python-script-list-layers" title="Link Permanente para essa imagem"></a></p>
</div>
<p>Por último, é possível estender as funcionalidades do QGIS através da criação de novos <em>plugins</em> escritos na linguagem Python. O <strong>plugin Web Land Trajectory Service</strong> (WLTS), mostrado na <a class="reference internal" href="#fig-qgis-plugin-wlts"><span class="std std-numref">Figura 6.3</span></a>, é desenvolvido nessa linguagem e acrescenta ao QGIS funcionalidades para extração de trajetórias a partir de conjuntos de dados de uso e cobertura da Terra.</p>
<div class="align-center figure align-default" id="fig-qgis-plugin-wlts">
<a class="reference internal image-reference" href="_images/plugin-wlts.png"><img alt="Janela do plugin WLTS" src="_images/plugin-wlts.png" style="width: 100%;" /></a>
<p class="caption"><span class="caption-number">Figura 6.3 - </span><span class="caption-text">Janela do plugin WLTS.</span><a class="headerlink" href="#fig-qgis-plugin-wlts" title="Link Permanente para essa imagem"></a></p>
</div>
<p>Este capítulo irá apresentar algumas maneiras de utilizar a linguagem Python em conjunto com o aplicativo QGIS.</p>
<div class="toctree-wrapper compound">
<p class="caption" role="heading"><span class="caption-text">Tópicos</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="qgis/preparacao-ambiente.html">6.1. Preparação do Ambiente de Programação</a></li>
<li class="toctree-l1"><a class="reference internal" href="qgis/python-console.html">6.2. Console Python no QGIS</a></li>
<li class="toctree-l1"><a class="reference internal" href="qgis/criando-plugins.html">6.3. Construindo Plugins para o QGIS em Python</a></li>
<li class="toctree-l1"><a class="reference internal" href="qgis/plugin-debug.html">6.4. Preparando o Ambiente para Inspeção do Código de um Plugin</a></li>
</ul>
</div>
</div>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Rodapé">
<a href="vetorial/pandas.html" class="btn btn-neutral float-left" title="5.7. Pandas" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Anterior</a>
<a href="qgis/preparacao-ambiente.html" class="btn btn-neutral float-right" title="6.1. Preparação do Ambiente de Programação" accesskey="n" rel="next">Próximo <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2020-2022, Gilberto Queiroz and Thales Körting.</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(false);
});
</script>
<!-- Theme Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-165908761-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-165908761-1', {
'anonymize_ip': false,
});
</script>
</body>
</html>