Commit 33d9513680e9f8a3132d27f78c1b179c7f9ee657
1 parent
e4795a18
Exists in
master
and in
7 other branches
Correção na geração de mapfiles
Showing
17 changed files
with
34 additions
and
60 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesphp/atlas_controle.php
@@ -221,5 +221,7 @@ function gravaid() | @@ -221,5 +221,7 @@ function gravaid() | ||
221 | } | 221 | } |
222 | $tmpfname = str_replace(".map","",$tmpfname).".map"; | 222 | $tmpfname = str_replace(".map","",$tmpfname).".map"; |
223 | $m->save($tmpfname); | 223 | $m->save($tmpfname); |
224 | + include(dirname(__FILE__)."/../ms_configura.php"); | ||
225 | + restauraCon($tmpfname,$postgis_mapa); | ||
224 | } | 226 | } |
225 | ?> | 227 | ?> |
226 | \ No newline at end of file | 228 | \ No newline at end of file |
classesphp/classe_alteraclasse.php
@@ -103,6 +103,8 @@ class Alteraclasse | @@ -103,6 +103,8 @@ class Alteraclasse | ||
103 | exit(); | 103 | exit(); |
104 | } | 104 | } |
105 | $this->mapa->save($this->arquivo); | 105 | $this->mapa->save($this->arquivo); |
106 | + include(dirname(__FILE__)."/../ms_configura.php"); | ||
107 | + restauraCon($this->arquivo,$postgis_mapa); | ||
106 | } | 108 | } |
107 | /* | 109 | /* |
108 | Function: aplicacoresrgb | 110 | Function: aplicacoresrgb |
classesphp/classe_analise.php
@@ -184,6 +184,8 @@ class Analise | @@ -184,6 +184,8 @@ class Analise | ||
184 | exit(); | 184 | exit(); |
185 | } | 185 | } |
186 | $this->mapa->save($this->arquivo); | 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,6 +147,8 @@ class Atributos | ||
147 | $this->mapa->setProjection($this->projO); | 147 | $this->mapa->setProjection($this->projO); |
148 | } | 148 | } |
149 | $this->mapa->save($this->arquivo); | 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,8 +87,9 @@ Salva o mapfile atual | ||
87 | */ | 87 | */ |
88 | function salva() | 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,11 +174,10 @@ class Legenda | ||
174 | */ | 174 | */ |
175 | function salva() | 175 | function salva() |
176 | { | 176 | { |
177 | - if (connection_aborted()){ | ||
178 | - exit(); | ||
179 | - } | ||
180 | $this->recalculaSLD(); | 177 | $this->recalculaSLD(); |
181 | $this->mapa->save($this->arquivo); | 178 | $this->mapa->save($this->arquivo); |
179 | + include(dirname(__FILE__)."/../ms_configura.php"); | ||
180 | + restauraCon($this->arquivo,$postgis_mapa); | ||
182 | } | 181 | } |
183 | /* | 182 | /* |
184 | function: recalculaSLD | 183 | function: recalculaSLD |
classesphp/classe_mapa.php
@@ -121,10 +121,9 @@ class Mapa | @@ -121,10 +121,9 @@ class Mapa | ||
121 | */ | 121 | */ |
122 | function salva() | 122 | function salva() |
123 | { | 123 | { |
124 | - if(connection_aborted()){ | ||
125 | - exit(); | ||
126 | - } | ||
127 | $this->mapa->save($this->arquivo); | 124 | $this->mapa->save($this->arquivo); |
125 | + include(dirname(__FILE__)."/../ms_configura.php"); | ||
126 | + restauraCon($this->arquivo,$postgis_mapa); | ||
128 | } | 127 | } |
129 | /* | 128 | /* |
130 | Method: listaTemasBuscaRapida | 129 | Method: listaTemasBuscaRapida |
@@ -1728,38 +1727,7 @@ class Mapa | @@ -1728,38 +1727,7 @@ class Mapa | ||
1728 | */ | 1727 | */ |
1729 | function converteWS($locaplic,$h) | 1728 | function converteWS($locaplic,$h) |
1730 | { | 1729 | { |
1731 | - //$nomews = str_replace(".map","ws.map",$this->arquivo); | ||
1732 | $nomeurl = "/ogc.php?tema=".$this->arquivo; | 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 | return($nomeurl); | 1731 | return($nomeurl); |
1764 | } | 1732 | } |
1765 | /* | 1733 | /* |
classesphp/classe_navegacao.php
@@ -78,8 +78,9 @@ Salva o mapfile atual | @@ -78,8 +78,9 @@ Salva o mapfile atual | ||
78 | */ | 78 | */ |
79 | function salva() | 79 | function salva() |
80 | { | 80 | { |
81 | - if (connection_aborted()){exit();} | ||
82 | $this->mapa->save($this->arquivo); | 81 | $this->mapa->save($this->arquivo); |
82 | + include(dirname(__FILE__)."/../ms_configura.php"); | ||
83 | + restauraCon($this->arquivo,$postgis_mapa); | ||
83 | } | 84 | } |
84 | /* | 85 | /* |
85 | function: gravaImagemCorpo (depreciado) | 86 | function: gravaImagemCorpo (depreciado) |
classesphp/classe_selecao.php
@@ -136,10 +136,11 @@ Salva o mapfile atual | @@ -136,10 +136,11 @@ Salva o mapfile atual | ||
136 | */ | 136 | */ |
137 | function salva() | 137 | function salva() |
138 | { | 138 | { |
139 | - if (connection_aborted()){exit();} | ||
140 | if($this->mapa->getmetadata("interface") == "googlemaps") | 139 | if($this->mapa->getmetadata("interface") == "googlemaps") |
141 | {$this->mapa->setProjection($this->projO);} | 140 | {$this->mapa->setProjection($this->projO);} |
142 | $this->mapa->save($this->arquivo); | 141 | $this->mapa->save($this->arquivo); |
142 | + include(dirname(__FILE__)."/../ms_configura.php"); | ||
143 | + restauraCon($this->arquivo,$postgis_mapa); | ||
143 | } | 144 | } |
144 | /* | 145 | /* |
145 | function: nSel | 146 | function: nSel |
classesphp/classe_shp.php
@@ -127,10 +127,9 @@ Salva o mapfile atual | @@ -127,10 +127,9 @@ Salva o mapfile atual | ||
127 | */ | 127 | */ |
128 | function salva() | 128 | function salva() |
129 | { | 129 | { |
130 | - if (connection_aborted()){ | ||
131 | - exit(); | ||
132 | - } | ||
133 | $this->mapa->save($this->arquivo); | 130 | $this->mapa->save($this->arquivo); |
131 | + include(dirname(__FILE__)."/../ms_configura.php"); | ||
132 | + restauraCon($this->arquivo,$postgis_mapa); | ||
134 | } | 133 | } |
135 | /* | 134 | /* |
136 | function: criaSHPvazio | 135 | function: criaSHPvazio |
classesphp/classe_temas.php
@@ -170,8 +170,9 @@ Salva o mapfile atual | @@ -170,8 +170,9 @@ Salva o mapfile atual | ||
170 | */ | 170 | */ |
171 | function salva() | 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 | function: pegaMetadata | 178 | function: pegaMetadata |
classesphp/classe_toponimia.php
@@ -112,8 +112,9 @@ Salva o mapfile atual | @@ -112,8 +112,9 @@ Salva o mapfile atual | ||
112 | */ | 112 | */ |
113 | function salva() | 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 | function: criaToponimia | 120 | function: criaToponimia |
classesphp/funcoes_gerais.php
@@ -310,6 +310,8 @@ $map_file {string} - Arquivo map file. | @@ -310,6 +310,8 @@ $map_file {string} - Arquivo map file. | ||
310 | */ | 310 | */ |
311 | function copiaSeguranca($map_file) | 311 | function copiaSeguranca($map_file) |
312 | { | 312 | { |
313 | + include(dirname(__FILE__)."/../ms_configura.php"); | ||
314 | + restauraCon($map_file,$postgis_mapa); | ||
313 | if (file_exists($map_file)) | 315 | if (file_exists($map_file)) |
314 | { | 316 | { |
315 | if ($objMapa = @ms_newMapObj($map_file)) | 317 | if ($objMapa = @ms_newMapObj($map_file)) |
classesphp/mapa_googleearth.php
@@ -272,15 +272,6 @@ function retornaWms($map_fileX,$postgis_mapa){ | @@ -272,15 +272,6 @@ function retornaWms($map_fileX,$postgis_mapa){ | ||
272 | echo header("Content-type: image/png \n\n"); | 272 | echo header("Content-type: image/png \n\n"); |
273 | imagepng($img); | 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 | function nomeRandomico($n=10) | 277 | function nomeRandomico($n=10) |
json.php
@@ -126,7 +126,7 @@ autoClasses($l,$oMap); | @@ -126,7 +126,7 @@ autoClasses($l,$oMap); | ||
126 | ms_newLayerObj($oMap, $l); | 126 | ms_newLayerObj($oMap, $l); |
127 | 127 | ||
128 | $oMap->save($nomeMapfileTmp); | 128 | $oMap->save($nomeMapfileTmp); |
129 | - | 129 | +restauraCon($nomeMapfileTmp,$postgis_mapa); |
130 | validaAcessoTemas($nomeMapfileTmp,true); | 130 | validaAcessoTemas($nomeMapfileTmp,true); |
131 | 131 | ||
132 | $oMap = ms_newMapobj($nomeMapfileTmp); | 132 | $oMap = ms_newMapobj($nomeMapfileTmp); |
@@ -312,10 +312,10 @@ function storymap($par){ | @@ -312,10 +312,10 @@ function storymap($par){ | ||
312 | ); | 312 | ); |
313 | 313 | ||
314 | $contents = json_encode($j); | 314 | $contents = json_encode($j); |
315 | - | 315 | + |
316 | $contents = json_decode($contents); | 316 | $contents = json_decode($contents); |
317 | $contents = json_encode($contents); | 317 | $contents = json_encode($contents); |
318 | - | 318 | + |
319 | 319 | ||
320 | file_put_contents($nomeArq.".json",$contents); | 320 | file_put_contents($nomeArq.".json",$contents); |
321 | //envia | 321 | //envia |
testamapfile.php
@@ -387,6 +387,7 @@ function verifica($map,$solegenda,$tabela,$cache="sim"){ | @@ -387,6 +387,7 @@ function verifica($map,$solegenda,$tabela,$cache="sim"){ | ||
387 | if(isset($tabela)){ | 387 | if(isset($tabela)){ |
388 | include("classesphp/classe_atributos.php"); | 388 | include("classesphp/classe_atributos.php"); |
389 | $t = new Atributos($destino,$map); | 389 | $t = new Atributos($destino,$map); |
390 | + restauraCon($destino,$postgis_mapa); | ||
390 | $r = $t->itensTexto(); | 391 | $r = $t->itensTexto(); |
391 | $colunas = explode(";",$r["itens"]); | 392 | $colunas = explode(";",$r["itens"]); |
392 | $ncolunas = count($colunas); | 393 | $ncolunas = count($colunas); |
@@ -428,6 +429,7 @@ function verifica($map,$solegenda,$tabela,$cache="sim"){ | @@ -428,6 +429,7 @@ function verifica($map,$solegenda,$tabela,$cache="sim"){ | ||
428 | } | 429 | } |
429 | else{ | 430 | else{ |
430 | $mapa = ms_newMapObj($destino); | 431 | $mapa = ms_newMapObj($destino); |
432 | + restauraCon($destino,$postgis_mapa); | ||
431 | $objImagem = @$mapa->draw(); | 433 | $objImagem = @$mapa->draw(); |
432 | //corrige o titulo da legenda | 434 | //corrige o titulo da legenda |
433 | $numlayers = $mapa->numlayers; | 435 | $numlayers = $mapa->numlayers; |