EditorTabelas.html
13.3 KB
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<!DOCTYPE html>
<html><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<meta charset="UTF-8">
<title>Editando tabelas de um banco de dados</title>
<link media="screen" href="./files/estilos.css" type="text/css" rel="stylesheet">
<!--[if lt IE 10]>
<![endif]-->
<link rel="stylesheet" type="text/css" href="./files/estilos.css">
</head><body class="blue-bg">
<div id="wrapper-flex">
<div style="background-color: white;">
<div class="f-page-auto-cell" id="doc">
<div class="imginicio"><img onclick="window.history.back()" style="border: 0px solid ; width: 40px; height: 40px;" alt="inicio" src="files/inicio.gif"></div>
<h1>Edição de tabelas PostgreSQL pelo i3GeoSaúde<span style="color: rgb(51, 51, 51); font-family: Verdana,Helvetica,Arial; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(255, 255, 255); display: inline ! important; float: none;">
<br>
</span></h1>
<a name="inicio"></a>
<br>
<p class="MsoNormal">A edição de tabelas de um banco de dados é
fundamental para
a implementação de variáveis no
i3GeoSaúde. Isso
permite a
manipulação dos dados para uma
análise mais clara do que se quer avaliar.<o:p></o:p></p>
<p class="MsoNormal">Com
isso, por meio do i3GeoSaúde é possível criar e manipular tabelas de
dados no Sistema Gerenciador de Banco de Dados <span style="font-style: italic;">PostgreSQL</span>, as quais
poderão ser analisadas pelo i3GeoSaúde, onde
serão
aplicados em um mapa, por
meio do software i3geo. <span style="">Também é possível a criação de
dados espaciais por meio do upload de arquivos shapefiles ou CSV
contendo coordenadas, se utilizando da extensão espacial PostGIS para o
PostgreSQL. </span><o:p></o:p></p>
<p class="MsoNormal">A
seguir será detalhado os procedimentos para edição e manipulação de
dados em um banco de dados PostgreSQL por meio do i3GeoSaúde.<span style="background: white url(none) repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black;"><o:p><br>
</o:p></span></p>
<p class="MsoNormal">
Observação: Consideraremos que
já foi instalado o<span style="font-style: italic;"> PostgresSQL
9.1</span> e sua extensão
<span style="font-style: italic;">Postgis
1.5</span>.<span style="color: black;"></span><span style="background: white url(none) repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-size: 9pt; color: black;"> </span><br>
<span style="background: white url(none) repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black;"><o:p><br>
</o:p></span></p>
<div class="trail-box">
<div class="trail-box-header"><img src="files/trails-box-tr.png" class="right" alt="" height="21" width="7"><img src="files/trails-box-tl.png" class="left" alt="" height="21" width="7"><comment title=" here is the box header " xmlns="http://disruptive-innovations.com/zoo/nvu"></comment>
<h1><span style="font-weight: bold;"><a name="1criacao"></a>1
-
Criação de uma tabela a partir de um shapefile</span>
</h1>
</div>
<div class="trail-box-content">
<p class="MsoNormal" style="margin-bottom: 0.0001pt;">Para ter acesso
ao gerenciador de tabelas do i3GeoSaúde, acesse o menu de administração
e selecione a opção "Gerenciador de tabelas de dados estatísticos
(upload de SHP e CSV)" na linha "Enviar arquivo para o servidor",
conforme a <span style="font-weight: bold;">Figura
1</span>.
</p>
<br>
<img src="imagens/Tutoria1-imagens/figura1.png" style="width: 254px; height: 264px;" alt=""><br>
<span style="font-weight: bold;">Figura
1</span>: Acessando o gerenciador de tabelas.<br>
<br>
<br>
Em seguida, escolha o banco "i3geosaude" e o esquema "i3geo_metaestat",
conforme a figura <span style="font-weight: bold;">Figura
2</span>.<br>
<br>
<img src="imagens/Tutoria1-imagens/figura2.png" style="width: 623px; height: 289px;" alt="">
<br>
<span style="font-weight: bold;">Figura
2</span>: Definindo o banco de dados e o esquema a ser criada a tabela.<br>
<br>
É possível criar uma tabela fazendo o upload de um arquivo Shapefile
(extensões obrigatórias: ".shp"; ".shx" e; ".dbf"), um arquivo CSV ou
ainda criando uma tabela nova manualmente.<br>
<br>
Para criar uma tabela por meio de um arquivo shapefile escolha a opção
"Upload Shapefile". Selecione a localização dos arquivos ".shp", ".shx"
e ".dbf". Depois, insira o nome da tabela a ser criada ou escolha na
lista uma tabela já existente. Caso a tabela já exista, informe em
seguida se você quer adicionar os dados do shapefile à tabela já
existente ou apagar os dados existentes e incluir o SHP. Se for uma
tabela nova, escolha a opção "Criar a tabela nova e incluir registros
do SHP". Em seguida, informe o código SRID da projeção geográfica do
arquivo que você está inserindo e marque a opção se quiser criar uma
coluna "gid" para ser utilizado como código único do registro. Por fim,
clique em enviar.<br>
<br>
<img src="imagens/Tutoria1-imagens/figura3.png" style="width: 782px; height: 556px;" alt=""><br>
<span style="font-weight: bold;">Figura
3: </span>Upload de arquivo shapefile<br>
<br>
Caso apareça uma mensagem parecida com a abaixo, o upload foi realizado
com sucesso:<br>
<br>
<dl>
<dd>Preparando inclusão de dados</dd>
<dd>Incluindo dados</dd>
<dd>Registros existentes no SHP: 406</dd>
<dd>Registros na tabela final: 406</dd>
<dd>Diferenças podem ocorrer em função de caracteres acentuados não
suportados pelo banco de dados</dd>
<dd><b>Feito!!!</b></dd>
<dd><b>Faça o reload da página</b></dd>
</dl>
<br>
</div>
<div class="trail-box-bottom">
<img src="files/trails-box-br.png" class="right" alt="" height="6" width="7"><img src="files/trails-box-bl.png" class="left" alt="" height="6" width="7"></div>
</div>
<br>
<div class="trail-box">
<div class="trail-box-header"><img src="files/trails-box-tr.png" class="right" alt="" height="21" width="7"><img src="files/trails-box-tl.png" class="left" alt="" height="21" width="7"><comment title=" here is the box header " xmlns="http://disruptive-innovations.com/zoo/nvu"><comment title=" here is the box header " xmlns="http://disruptive-innovations.com/zoo/nvu"></comment></comment>
<h1><span style="font-weight: bold;"><a name="2medida_variável"></a>2
- Criação de uma tabela a partir de um CSV</span></h1>
</div>
<div class="trail-box-content">
Para criar uma tabela por meio de um arquivo CSV escolha a opção
"Upload CSV". Selecione a localização do arquivo ".csv". Depois, insira
o nome da tabela a ser criada ou escolha na lista uma tabela já
existente. Caso a tabela já exista, informe em seguida se você quer
adicionar os dados do CSV à tabela já existente ou apagar os dados
existentes e incluir o CSV. Se for uma tabela nova, escolha a opção
"Criar a tabela nova e incluir registros do CSV". Em seguida, marque a
opção se quiser criar uma coluna "gid" para ser utilizado como código
único do registro. Caso o arquivo CSV contenham colunas com coordenadas
geográficas em graus decimais e você queira utilizá-las, informe o nome
das colunas com as latitudes (Y) e longitudes (X). Por fim, clique em
enviar.<br>
<br>
<img style="width: 799px; height: 510px;" alt="" src="imagens/Tutoria1-imagens/figura9.png"><br>
<span style="font-weight: bold;">Figura 4: </span>Upload de arquivo CSV<br>
<br>
Caso apareça uma mensagem parecida com a abaixo, o upload foi realizado
com sucesso:<br>
<dl>
<dd>
Incluindo dados</dd><dd>Registros existentes no CSV: 29</dd><dd>Registros na tabela final: 29</dd><dd><b>Feito!!!</b></dd><dd><b>Faça o reload da página </b></dd>
</dl>
<span style="font-weight: bold;"></span><br>
<br>
</div>
</div>
<br>
<div class="trail-box">
<div class="trail-box-header"><img src="files/trails-box-tr.png" class="right" alt="" height="21" width="7"><img src="files/trails-box-tl.png" class="left" alt="" height="21" width="7"><comment title=" here is the box header " xmlns="http://disruptive-innovations.com/zoo/nvu"><comment title=" here is the box header " xmlns="http://disruptive-innovations.com/zoo/nvu"></comment></comment>
<h1><span style="font-weight: bold;"><a name="3classificacao"></a>3
- Edição manual de tabelas<br>
</span></h1>
</div>
<div class="trail-box-content">Para criar uma nova tabela manualmente, escolha a opção "Criar uma nova tabela" e
informe o nome da nova tabela. <br>
<br>
Se quiser quiser editar manualmente uma
tabela, escolha a tabela criada na lista, conforme a <span style="font-weight: bold;">Figura 5</span>. <br>
<br>
<img style="width: 582px; height: 243px;" alt="" src="imagens/Tutoria1-imagens/figura10.png"><br>
<span style="font-weight: bold;">Figura 5: </span>Lista de tabelas existentes<br>
<br>
Para criar uma nova coluna, escolha a opção "Adicionar uma nova
coluna". Escolha o nome da nova coluna e o tipo de registro (integer,
numeric, text, geometry). <br>
<br>
Caso queira criar uma tabela para ser utilizada como uma variável é preciso seguir algumas convenções <span style="color: rgb(51, 51, 51); font-family: Verdana,Helvetica,Arial; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(255, 255, 255); display: inline ! important; float: none;"> previamente
definidas no i3GeoSaúde. Isso ocorre com os nomes
das
colunas (e seus
tipos de dados), com exceção </span><span style="color: rgb(51, 51, 51); font-family: Verdana,Helvetica,Arial; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(255, 255, 255); display: inline ! important; float: none;">da
coluna "gid", que é
gerada automaticamente por ele</span><span style="color: rgb(51, 51, 51); font-family: Verdana,Helvetica,Arial; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(255, 255, 255); display: inline ! important; float: none;">.<br>
<br>
Acompanhe a seguir as colunas obrigatórias para o cadastro de variáveis pelo i3GeoSaúde :<br>
1- Criar a coluna "id_medida_variavel", com o tipo "integer";<br>
2- Criar a coluna "codigoregiao", com o tipo "text";<br>
3- </span><span style="color: rgb(51, 51, 51); font-family: Verdana,Helvetica,Arial; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(255, 255, 255); display: inline ! important; float: none;">Criar
a coluna "ano", com o tipo "integer";<br>
4- Criar a coluna "mes", com o tipo "integer";</span><span style="color: rgb(51, 51, 51); font-family: Verdana,Helvetica,Arial; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(255, 255, 255); display: inline ! important; float: none;">
<br>
5- Criar a coluna "dia", com o tipo "integer";</span><br>
<span style="color: rgb(51, 51, 51); font-family: Verdana,Helvetica,Arial; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(255, 255, 255); display: inline ! important; float: none;">6-
Criar a coluna "hora", com o tipo "integer".<br>
<br>
</span>A última coluna
é aquela que servirá de
parâmetro da medida da variável. Essa coluna deve
ser
criada
com o nome que for mais adequado, e seu tipo deve ser
numérico
(integer).<span style="color: rgb(51, 51, 51); font-family: Verdana,Helvetica,Arial; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(255, 255, 255); display: inline ! important; float: none;"></span><br>
<br>
Para visualizar os dados da tabela, escolha a opção "Mostrar dados" e informe o número máximo de registros que deseja ver.<br>
<br>
</div><div class="trail-box-bottom">
<img src="files/trails-box-br.png" class="right" alt="" height="6" width="7"><img src="files/trails-box-bl.png" class="left" alt="" height="6" width="7"></div>
</div> <br>
<div class="trail-box">
<div>
<img src="files/trails-box-br.png" class="right" alt="" height="6" width="7"><img src="files/trails-box-bl.png" class="left" alt="" height="6" width="7"></div>
</div>
<div class="imginicio"><a href="#top"><img src="files/topo.gif" title="Topo" style="border: 0px solid ; width: 41px; height: 35px;" alt="Topo"></a></div>
<br>
<br>
</div>
</div>
</div>
</body></html>