Commit c60682524473c8a9434eb11f908577619891e0d1
1 parent
27bff40d
Exists in
master
and in
7 other branches
$1
Showing
2 changed files
with
29 additions
and
24 deletions
Show diff stats
admin/php/classe_metaestat.php
| @@ -532,22 +532,22 @@ class Metaestat{ | @@ -532,22 +532,22 @@ class Metaestat{ | ||
| 532 | $query="select codigo_tipo_regiao_pai as parent from ".$this->esquemaadmin."i3geoestat_agregaregiao WHERE codigo_tipo_regiao = $node"; | 532 | $query="select codigo_tipo_regiao_pai as parent from ".$this->esquemaadmin."i3geoestat_agregaregiao WHERE codigo_tipo_regiao = $node"; |
| 533 | $result=$this->execSQL($query,"",false); | 533 | $result=$this->execSQL($query,"",false); |
| 534 | $row = $result[0]; | 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 | // return the path | 547 | // return the path |
| 548 | sort($path); | 548 | sort($path); |
| 549 | - return $path; | ||
| 550 | - } | 549 | + return $path; |
| 550 | + } | ||
| 551 | /** | 551 | /** |
| 552 | * Cria um arquivo mapfile para uma medida de variavel | 552 | * Cria um arquivo mapfile para uma medida de variavel |
| 553 | * Inclui no arquivo o layer de acesso aos dados | 553 | * Inclui no arquivo o layer de acesso aos dados |
| @@ -799,7 +799,7 @@ class Metaestat{ | @@ -799,7 +799,7 @@ class Metaestat{ | ||
| 799 | $vis = str_replace(",,",",",$vis); | 799 | $vis = str_replace(",,",",",$vis); |
| 800 | $vis = explode(",",$vis); | 800 | $vis = explode(",",$vis); |
| 801 | $itens = $vis;//array | 801 | $itens = $vis;//array |
| 802 | - $vis[] = "gid"; | 802 | + $vis[] = $meta["identificador"]; |
| 803 | $vis = array_unique($vis); | 803 | $vis = array_unique($vis); |
| 804 | $visiveis = array(); | 804 | $visiveis = array(); |
| 805 | //verifica se as colunas existem mesmo | 805 | //verifica se as colunas existem mesmo |
| @@ -825,7 +825,7 @@ class Metaestat{ | @@ -825,7 +825,7 @@ class Metaestat{ | ||
| 825 | $apelidos = array(); | 825 | $apelidos = array(); |
| 826 | $vis = implode($colunastabela,","); | 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 | $sqlf = str_replace(",,",",",$sqlf); | 829 | $sqlf = str_replace(",,",",",$sqlf); |
| 830 | $outlinecolor = str_replace(","," ",$outlinecolor); | 830 | $outlinecolor = str_replace(","," ",$outlinecolor); |
| 831 | $dados[] = "MAP"; | 831 | $dados[] = "MAP"; |
ferramentas/saiku/esquemaxml.php
| @@ -87,14 +87,17 @@ for ($i=0;$i < $c;++$i){ | @@ -87,14 +87,17 @@ for ($i=0;$i < $c;++$i){ | ||
| 87 | } | 87 | } |
| 88 | } | 88 | } |
| 89 | if($codigo_tipo_regiao == ""){ | 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 | $regiao = ""; | 96 | $regiao = ""; |
| 94 | $item = ""; | 97 | $item = ""; |
| 95 | $registros = ""; | 98 | $registros = ""; |
| 96 | 99 | ||
| 97 | -$regioes = $m->listaTipoRegiao(); | 100 | + |
| 98 | $xml = "<Schema name='i3Geo Metaestat'>"; | 101 | $xml = "<Schema name='i3Geo Metaestat'>"; |
| 99 | //cria as dimensoes de tipo temporal | 102 | //cria as dimensoes de tipo temporal |
| 100 | $sqlAno = "select nu_ano from ".$saikuConfigDataSource['tabelaDimensaoTempo']." group by nu_ano order by nu_ano"; | 103 | $sqlAno = "select nu_ano from ".$saikuConfigDataSource['tabelaDimensaoTempo']." group by nu_ano order by nu_ano"; |
| @@ -239,12 +242,14 @@ $medidas = $m->listaMedidaVariavel(); | @@ -239,12 +242,14 @@ $medidas = $m->listaMedidaVariavel(); | ||
| 239 | $tbs = array(); | 242 | $tbs = array(); |
| 240 | 243 | ||
| 241 | foreach($medidas as $medida){ | 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 |