Commit c07479b0902279d6351236c0805e3f80c72212d7

Authored by Edmar Moretti
1 parent 5cdc2ca7
Exists in master

Correção na geração de mapfiles

classesphp/atlas_controle.php
... ... @@ -221,5 +221,7 @@ function gravaid()
221 221 }
222 222 $tmpfname = str_replace(".map","",$tmpfname).".map";
223 223 $m->save($tmpfname);
  224 + include(dirname(__FILE__)."/../ms_configura.php");
  225 + restauraCon($tmpfname,$postgis_mapa);
224 226 }
225 227 ?>
226 228 \ No newline at end of file
... ...
classesphp/classe_alteraclasse.php
... ... @@ -103,6 +103,8 @@ class Alteraclasse
103 103 exit();
104 104 }
105 105 $this->mapa->save($this->arquivo);
  106 + include(dirname(__FILE__)."/../ms_configura.php");
  107 + restauraCon($this->arquivo,$postgis_mapa);
106 108 }
107 109 /*
108 110 Function: aplicacoresrgb
... ...
classesphp/classe_analise.php
... ... @@ -184,6 +184,8 @@ class Analise
184 184 exit();
185 185 }
186 186 $this->mapa->save($this->arquivo);
  187 + include(dirname(__FILE__)."/../ms_configura.php");
  188 + restauraCon($this->arquivo,$postgis_mapa);
187 189 }
188 190  
189 191 /*
... ...
classesphp/classe_atributos.php
... ... @@ -147,6 +147,8 @@ class Atributos
147 147 $this->mapa->setProjection($this->projO);
148 148 }
149 149 $this->mapa->save($this->arquivo);
  150 + include(dirname(__FILE__)."/../ms_configura.php");
  151 + restauraCon($this->arquivo,$postgis_mapa);
150 152 }
151 153  
152 154 /*
... ...
classesphp/classe_escala.php
... ... @@ -87,8 +87,9 @@ Salva o mapfile atual
87 87 */
88 88 function salva()
89 89 {
90   - if (connection_aborted()){exit();}
91   - $this->mapa->save($this->arquivo);
  90 + $this->mapa->save($this->arquivo);
  91 + include(dirname(__FILE__)."/../ms_configura.php");
  92 + restauraCon($this->arquivo,$postgis_mapa);
92 93 }
93 94  
94 95 /*
... ...
classesphp/classe_legenda.php
... ... @@ -174,11 +174,10 @@ class Legenda
174 174 */
175 175 function salva()
176 176 {
177   - if (connection_aborted()){
178   - exit();
179   - }
180 177 $this->recalculaSLD();
181 178 $this->mapa->save($this->arquivo);
  179 + include(dirname(__FILE__)."/../ms_configura.php");
  180 + restauraCon($this->arquivo,$postgis_mapa);
182 181 }
183 182 /*
184 183 function: recalculaSLD
... ...
classesphp/classe_mapa.php
... ... @@ -121,10 +121,9 @@ class Mapa
121 121 */
122 122 function salva()
123 123 {
124   - if(connection_aborted()){
125   - exit();
126   - }
127 124 $this->mapa->save($this->arquivo);
  125 + include(dirname(__FILE__)."/../ms_configura.php");
  126 + restauraCon($this->arquivo,$postgis_mapa);
128 127 }
129 128 /*
130 129 Method: listaTemasBuscaRapida
... ... @@ -1728,38 +1727,7 @@ class Mapa
1728 1727 */
1729 1728 function converteWS($locaplic,$h)
1730 1729 {
1731   - //$nomews = str_replace(".map","ws.map",$this->arquivo);
1732 1730 $nomeurl = "/ogc.php?tema=".$this->arquivo;
1733   - /*
1734   - $w = $this->mapa->web;
1735   - $w->set("template","");
1736   - //adiciona os parametros no nivel do mapa
1737   - $this->mapa->setmetadata("wms_title","I3Geo");
1738   - $this->mapa->setmetadata("wms_onlineresource","http://".$h.$nomeurl);
1739   - $this->mapa->setmetadata("wms_srs","EPSG:4291");
1740   - $this->mapa->setmetadata("ows_enable_request","*");
1741   - //$this->mapa->setmetadata("wms_getcontext_enabled","1");
1742   - foreach ($this->layers as $layer)
1743   - {
1744   - $n = pegaNome($layer);
1745   - $layer->setmetadata("wms_title",$n);
1746   - $layer->setmetadata("wms_name",$n);
1747   - $layer->setmetadata("wms_srs","EPSG:4291 EPSG:4326");
1748   - //$layer->setmetadata("wms_getcontext_enabled","1");
1749   - $layer->setmetadata("WMS_INCLUDE_ITEMS","all");
1750   - //$layer->setmetadata("wms_onlineresource","http://".$h.$nomeurl);
1751   - $layer->set("status","ON");
1752   - $layer->set("template","none.htm");
1753   - $layer->setmetadata("gml_include_items","all");
1754   - $layer->set("dump",MS_TRUE);
1755   - $c = $layer->getclass(0);
1756   - if ($c->name == "")
1757   - {$c->name = " ";}
1758   - }
1759   - $eb = $this->mapa->scalebar;
1760   - $eb->set("status",MS_OFF);
1761   - $this->mapa->save($nomews);
1762   - */
1763 1731 return($nomeurl);
1764 1732 }
1765 1733 /*
... ...
classesphp/classe_navegacao.php
... ... @@ -78,8 +78,9 @@ Salva o mapfile atual
78 78 */
79 79 function salva()
80 80 {
81   - if (connection_aborted()){exit();}
82 81 $this->mapa->save($this->arquivo);
  82 + include(dirname(__FILE__)."/../ms_configura.php");
  83 + restauraCon($this->arquivo,$postgis_mapa);
83 84 }
84 85 /*
85 86 function: gravaImagemCorpo (depreciado)
... ...
classesphp/classe_selecao.php
... ... @@ -136,10 +136,11 @@ Salva o mapfile atual
136 136 */
137 137 function salva()
138 138 {
139   - if (connection_aborted()){exit();}
140 139 if($this->mapa->getmetadata("interface") == "googlemaps")
141 140 {$this->mapa->setProjection($this->projO);}
142 141 $this->mapa->save($this->arquivo);
  142 + include(dirname(__FILE__)."/../ms_configura.php");
  143 + restauraCon($this->arquivo,$postgis_mapa);
143 144 }
144 145 /*
145 146 function: nSel
... ...
classesphp/classe_shp.php
... ... @@ -127,10 +127,9 @@ Salva o mapfile atual
127 127 */
128 128 function salva()
129 129 {
130   - if (connection_aborted()){
131   - exit();
132   - }
133 130 $this->mapa->save($this->arquivo);
  131 + include(dirname(__FILE__)."/../ms_configura.php");
  132 + restauraCon($this->arquivo,$postgis_mapa);
134 133 }
135 134 /*
136 135 function: criaSHPvazio
... ...
classesphp/classe_temas.php
... ... @@ -170,8 +170,9 @@ Salva o mapfile atual
170 170 */
171 171 function salva()
172 172 {
173   - if (connection_aborted()){exit();}
174   - $this->mapa->save($this->arquivo);
  173 + $this->mapa->save($this->arquivo);
  174 + include(dirname(__FILE__)."/../ms_configura.php");
  175 + restauraCon($this->arquivo,$postgis_mapa);
175 176 }
176 177 /*
177 178 function: pegaMetadata
... ...
classesphp/classe_toponimia.php
... ... @@ -112,8 +112,9 @@ Salva o mapfile atual
112 112 */
113 113 function salva()
114 114 {
115   - if (connection_aborted()){exit();}
116   - $this->mapa->save($this->arquivo);
  115 + $this->mapa->save($this->arquivo);
  116 + include(dirname(__FILE__)."/../ms_configura.php");
  117 + restauraCon($this->arquivo,$postgis_mapa);
117 118 }
118 119 /*
119 120 function: criaToponimia
... ...
classesphp/funcoes_gerais.php
... ... @@ -310,6 +310,8 @@ $map_file {string} - Arquivo map file.
310 310 */
311 311 function copiaSeguranca($map_file)
312 312 {
  313 + include(dirname(__FILE__)."/../ms_configura.php");
  314 + restauraCon($map_file,$postgis_mapa);
313 315 if (file_exists($map_file))
314 316 {
315 317 if ($objMapa = @ms_newMapObj($map_file))
... ...
classesphp/mapa_googleearth.php
... ... @@ -272,15 +272,6 @@ function retornaWms($map_fileX,$postgis_mapa){
272 272 echo header("Content-type: image/png \n\n");
273 273 imagepng($img);
274 274 }
275   - /*
276   - $n = " ";
277   - foreach(array_keys($_GET) as $s){
278   - $n .= " key ".$s." and value ".$_GET[$s];
279   - }
280   - $l = $mapa->getlayerbyname("zee");
281   - $l->setmetadata("str",$n);
282   - $mapa->save($_GET["map"]);
283   - */
284 275 }
285 276  
286 277 function nomeRandomico($n=10)
... ...
json.php
... ... @@ -126,7 +126,7 @@ autoClasses($l,$oMap);
126 126 ms_newLayerObj($oMap, $l);
127 127  
128 128 $oMap->save($nomeMapfileTmp);
129   -
  129 +restauraCon($nomeMapfileTmp,$postgis_mapa);
130 130 validaAcessoTemas($nomeMapfileTmp,true);
131 131  
132 132 $oMap = ms_newMapobj($nomeMapfileTmp);
... ... @@ -312,10 +312,10 @@ function storymap($par){
312 312 );
313 313  
314 314 $contents = json_encode($j);
315   -
  315 +
316 316 $contents = json_decode($contents);
317 317 $contents = json_encode($contents);
318   -
  318 +
319 319  
320 320 file_put_contents($nomeArq.".json",$contents);
321 321 //envia
... ...
testamapfile.php
... ... @@ -387,6 +387,7 @@ function verifica($map,$solegenda,$tabela,$cache="sim"){
387 387 if(isset($tabela)){
388 388 include("classesphp/classe_atributos.php");
389 389 $t = new Atributos($destino,$map);
  390 + restauraCon($destino,$postgis_mapa);
390 391 $r = $t->itensTexto();
391 392 $colunas = explode(";",$r["itens"]);
392 393 $ncolunas = count($colunas);
... ... @@ -428,6 +429,7 @@ function verifica($map,$solegenda,$tabela,$cache="sim"){
428 429 }
429 430 else{
430 431 $mapa = ms_newMapObj($destino);
  432 + restauraCon($destino,$postgis_mapa);
431 433 $objImagem = @$mapa->draw();
432 434 //corrige o titulo da legenda
433 435 $numlayers = $mapa->numlayers;
... ...