Commit df844855a8295418440a9aade03afa3c84c50c21

Authored by Edmar Moretti
1 parent 6ccd17ba

Inclusão de opção na ferramenta tabela para pemritir que os dados sejam vistos e…

…m uma janela separada. Essa janela pode ser vinculada a outras tabelas.
admin/admin.db
No preview for this file type
ferramentas/metaestat/analise.php
@@ -312,7 +312,7 @@ function pegaDadosTME($map_file,$tema){ @@ -312,7 +312,7 @@ function pegaDadosTME($map_file,$tema){
312 $retorno = array("itemNomeRegioes"=>"","itemDados"=>""); 312 $retorno = array("itemNomeRegioes"=>"","itemDados"=>"");
313 $mapa = ms_newMapObj($map_file); 313 $mapa = ms_newMapObj($map_file);
314 $layer = $mapa->getlayerbyname($tema); 314 $layer = $mapa->getlayerbyname($tema);
315 - $id_medida_variavel = $layer->getmetadata("ID_MEDIDA_VARIAVEL"); 315 + $id_medida_variavel = $layer->getmetadata("METAESTAT_ID_MEDIDA_VARIAVEL");
316 $m = new Metaestat(); 316 $m = new Metaestat();
317 317
318 if($id_medida_variavel != ""){ 318 if($id_medida_variavel != ""){
ferramentas/metaestat/index.js
@@ -607,7 +607,7 @@ i3GEOF.metaestat = { @@ -607,7 +607,7 @@ i3GEOF.metaestat = {
607 } 607 }
608 janela.show(); 608 janela.show();
609 imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); 609 imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));
610 - janela.moveTo(imagemxy[0]+i3GEOF.metaestat.LEFT+i3GEOF.metaestat.LARGURA+10,i3GEOF.metaestat.TOP); 610 + janela.moveTo(imagemxy[0]+i3GEOF.metaestat.LEFT+i3GEOF.metaestat.LARGURA+20,i3GEOF.metaestat.TOP);
611 }, 611 },
612 destroiJanela: function(){ 612 destroiJanela: function(){
613 var janela = YAHOO.i3GEO.janela.manager.find("i3geoCartoClasses"); 613 var janela = YAHOO.i3GEO.janela.manager.find("i3geoCartoClasses");
ferramentas/tabela/dicionario.js
@@ -227,5 +227,11 @@ pt:"Os dados utilizados referem-se apenas à região atual mostrada @@ -227,5 +227,11 @@ pt:"Os dados utilizados referem-se apenas à região atual mostrada
227 en:"", 227 en:"",
228 es:"", 228 es:"",
229 it:"" 229 it:""
  230 +}],
  231 +39: [{
  232 +pt:"Marque uma coluna primeiro",
  233 +en:"",
  234 +es:"",
  235 +it:""
230 }] 236 }]
231 }; 237 };
232 \ No newline at end of file 238 \ No newline at end of file
ferramentas/tabela/index.js
@@ -405,24 +405,63 @@ i3GEOF.tabela = { @@ -405,24 +405,63 @@ i3GEOF.tabela = {
405 i3GEO.vincularTabelas = {}; 405 i3GEO.vincularTabelas = {};
406 i3GEO.vincularTabelas.janelas = []; 406 i3GEO.vincularTabelas.janelas = [];
407 i3GEO.vincularTabelas.colunas = {}; 407 i3GEO.vincularTabelas.colunas = {};
  408 + i3GEO.vincularTabelas.colunasVazias = 3;
408 i3GEO.vincularTabelas.atualiza = function(idtabela,objinput){ 409 i3GEO.vincularTabelas.atualiza = function(idtabela,objinput){
409 var v = objinput.parentNode.parentNode.cloneNode(true), 410 var v = objinput.parentNode.parentNode.cloneNode(true),
410 onde = $i("selecao_"+idtabela), 411 onde = $i("selecao_"+idtabela),
411 ntab = i3GEO.vincularTabelas.janelas.length, 412 ntab = i3GEO.vincularTabelas.janelas.length,
412 - i; 413 + valorcel="",i,temp,n,tabtempid,c,tabcomp,linhas,j,valor;
413 if(onde.firstChild){ 414 if(onde.firstChild){
414 onde.removeChild(onde.firstChild); 415 onde.removeChild(onde.firstChild);
415 } 416 }
416 - onde.appendChild(v);  
417 //verifica se a coluna foi escolhida 417 //verifica se a coluna foi escolhida
418 - //pega o valor da celula escolhida  
419 - //loop pelas tabelas  
420 - for(i=0;i<ntab;i++){  
421 - //verifica se a tabela existe  
422 - //verifica se tem coluna escolhida  
423 - //loop pelas linhas 418 + if(i3GEO.vincularTabelas.colunas[idtabela] == undefined || i3GEO.vincularTabelas.colunas[idtabela] === ""){
  419 + i3GEO.janela.tempoMsg($trad(39,i3GEOF.tabela.dicionario));
  420 + }
  421 + else{
  422 + onde.appendChild(v);
  423 + $i(idtabela+"_corpo").scrollTop = 0;
  424 + //pega o valor da celula escolhida
  425 + temp = v.getElementsByTagName("td");
  426 + c = i3GEO.vincularTabelas.colunas[idtabela];
  427 + valorcel = temp[i3GEO.vincularTabelas.colunasVazias + c].innerHTML;
  428 + valorcel = valorcel.trim();
  429 + valorcel = valorcel.toLowerCase();
  430 + //loop pelas tabelas
  431 + for(i=0;i<ntab;i++){
  432 + //verifica se a tabela existe
  433 + tabtempid = i3GEO.vincularTabelas.janelas[i];
  434 + if($i(tabtempid+"_corpo") && tabtempid != idtabela){
  435 + onde = $i("selecao_"+tabtempid);
  436 + //verifica se tem coluna escolhida
  437 + c = i3GEO.vincularTabelas.colunas[tabtempid];
  438 + if(c !== undefined && c !== ""){
  439 + //tabela com os dados da janela
  440 + tabcomp = $i(tabtempid+"_corpo").getElementsByTagName("table")[1];
  441 + //remove o conteudo do lugar onde o resultado sera mostrado
  442 + temp = $i(tabtempid+"_corpo").getElementsByTagName("table")[0];
  443 + if(temp.firstChild){
  444 + temp.removeChild(temp.firstChild);
  445 + }
  446 + //linhas da tabela
  447 + linhas = tabcomp.getElementsByTagName("tr");
  448 + n = linhas.length;
  449 + //loop nas linhas
  450 + for(j=0;j<n;j++){
  451 + valor = linhas[j].getElementsByTagName("td")[i3GEO.vincularTabelas.colunasVazias + c].innerHTML;
  452 + valor = valor.trim();
  453 + valor = valor.toLowerCase();
  454 + if(valorcel == valor){
  455 + v = linhas[j].cloneNode(true);
  456 + onde.appendChild(v);
  457 + }
  458 + }
  459 + }
  460 +
  461 + }
  462 +
  463 + }
424 } 464 }
425 - //$i(idtabela+"_corpo").scrollTop = 0;  
426 }; 465 };
427 i3GEO.janela.tempoMsg($trad(37,i3GEOF.tabela.dicionario)); 466 i3GEO.janela.tempoMsg($trad(37,i3GEOF.tabela.dicionario));
428 } 467 }
@@ -102,10 +102,10 @@ if(isset($lista) &amp;&amp; $lista == &quot;temas&quot;){ @@ -102,10 +102,10 @@ if(isset($lista) &amp;&amp; $lista == &quot;temas&quot;){
102 ogc_imprimeListaDeTemas(); 102 ogc_imprimeListaDeTemas();
103 exit; 103 exit;
104 } 104 }
105 -if(isset($lista) && $lista == "temaswfs"){  
106 - include_once(__DIR__."/classesphp/classe_menutemas.php");  
107 - ogc_imprimeListaDeTemasWfs();  
108 - exit; 105 +if(isset($lista) && $lista == "temaswfs"){
  106 + include_once(__DIR__."/classesphp/classe_menutemas.php");
  107 + ogc_imprimeListaDeTemasWfs();
  108 + exit;
109 } 109 }
110 // 110 //
111 //cria o web service 111 //cria o web service
@@ -209,8 +209,8 @@ if ($tipo == &quot;&quot; || $tipo == &quot;metadados&quot;){ @@ -209,8 +209,8 @@ if ($tipo == &quot;&quot; || $tipo == &quot;metadados&quot;){
209 if(file_exists($locaplic."/temas/".$tx.".php") && $temai3geo == true){ 209 if(file_exists($locaplic."/temas/".$tx.".php") && $temai3geo == true){
210 $extensao = ".php"; 210 $extensao = ".php";
211 } 211 }
212 - if(file_exists($locaplic."/temas/".$tx.".gvp") && $temai3geo == true){  
213 - $extensao = ".gvp"; 212 + if(file_exists($locaplic."/temas/".$tx.".gvp") && $temai3geo == true){
  213 + $extensao = ".gvp";
214 } 214 }
215 if($extensao == ".map"){ 215 if($extensao == ".map"){
216 if($temai3geo == true){ 216 if($temai3geo == true){
@@ -224,8 +224,8 @@ if ($tipo == &quot;&quot; || $tipo == &quot;metadados&quot;){ @@ -224,8 +224,8 @@ if ($tipo == &quot;&quot; || $tipo == &quot;metadados&quot;){
224 } 224 }
225 foreach ($ts as $t){ 225 foreach ($ts as $t){
226 $l = $nmap->getlayerbyname($t); 226 $l = $nmap->getlayerbyname($t);
227 - $permite = $l->getmetadata("permiteogc");  
228 - if(strtolower($permite) != "nao"){ 227 + $permite = $l->getmetadata("permiteogc");
  228 + if(strtolower($permite) != "nao"){
229 //necess&aacute;rio pq o mapfile pode ter todos os layers como default 229 //necess&aacute;rio pq o mapfile pode ter todos os layers como default
230 if($temai3geo == false){ 230 if($temai3geo == false){
231 $l->set("status",MS_OFF); 231 $l->set("status",MS_OFF);
@@ -300,33 +300,33 @@ if ($tipo == &quot;&quot; || $tipo == &quot;metadados&quot;){ @@ -300,33 +300,33 @@ if ($tipo == &quot;&quot; || $tipo == &quot;metadados&quot;){
300 $numlayers = $oMap->numlayers; 300 $numlayers = $oMap->numlayers;
301 $layers = array(); 301 $layers = array();
302 //$layers[] = "default"; 302 //$layers[] = "default";
303 - for ($i=0;$i < $numlayers;$i++){  
304 - $l = $oMap->getlayer($i);  
305 - $l->setmetadata("gml_include_items","all");  
306 - $l->set("dump",MS_TRUE);  
307 - $l->setmetadata("WMS_INCLUDE_ITEMS","all"); 303 + for ($i=0;$i < $numlayers;$i++){
  304 + $l = $oMap->getlayer($i);
  305 + $l->setmetadata("gml_include_items","all");
  306 + $l->set("dump",MS_TRUE);
  307 + $l->setmetadata("WMS_INCLUDE_ITEMS","all");
308 $l->setmetadata("WFS_INCLUDE_ITEMS","all"); 308 $l->setmetadata("WFS_INCLUDE_ITEMS","all");
309 $l->setmetadata("ows_srs",$listaepsg); 309 $l->setmetadata("ows_srs",$listaepsg);
310 $l->setmetadata("ows_title",$l->getmetadata("TEMA")); 310 $l->setmetadata("ows_title",$l->getmetadata("TEMA"));
311 $l->set("status",MS_OFF); 311 $l->set("status",MS_OFF);
312 $layers[] = $l->name; 312 $layers[] = $l->name;
313 - if(file_exists($locaplic."/temas/miniaturas/".$tx.".map.mini.png")){  
314 - $mini = $proto.$server.dirname($_SERVER['PHP_SELF'])."/temas/miniaturas/".$tx.".map.mini.png";  
315 - $l->setmetadata("wms_attribution_logourl_format","image/png");  
316 - $l->setmetadata("wms_attribution_logourl_height","50");  
317 - $l->setmetadata("wms_attribution_logourl_width","50");  
318 - $l->setmetadata("wms_attribution_logourl_href",$mini);  
319 - }  
320 - if($l->type == MS_LAYER_RASTER && $l->numclasses > 0){  
321 - $c = $l->getclass(0);  
322 - if($c->name == "")  
323 - {$c->name = " ";}  
324 - }  
325 - //inclui extensao geografica  
326 - $extensao = $l->getmetadata("EXTENSAO");  
327 - if($extensao == ""){  
328 - $extensao = $extensaoMap;  
329 - } 313 + if(file_exists($locaplic."/temas/miniaturas/".$tx.".map.mini.png")){
  314 + $mini = $proto.$server.dirname($_SERVER['PHP_SELF'])."/temas/miniaturas/".$tx.".map.mini.png";
  315 + $l->setmetadata("wms_attribution_logourl_format","image/png");
  316 + $l->setmetadata("wms_attribution_logourl_height","50");
  317 + $l->setmetadata("wms_attribution_logourl_width","50");
  318 + $l->setmetadata("wms_attribution_logourl_href",$mini);
  319 + }
  320 + if($l->type == MS_LAYER_RASTER && $l->numclasses > 0){
  321 + $c = $l->getclass(0);
  322 + if($c->name == "")
  323 + {$c->name = " ";}
  324 + }
  325 + //inclui extensao geografica
  326 + $extensao = $l->getmetadata("EXTENSAO");
  327 + if($extensao == ""){
  328 + $extensao = $extensaoMap;
  329 + }
330 $l->setmetadata("wms_extent",$extensao); 330 $l->setmetadata("wms_extent",$extensao);
331 } 331 }
332 $req->setParameter("LAYERS", implode(",",$layers)); 332 $req->setParameter("LAYERS", implode(",",$layers));
@@ -361,7 +361,7 @@ else{ @@ -361,7 +361,7 @@ else{
361 } 361 }
362 } 362 }
363 //echo "<pre>"; 363 //echo "<pre>";
364 - //var_dump($$codigosTema); 364 + //var_dump($codigosTema);
365 //exit; 365 //exit;
366 foreach($codigosTema as $c){ 366 foreach($codigosTema as $c){
367 $codigoTema = $c["tema"]; 367 $codigoTema = $c["tema"];
@@ -480,41 +480,41 @@ function ogc_imprimeListaDeTemas(){ @@ -480,41 +480,41 @@ function ogc_imprimeListaDeTemas(){
480 } 480 }
481 echo $imprimir."</body></html>"; 481 echo $imprimir."</body></html>";
482 } 482 }
483 -function ogc_imprimeListaDeTemasWfs(){  
484 - global $urli3geo,$perfil,$locaplic;  
485 - $m = new Menutemas("",$perfil,$locaplic,$urli3geo);  
486 - $menus = $m->pegaListaDeMenus();  
487 - echo '<html><head><title>WFS</title><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"><meta name="description" content="OGC"><meta name="keywords" content="WMS OGC mapa sig gis webmapping geo geoprocessamento interativo meio ambiente MMA cartografia geografia"> <meta name="robots" content="index,follow">';  
488 - echo "<body><b>Lista de temas por grupos e subgrupos e endere&ccedil;os de acesso aos dados por meio de Web Services WFS (os c&oacute;digos dos temas est&atilde;o em vermelho)</b><br><br>";  
489 - $imprimir = "";  
490 - foreach ($menus as $menu){  
491 - $grupos = $m->pegaListaDeGrupos($menu["idmenu"],$listasistemas="nao",$listasgrupos="sim");  
492 - foreach($grupos as $grupo){  
493 - if(strtolower($grupo["ogc"]) == "sim"){  
494 - $imprimegrupo = "<i>".$grupo["nome"]."</i>";  
495 - foreach($grupo["subgrupos"] as $sgrupo){  
496 - if(strtolower($sgrupo["ogc"]) == "sim"){  
497 - $imprimesubgrupo = $sgrupo["nome"];  
498 - $temas = $m->pegaListaDeTemas($grupo["id_n1"],$sgrupo["id_n2"],$menu["idmenu"]);  
499 - foreach($temas as $tema){  
500 - if(strtolower($tema["ogc"]) == "sim" && strtolower($tema["down"]) !== "nao"){  
501 - $imprimir .= $imprimegrupo."->".$imprimesubgrupo."<br>";  
502 - $imprimir .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";  
503 - $imprimir .= "<span style=color:red >".$tema["tid"]."</span>";  
504 - $imprimir .= "&nbsp;-&nbsp;".$tema["nome"]."&nbsp";  
505 - $imprimir .= "&nbsp;<a href='".$urli3geo."/ogc.php?tema=".$tema["tid"]."&service=wfs&request=getcapabilities' >Getcapabilities</a>";  
506 - $imprimir .= "&nbsp;<a href='".$urli3geo."/ogc.php?tema=".$tema["tid"]."&SRS=EPSG:4618&WIDTH=500&HEIGHT=500&BBOX=-76.5125927,-39.3925675209,-29.5851853,9.49014852081&FORMAT=image/png&service=wfs&version=1.1.0&request=getfeature&typename=".$tema["tid"]."' >Getfeature </a>";  
507 - if($tema["link"] != " ")  
508 - $imprimir .= "&nbsp;&nbsp;<a href='".$tema["link"]."' >fonte</a>";  
509 - $imprimir .= "<br>";  
510 - }  
511 - }  
512 - }  
513 - }  
514 - }  
515 - }  
516 - }  
517 - echo $imprimir."</body></html>"; 483 +function ogc_imprimeListaDeTemasWfs(){
  484 + global $urli3geo,$perfil,$locaplic;
  485 + $m = new Menutemas("",$perfil,$locaplic,$urli3geo);
  486 + $menus = $m->pegaListaDeMenus();
  487 + echo '<html><head><title>WFS</title><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"><meta name="description" content="OGC"><meta name="keywords" content="WMS OGC mapa sig gis webmapping geo geoprocessamento interativo meio ambiente MMA cartografia geografia"> <meta name="robots" content="index,follow">';
  488 + echo "<body><b>Lista de temas por grupos e subgrupos e endere&ccedil;os de acesso aos dados por meio de Web Services WFS (os c&oacute;digos dos temas est&atilde;o em vermelho)</b><br><br>";
  489 + $imprimir = "";
  490 + foreach ($menus as $menu){
  491 + $grupos = $m->pegaListaDeGrupos($menu["idmenu"],$listasistemas="nao",$listasgrupos="sim");
  492 + foreach($grupos as $grupo){
  493 + if(strtolower($grupo["ogc"]) == "sim"){
  494 + $imprimegrupo = "<i>".$grupo["nome"]."</i>";
  495 + foreach($grupo["subgrupos"] as $sgrupo){
  496 + if(strtolower($sgrupo["ogc"]) == "sim"){
  497 + $imprimesubgrupo = $sgrupo["nome"];
  498 + $temas = $m->pegaListaDeTemas($grupo["id_n1"],$sgrupo["id_n2"],$menu["idmenu"]);
  499 + foreach($temas as $tema){
  500 + if(strtolower($tema["ogc"]) == "sim" && strtolower($tema["down"]) !== "nao"){
  501 + $imprimir .= $imprimegrupo."->".$imprimesubgrupo."<br>";
  502 + $imprimir .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
  503 + $imprimir .= "<span style=color:red >".$tema["tid"]."</span>";
  504 + $imprimir .= "&nbsp;-&nbsp;".$tema["nome"]."&nbsp";
  505 + $imprimir .= "&nbsp;<a href='".$urli3geo."/ogc.php?tema=".$tema["tid"]."&service=wfs&request=getcapabilities' >Getcapabilities</a>";
  506 + $imprimir .= "&nbsp;<a href='".$urli3geo."/ogc.php?tema=".$tema["tid"]."&SRS=EPSG:4618&service=wfs&version=1.1.0&request=getfeature&typename=".$tema["tid"]."' >Getfeature </a>";
  507 + if($tema["link"] != " ")
  508 + $imprimir .= "&nbsp;&nbsp;<a href='".$tema["link"]."' >fonte</a>";
  509 + $imprimir .= "<br>";
  510 + }
  511 + }
  512 + }
  513 + }
  514 + }
  515 + }
  516 + }
  517 + echo $imprimir."</body></html>";
518 } 518 }
519 function carregaCacheImagem($bbox,$layer,$w,$h,$cachedir=""){ 519 function carregaCacheImagem($bbox,$layer,$w,$h,$cachedir=""){
520 global $dir_tmp; 520 global $dir_tmp;