Commit ac086ba85891bb7a3a0803ae17e12dee0b51dac6
1 parent
eaef26d4
Exists in
master
and in
7 other branches
Conversão da ferramenta Distância entre Pontos para Bootstrap e correção de erro…
… na função de projeção dos dados para cálculo de distâncias
Showing
59 changed files
with
77 additions
and
43 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesphp/classe_analise.php
... | ... | @@ -1270,12 +1270,13 @@ class Analise { |
1270 | 1270 | * |
1271 | 1271 | */ |
1272 | 1272 | function distanciaptpt($temaorigem, $temadestino, $temaoverlay, $locaplic, $itemorigem = "", $itemdestino = "") { |
1273 | - // //error_reporting(0); | |
1273 | + | |
1274 | 1274 | set_time_limit ( 180 ); |
1275 | 1275 | // para manipular dbf |
1276 | 1276 | if ($this->dbaseExiste == false) { |
1277 | 1277 | include_once dirname ( __FILE__ ) . "/../pacotes/phpxbase/api_conversion.php"; |
1278 | 1278 | } |
1279 | + //error_reporting(E_ALL); | |
1279 | 1280 | // define o nome do novo shapefile que será criado |
1280 | 1281 | $nomefinal = nomeRandomico (); |
1281 | 1282 | $nomeshp = $this->diretorio . "/" . $nomefinal; |
... | ... | @@ -1318,6 +1319,8 @@ class Analise { |
1318 | 1319 | $projInObj = $layerorigem->getProjection (); |
1319 | 1320 | if ($projInObj == "") { |
1320 | 1321 | $projInObj = ms_newprojectionobj ( "proj=longlat,ellps=WGS84,datum=WGS84,no_defs" ); |
1322 | + } else { | |
1323 | + $projInObj = ms_newprojectionobj($projInObj); | |
1321 | 1324 | } |
1322 | 1325 | $projOutObj = ms_newprojectionobj ( "proj=poly,ellps=GRS67,lat_0=" . $rect->miny . ",lon_0=" . $rect->minx . ",x_0=5000000,y_0=10000000" ); |
1323 | 1326 | $origemdestino = array (); |
... | ... | @@ -1327,6 +1330,7 @@ class Analise { |
1327 | 1330 | if (count ( $shapesdestino ) == 0) { |
1328 | 1331 | return "erro"; |
1329 | 1332 | } |
1333 | + | |
1330 | 1334 | $novoshpf = ms_newShapefileObj ( $nomeshp, MS_SHP_ARC ); |
1331 | 1335 | // cria o dbf |
1332 | 1336 | $def [] = array ( |
... | ... | @@ -1358,16 +1362,19 @@ class Analise { |
1358 | 1362 | $db = xbase_open ( $dbname, 2 ); |
1359 | 1363 | else |
1360 | 1364 | $db = dbase_open ( $dbname, 2 ); |
1365 | + | |
1361 | 1366 | foreach ( $shapesorigem as $sorigem ) { |
1362 | 1367 | if ($itemorigem != "") { |
1363 | 1368 | $valororigem = $sorigem->values [$itemorigem]; |
1364 | 1369 | } else { |
1365 | 1370 | $valororigem = ""; |
1366 | 1371 | } |
1372 | + | |
1367 | 1373 | foreach ( $shapesdestino as $sdestino ) { |
1368 | 1374 | $linha = ms_newLineObj (); |
1369 | 1375 | $linha->add ( $sorigem->getCentroid () ); |
1370 | 1376 | $linha->add ( $sdestino->getCentroid () ); |
1377 | + | |
1371 | 1378 | if ($itemdestino != "") { |
1372 | 1379 | $valordestino = $sdestino->values [$itemdestino]; |
1373 | 1380 | } else { |
... | ... | @@ -1376,8 +1383,11 @@ class Analise { |
1376 | 1383 | $ShapeObj = ms_newShapeObj ( MS_SHAPE_LINE ); |
1377 | 1384 | $ShapeObj->add ( $linha ); |
1378 | 1385 | $novoshpf->addShape ( $ShapeObj ); |
1386 | + | |
1379 | 1387 | $ShapeObj->project ( $projInObj, $projOutObj ); |
1388 | + | |
1380 | 1389 | $distancia = $ShapeObj->getLength (); |
1390 | + | |
1381 | 1391 | $registro = array ( |
1382 | 1392 | $distancia, |
1383 | 1393 | $valororigem, |
... | ... | @@ -1389,11 +1399,14 @@ class Analise { |
1389 | 1399 | dbase_add_record ( $db, $registro ); |
1390 | 1400 | } |
1391 | 1401 | } |
1402 | + | |
1392 | 1403 | if ($this->dbaseExiste == false) |
1393 | 1404 | xbase_close ( $db ); |
1394 | 1405 | else |
1395 | 1406 | dbase_close ( $db ); |
1396 | - // adiciona no mapa atual o novo tema | |
1407 | + | |
1408 | + | |
1409 | + // adiciona no mapa atual o novo tema | |
1397 | 1410 | $novolayer = criaLayer ( $this->mapa, MS_LAYER_LINE, MS_DEFAULT, ("Distancias (" . $nomefinal . ")"), $metaClasse = "SIM" ); |
1398 | 1411 | $novolayer->set ( "data", $nomeshp . ".shp" ); |
1399 | 1412 | $novolayer->setmetadata ( "DOWNLOAD", "SIM" ); | ... | ... |
ferramentas/distanciaptpt/index.js
... | ... | @@ -111,7 +111,7 @@ i3GEOF.distanciaptpt = { |
111 | 111 | }; |
112 | 112 | janela = i3GEO.janela.cria( |
113 | 113 | "410px", |
114 | - "180px", | |
114 | + "240px", | |
115 | 115 | "", |
116 | 116 | "", |
117 | 117 | "", |
... | ... | @@ -171,7 +171,6 @@ i3GEOF.distanciaptpt = { |
171 | 171 | <DISTANCIAPTPT> |
172 | 172 | */ |
173 | 173 | calcula: function(){ |
174 | - try{ | |
175 | 174 | if(i3GEOF.distanciaptpt.aguarde.visibility === "visible") |
176 | 175 | {return;} |
177 | 176 | var distancia = $i("i3GEOFdistanciaptptdistancia").value, |
... | ... | @@ -181,12 +180,13 @@ i3GEOF.distanciaptpt = { |
181 | 180 | p, |
182 | 181 | cp; |
183 | 182 | if ((distancia*1 > 0) && (temaOrigem != "") && (temaDestino != "")){ |
184 | - i3GEOF.distanciaptpt.aguarde.visibility = "visible"; | |
183 | + //i3GEOF.distanciaptpt.aguarde.visibility = "visible"; | |
185 | 184 | fim = function(retorno){ |
186 | 185 | if (retorno.data==undefined ) |
187 | 186 | {$i("i3GEOdistanciaptptfim").innerHTML = "<p class='paragrafo' >"+$trad('erroTempo',i3GEOF.distanciaptpt.dicionario);} |
188 | - else | |
189 | - {i3GEO.atualiza();} | |
187 | + else{ | |
188 | + i3GEO.atualiza(); | |
189 | + } | |
190 | 190 | i3GEOF.distanciaptpt.aguarde.visibility = "hidden"; |
191 | 191 | }; |
192 | 192 | p = i3GEO.configura.locaplic+"/ferramentas/distanciaptpt/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=distanciaptpt&temaorigem="+temaOrigem+"&temadestino="+temaDestino+"&distancia="+distancia+"&itemorigem="+$i("i3GEOFdistanciaptptItemOrigem").value+"&itemdestino="+$i("i3GEOFdistanciaptptItemDestino").value+"&ext="+i3GEO.parametros.mapexten; |
... | ... | @@ -194,10 +194,9 @@ i3GEOF.distanciaptpt = { |
194 | 194 | cp.set_response_type("JSON"); |
195 | 195 | cp.call(p,"distanciaptpt",fim); |
196 | 196 | } |
197 | - else | |
198 | - {$i("i3GEOdistanciaptptfim").innerHTML = $trad('erroParametro',i3GEOF.distanciaptpt.dicionario);} | |
199 | - } | |
200 | - catch(e){$i("i3GEOdistanciaptptfim").innerHTML = "<p class='paragrafo' >Erro. "+e;i3GEO.janela.fechaAguarde();i3GEOF.distanciaptpt.aguarde.visibility = "hidden";} | |
197 | + else{ | |
198 | + $i("i3GEOdistanciaptptfim").innerHTML = $trad('erroParametro',i3GEOF.distanciaptpt.dicionario); | |
199 | + } | |
201 | 200 | }, |
202 | 201 | /* |
203 | 202 | Function: comboTemasOrigem |
... | ... | @@ -214,7 +213,6 @@ i3GEOF.distanciaptpt = { |
214 | 213 | "i3GEOdistanciaptpttemasComSel", |
215 | 214 | function(retorno){ |
216 | 215 | $i("i3GEOdistanciaptptSelTemasOrigem").innerHTML = retorno.dados; |
217 | - $i("i3GEOdistanciaptptSelTemasOrigem").style.display = "block"; | |
218 | 216 | if ($i("i3GEOdistanciaptpttemasComSel")){ |
219 | 217 | $i("i3GEOdistanciaptpttemasComSel").onchange = function(){ |
220 | 218 | i3GEO.mapa.ativaTema($i("i3GEOdistanciaptpttemasComSel").value); |
... | ... | @@ -228,7 +226,10 @@ i3GEOF.distanciaptpt = { |
228 | 226 | "", |
229 | 227 | false, |
230 | 228 | "pontosSelecionados", |
231 | - " " | |
229 | + "", | |
230 | + false, | |
231 | + true, | |
232 | + "form-control comboTema" | |
232 | 233 | ); |
233 | 234 | }, |
234 | 235 | /* |
... | ... | @@ -246,7 +247,6 @@ i3GEOF.distanciaptpt = { |
246 | 247 | "i3GEOdistanciaptpttemas", |
247 | 248 | function(retorno){ |
248 | 249 | $i("i3GEOdistanciaptptSelTemasDestino").innerHTML = retorno.dados; |
249 | - $i("i3GEOdistanciaptptSelTemasDestino").style.display = "block"; | |
250 | 250 | if ($i("i3GEOdistanciaptpttemas")){ |
251 | 251 | $i("i3GEOdistanciaptpttemas").onchange = function(){ |
252 | 252 | i3GEO.mapa.ativaTema($i("i3GEOdistanciaptpttemas").value); |
... | ... | @@ -260,7 +260,10 @@ i3GEOF.distanciaptpt = { |
260 | 260 | "", |
261 | 261 | false, |
262 | 262 | "pontos", |
263 | - " " | |
263 | + "", | |
264 | + false, | |
265 | + true, | |
266 | + "form-control comboTema" | |
264 | 267 | ); |
265 | 268 | }, |
266 | 269 | /* |
... | ... | @@ -281,7 +284,11 @@ i3GEOF.distanciaptpt = { |
281 | 284 | $i("i3GEOondeItensTemaOrigem").innerHTML = retorno.dados; |
282 | 285 | $i("i3GEOondeItensTemaOrigem").style.display = "block"; |
283 | 286 | }, |
284 | - "i3GEOondeItensTemaOrigem" | |
287 | + "i3GEOondeItensTemaOrigem", | |
288 | + "", | |
289 | + "", | |
290 | + "", | |
291 | + "form-control comboTema" | |
285 | 292 | ); |
286 | 293 | }, |
287 | 294 | /* |
... | ... | @@ -302,7 +309,11 @@ i3GEOF.distanciaptpt = { |
302 | 309 | $i("i3GEOondeItensTemaDestino").innerHTML = retorno.dados; |
303 | 310 | $i("i3GEOondeItensTemaDestino").style.display = "block"; |
304 | 311 | }, |
305 | - "i3GEOondeItensTemaDestino" | |
312 | + "i3GEOondeItensTemaDestino", | |
313 | + "", | |
314 | + "", | |
315 | + "", | |
316 | + "form-control comboTema" | |
306 | 317 | ); |
307 | 318 | } |
308 | 319 | }; | ... | ... |
ferramentas/distanciaptpt/template_mst.html
1 | -<div style='padding: 5px; background-color: #F2F2F2; top: 0px; left: 0px; display: block; width: 90%;' id='i3GEOdistanciaptptresultado'> | |
1 | +<div class='container-fluid' id='i3GEOdistanciaptptresultado'> | |
2 | 2 | <div id='i3GEOFgradeDePontost0'> |
3 | - <img class='i3GeoExemploImg' src='{{{locaplic}}}/ferramentas/distanciaptpt/exemplo.png' /> | |
4 | - <p class='paragrafo'>{{{ajuda}}} | |
5 | - <p class='paragrafo'>{{{ajuda2}}} | |
6 | - <p class='paragrafo'>{{{ajuda3}}} | |
3 | + <img class="img-rounded pull-left" style="margin: 5px; width: 40px;" src='{{{locaplic}}}/ferramentas/distanciaptpt/exemplo.png' /> | |
4 | + <h5>{{{ajuda}}}</h5> | |
5 | + <h5>{{{ajuda2}}}</h5> | |
6 | + <h5>{{{ajuda3}}}</h5> | |
7 | 7 | </div> |
8 | 8 | <div id='i3GEOF.distanciaptpt.t1'> |
9 | - <p class='paragrafo'> | |
10 | - {{{temaOrigem}}}</p> | |
11 | - <div class='styled-select' id='i3GEOdistanciaptptSelTemasOrigem'></div> | |
12 | - <br> | |
13 | - <p class='paragrafo'> | |
14 | - {{{temaDestino}}}</p> | |
15 | - <div class='styled-select' id='i3GEOdistanciaptptSelTemasDestino'></div> | |
16 | - <br> | |
17 | - <p class='paragrafo'> | |
18 | - {{{distMax}}}</p> | |
19 | - <div class='i3geoForm i3geoFormIconeEdita'> | |
20 | - <input type='text' value='100000' id='i3GEOFdistanciaptptdistancia'> | |
9 | + <div style="width: 100%;" class='form-group label-fixed condensed'> | |
10 | + <label class="control-label" for="">{{{temaOrigem}}}</label> | |
11 | + <div style="width: 100%;" class="input-group"> | |
12 | + <div id='i3GEOdistanciaptptSelTemasOrigem'></div> | |
13 | + </div> | |
14 | + </div> | |
15 | + <div style="width: 100%;" class='form-group label-fixed condensed'> | |
16 | + <label class="control-label" for="">{{{temaDestino}}}</label> | |
17 | + <div style="width: 100%;" class="input-group"> | |
18 | + <div id='i3GEOdistanciaptptSelTemasDestino'></div> | |
19 | + </div> | |
20 | + </div> | |
21 | + <div class='form-group label-fixed condensed' > | |
22 | + <label class="control-label" for="">{{{distMax}}}</label> | |
23 | + <input class="form-control input-lg" type='text' id='i3GEOFdistanciaptptdistancia' value='100000' /> | |
21 | 24 | </div> |
22 | 25 | </div> |
23 | 26 | <div id='i3GEOF.distanciaptpt.t2'> |
24 | - <p class='paragrafo'>{{{selecionaAtributos}}}</p> | |
25 | - <p class='paragrafo'>{{{atributoOrigem}}}</p> | |
26 | - <div class='styled-select' id='i3GEOondeItensTemaOrigem'>{{{aguarde}}}</div> | |
27 | - <br> | |
28 | - <p class='paragrafo'>{{{atributoDestino}}}</p> | |
29 | - <div class='styled-select' id='i3GEOondeItensTemaDestino'>{{{aguarde}}}</div> | |
27 | + <h5>{{{selecionaAtributos}}}</h5> | |
28 | + <div style="width: 100%;" class='form-group label-fixed condensed'> | |
29 | + <label class="control-label" for="">{{{atributoOrigem}}}</label> | |
30 | + <div style="width: 100%;" class="input-group"> | |
31 | + <div id='i3GEOondeItensTemaOrigem'></div> | |
32 | + </div> | |
33 | + </div> | |
34 | + <div style="width: 100%;" class='form-group label-fixed condensed'> | |
35 | + <label class="control-label" for="">{{{atributoDestino}}}</label> | |
36 | + <div style="width: 100%;" class="input-group"> | |
37 | + <div id='i3GEOondeItensTemaDestino'></div> | |
38 | + </div> | |
39 | + </div> | |
40 | + | |
30 | 41 | </div> |
31 | 42 | <div id='i3GEOF.distanciaptpt.t3'> |
32 | - <p class='paragrafo'> | |
33 | - {{{msgTema}}} <br> <br> <input id='i3GEOdistanciaptptbotao1' type='button' value='{{{calcula}}}'/> | |
43 | + <button onclick="i3GEOF.distanciaptpt.calcula()" class='btn btn-primary btn-sm btn-raised'>{{{calcula}}}</button> | |
44 | + <h5 id='i3GEOdistanciaptptfim'></h5> | |
34 | 45 | </div> |
35 | 46 | </div> |
36 | -<div style='top: 10px; left: 0px; display: block; width: 98%; color: red' id='i3GEOdistanciaptptfim'></div> | |
37 | 47 | \ No newline at end of file | ... | ... |
pacotes/yui290/build/container/container_compacto.js
100644 → 100755
pacotes/yui290/build/container/container_core_compacto.js
100644 → 100755
pacotes/yui290/build/utilities/utilities_compacto.js
100644 → 100755