Commit c60682524473c8a9434eb11f908577619891e0d1

Authored by Edmar Moretti
1 parent 27bff40d

$1

admin/php/classe_metaestat.php
... ... @@ -532,22 +532,22 @@ class Metaestat{
532 532 $query="select codigo_tipo_regiao_pai as parent from ".$this->esquemaadmin."i3geoestat_agregaregiao WHERE codigo_tipo_regiao = $node";
533 533 $result=$this->execSQL($query,"",false);
534 534 $row = $result[0];
535   - // save the path in this array
536   - $path = array();
537   - // only continue if this $node isn't the root node
538   - // (that's the node with no parent)
539   - if ($row['parent']!='') {
540   - // the last part of the path to $node, is the name
541   - // of the parent of $node
542   - $path[] = $row['parent'];
543   - // we should add the path to the parent of this node
544   - // to the path
545   - $path = array_merge($this->hierarquiaPath($row['parent']), $path);
  535 + // save the path in this array
  536 + $path = array();
  537 + // only continue if this $node isn't the root node
  538 + // (that's the node with no parent)
  539 + if ($row['parent']!='') {
  540 + // the last part of the path to $node, is the name
  541 + // of the parent of $node
  542 + $path[] = $row['parent'];
  543 + // we should add the path to the parent of this node
  544 + // to the path
  545 + $path = array_merge($this->hierarquiaPath($row['parent']), $path);
546 546 }
547 547 // return the path
548 548 sort($path);
549   - return $path;
550   - }
  549 + return $path;
  550 + }
551 551 /**
552 552 * Cria um arquivo mapfile para uma medida de variavel
553 553 * Inclui no arquivo o layer de acesso aos dados
... ... @@ -799,7 +799,7 @@ class Metaestat{
799 799 $vis = str_replace(",,",",",$vis);
800 800 $vis = explode(",",$vis);
801 801 $itens = $vis;//array
802   - $vis[] = "gid";
  802 + $vis[] = $meta["identificador"];
803 803 $vis = array_unique($vis);
804 804 $visiveis = array();
805 805 //verifica se as colunas existem mesmo
... ... @@ -825,7 +825,7 @@ class Metaestat{
825 825 $apelidos = array();
826 826 $vis = implode($colunastabela,",");
827 827 }
828   - $sqlf = $colunageo." from (select st_setsrid(".$colunageo.",".$srid.") as $colunageo,$vis from ".$meta["esquemadb"].".".$meta["tabela"]." /*FW*//*FW*/) as foo using unique gid using srid=".$srid;
  828 + $sqlf = $colunageo." from (select st_setsrid(".$colunageo.",".$srid.") as $colunageo,$vis from ".$meta["esquemadb"].".".$meta["tabela"]." /*FW*//*FW*/) as foo using unique ".$meta["identificador"]." using srid=".$srid;
829 829 $sqlf = str_replace(",,",",",$sqlf);
830 830 $outlinecolor = str_replace(","," ",$outlinecolor);
831 831 $dados[] = "MAP";
... ...
ferramentas/saiku/esquemaxml.php
... ... @@ -87,14 +87,17 @@ for ($i=0;$i < $c;++$i){
87 87 }
88 88 }
89 89 if($codigo_tipo_regiao == ""){
90   - //echo "Nenhum tema com limites ou localidades foi encontrado";
91   - //exit;
  90 + $regioes = $m->listaTipoRegiao();
92 91 }
  92 +else{
  93 + $regioes[] = $m->listaTipoRegiao($codigo_tipo_regiao);
  94 +}
  95 +
93 96 $regiao = "";
94 97 $item = "";
95 98 $registros = "";
96 99  
97   -$regioes = $m->listaTipoRegiao();
  100 +
98 101 $xml = "<Schema name='i3Geo Metaestat'>";
99 102 //cria as dimensoes de tipo temporal
100 103 $sqlAno = "select nu_ano from ".$saikuConfigDataSource['tabelaDimensaoTempo']." group by nu_ano order by nu_ano";
... ... @@ -239,12 +242,14 @@ $medidas = $m-&gt;listaMedidaVariavel();
239 242 $tbs = array();
240 243  
241 244 foreach($medidas as $medida){
242   - $k = $medida["esquemadb"].$medida["tabela"];
243   - if(empty($tbs[$k])){
244   - $tbs[$k] = array($medida);
245   - }
246   - else{
247   - array_push($tbs[$k],$medida);
  245 + if($medida["codigo_tipo_regiao"] == $codigo_tipo_regiao){
  246 + $k = $medida["esquemadb"].$medida["tabela"];
  247 + if(empty($tbs[$k])){
  248 + $tbs[$k] = array($medida);
  249 + }
  250 + else{
  251 + array_push($tbs[$k],$medida);
  252 + }
248 253 }
249 254 }
250 255  
... ...