Commit 55885236462873282a9e5a1538ec24787134b358
1 parent
7f92c04b
Exists in
master
and in
7 other branches
--no commit message
Showing
3 changed files
with
34 additions
and
16 deletions
Show diff stats
admin/js/estat_variavel.js
... | ... | @@ -1016,14 +1016,17 @@ i3GEOadmin.variaveis = { |
1016 | 1016 | var callback = { |
1017 | 1017 | success: function(oResponse){ |
1018 | 1018 | var dados = YAHOO.lang.JSON.parse(oResponse.responseText); |
1019 | - dados = dados.grupos; | |
1020 | - if(dados == ""){ | |
1019 | + if(dados.grupos == undefined || dados.grupos == ""){ | |
1021 | 1020 | dados = dados.histograma; |
1022 | 1021 | } |
1022 | + else{ | |
1023 | + dados = dados.grupos; | |
1024 | + } | |
1023 | 1025 | //converte os dados para o padrao usado no grafico |
1024 | 1026 | abreDados = function(){ |
1025 | - i3GEOF.graficointerativo.dados = dados; | |
1026 | - i3GEOF.graficointerativo.montaTabelaDados = function(dados){ | |
1027 | + i3GEOF.graficointerativo1.dados = dados; | |
1028 | + i3GEOF.graficointerativo1.tipo = "bar_1"; | |
1029 | + i3GEOF.graficointerativo1.montaTabelaDados = function(dados){ | |
1027 | 1030 | var i=0, |
1028 | 1031 | v, |
1029 | 1032 | ins, |
... | ... | @@ -1048,9 +1051,9 @@ i3GEOadmin.variaveis = { |
1048 | 1051 | ins.push("</td><td>"); |
1049 | 1052 | ins.push($inputText("","",id+"_valor","digite o novo valor",12,v[1],"valor")); |
1050 | 1053 | ins.push("</td><td>"); |
1051 | - if($i("i3GEOgraficointerativoCoresA").checked){ | |
1054 | + //if($i("i3GEOgraficointerativoCoresA").checked){ | |
1052 | 1055 | cor = i3GEO.util.rgb2hex(i3GEO.util.randomRGB()); |
1053 | - } | |
1056 | + //} | |
1054 | 1057 | //verifica se no objeto com os dados existe um terceiro valor com as cores |
1055 | 1058 | if(v[2]){ |
1056 | 1059 | cor = i3GEO.util.rgb2hex(v[2]); |
... | ... | @@ -1064,19 +1067,19 @@ i3GEOadmin.variaveis = { |
1064 | 1067 | ins.push("</table><br>"); |
1065 | 1068 | //ins.push("<input type=hidden id=i3GEOgraficointerativoComboXid />"); |
1066 | 1069 | //ins.push("<input type=hidden id=i3GEOgraficointerativoComboYid />"); |
1067 | - $i("i3GEOgraficointerativoDados").innerHTML = ins.join(""); | |
1070 | + $i("i3GEOgraficointerativo1Dados").innerHTML = ins.join(""); | |
1068 | 1071 | if($i("agruparsql").value != ""){ |
1069 | 1072 | //$i("i3GEOgraficointerativoComboXid").value = $i("agruparsql").value; |
1070 | 1073 | //$i("i3GEOgraficointerativoComboYid").value = "Soma"; |
1071 | 1074 | } |
1072 | 1075 | }; |
1073 | - i3GEOF.graficointerativo.criaJanelaFlutuante(); | |
1076 | + i3GEOF.graficointerativo1.criaJanelaFlutuante(); | |
1074 | 1077 | core_carregando("desativa"); |
1075 | 1078 | }; |
1076 | 1079 | i3GEO.util.scriptTag( |
1077 | - "../../ferramentas/graficointerativo/index.js", | |
1080 | + "../../ferramentas/graficointerativo1/index.js", | |
1078 | 1081 | "abreDados()", |
1079 | - "i3GEOF.graficointerativo_script" | |
1082 | + "i3GEOF.graficointerativo1_script" | |
1080 | 1083 | ); |
1081 | 1084 | }, |
1082 | 1085 | failure:core_handleFailure, |
... | ... | @@ -1449,4 +1452,4 @@ i3GEOadmin.variaveis = { |
1449 | 1452 | } |
1450 | 1453 | |
1451 | 1454 | |
1452 | -}; | |
1453 | 1455 | \ No newline at end of file |
1456 | +}; | ... | ... |
admin/php/classe_metaestat.php
... | ... | @@ -291,6 +291,7 @@ class Metaestat{ |
291 | 291 | function sqlMedidaVariavel($id_medida_variavel,$todasascolunas,$agruparpor="",$tipolayer="polygon",$codigo_tipo_regiao = "",$suportaWMST = false){ |
292 | 292 | // |
293 | 293 | //o sql que faz acesso aos dados e marcado com /*SE*//*SE*/ na string que sera usada nos mapfiles |
294 | + //a parte que contem referencias a coluna com a geometria e marcada com /*SG*//*SG*/ | |
294 | 295 | // |
295 | 296 | $filtro = false; |
296 | 297 | $dados = $this->listaMedidaVariavel("",$id_medida_variavel); |
... | ... | @@ -365,7 +366,7 @@ class Metaestat{ |
365 | 366 | $colunasvisiveis = array_unique($colunasvisiveis); |
366 | 367 | $colunas = array_merge($colunas,$colunasvisiveis); |
367 | 368 | $vis = implode(",g.",$colunasvisiveis); |
368 | - $vis = "g.".$vis.",st_setsrid(g.".$colunageo.",".$dadosgeo["srid"].") as ".$colunageo; | |
369 | + $vis = "g.".$vis."/*SG*/,st_setsrid(g.".$colunageo.",".$dadosgeo["srid"].") as ".$colunageo."/*SG*/"; | |
369 | 370 | //$sqlgeo = $sql.",g.".$colunageo; |
370 | 371 | $sqlgeo = $sql.",".$vis; |
371 | 372 | // |
... | ... | @@ -398,7 +399,7 @@ class Metaestat{ |
398 | 399 | } |
399 | 400 | else{ |
400 | 401 | $dadosAgregacao = $this->listaAgregaRegiaoFilho($dados["codigo_tipo_regiao"], $codigo_tipo_regiao); |
401 | - $sqlgeo = "SELECT st_setsrid(g.".$colunageo.",".$dadosgeo["srid"].") as the_geom ,g.".$dadosAgregacao["colunaligacao_regiaopai"].",d.".$dados["colunavalor"]." as ".$dados["colunavalor"]; | |
402 | + $sqlgeo = "SELECT /*SG*/st_setsrid(g.".$colunageo.",".$dadosgeo["srid"].") as the_geom ,/*SG*/g.".$dadosAgregacao["colunaligacao_regiaopai"].",d.".$dados["colunavalor"]." as ".$dados["colunavalor"]; | |
402 | 403 | } |
403 | 404 | $tipoconta = ""; |
404 | 405 | if($dados["permitesoma"] == 1){ |
... | ... | @@ -426,12 +427,15 @@ class Metaestat{ |
426 | 427 | } |
427 | 428 | else{ |
428 | 429 | $sqlgeo .= " FROM (SELECT * FROM ".$dados["esquemadb"].".".$dados["tabela"] ." __dadosfiltro__ ) as d, ".$dadosgeo["esquemadb"].".".$dadosgeo["tabela"]." as g"; |
430 | + $parametrosMedida = ""; | |
431 | + /* | |
429 | 432 | if(count($parametrosMedida) > 0){ |
430 | 433 | $parametrosMedida = implode(",",$parametrosMedida).","; |
431 | 434 | } |
432 | 435 | else{ |
433 | 436 | $parametrosMedida = ""; |
434 | 437 | } |
438 | + */ | |
435 | 439 | //o campo deve ser convertido para data |
436 | 440 | if($suportaWMST == true){ |
437 | 441 | $parametrosMedida = $this->listaParametroTempo2CampoData($id_medida_variavel)." as dimtempo,"; |
... | ... | @@ -896,8 +900,14 @@ class Metaestat{ |
896 | 900 | function dadosMedidaVariavel($id_medida_variavel,$filtro="",$todasascolunas = 0,$agruparpor = "",$limite=""){ |
897 | 901 | set_time_limit(0); |
898 | 902 | $sql = $this->sqlMedidaVariavel($id_medida_variavel,$todasascolunas,$agruparpor); |
899 | - //var_dump($sql);exit; | |
900 | - $sqlf = $sql["sql"]; | |
903 | + $sqlf = $sql["sqlmapserver"]; | |
904 | + //remove marcadores geo | |
905 | + $sqlf = explode("/*SE*/",$sqlf)[1]; | |
906 | + $sqlf = explode("/*SG*/",$sqlf); | |
907 | + $sqlf = $sqlf[0]." ".$sqlf[2]; | |
908 | + $sqlf = str_replace("__filtro__",$filtro,$sqlf); | |
909 | +echo $sqlf;exit; | |
910 | + /* | |
901 | 911 | if($sql["filtro"] == true){ |
902 | 912 | if(!empty($filtro)){ |
903 | 913 | $sqlf = $sqlf." AND ".$filtro; |
... | ... | @@ -906,6 +916,7 @@ class Metaestat{ |
906 | 916 | elseif(!empty($filtro)){ |
907 | 917 | $sqlf .= " WHERE ".$filtro; |
908 | 918 | } |
919 | + * */ | |
909 | 920 | if($limite != ""){ |
910 | 921 | $sqlf .= " limit ".$limite; |
911 | 922 | } | ... | ... |
ogc.php
... | ... | @@ -474,7 +474,11 @@ else{ |
474 | 474 | } |
475 | 475 | $oMap->setSymbolSet($locaplic."/symbols/".basename($oMap->symbolsetfilename)); |
476 | 476 | $oMap->setFontSet($locaplic."/symbols/".basename($oMap->fontsetfilename)); |
477 | - $oMap->save($nomeMapfileTmp); | |
477 | + $oMap->save($nomeMapfileTmp); | |
478 | + $oMap = ms_newMapobj($nomeMapfileTmp); | |
479 | + if(ob_get_contents ()){ | |
480 | + ob_end_clean(); | |
481 | + } | |
478 | 482 | } |
479 | 483 | // |
480 | 484 | //verifica se a requisicao e do tipo TMS. Se for, tenta gerar ou usar o cache | ... | ... |