Commit e77b50fc5989f8df82fa4956e8a5bc43388a031e
1 parent
e3a52934
Exists in
master
and in
7 other branches
remocão de arquivos desnecessarios
Showing
2 changed files
with
61 additions
and
127 deletions
Show diff stats
ferramentas/parametrossql/ogc.php
1 | <?php | 1 | <?php |
2 | +exit; | ||
2 | /** | 3 | /** |
3 | Esse programa e uma adaptacao do codigo i3geo/ogc.php | 4 | Esse programa e uma adaptacao do codigo i3geo/ogc.php |
4 | E utilizado no mashup (i3geo/mashup) nas camadas que sao configuradas cm o plugin parametrossql | 5 | E utilizado no mashup (i3geo/mashup) nas camadas que sao configuradas cm o plugin parametrossql |
ogc.php
@@ -79,7 +79,7 @@ ogc.php?tema=/var/www/i3geo/aplicmap/geral1debianv6.map&layers=mundo | @@ -79,7 +79,7 @@ ogc.php?tema=/var/www/i3geo/aplicmap/geral1debianv6.map&layers=mundo | ||
79 | */ | 79 | */ |
80 | set_time_limit(0); | 80 | set_time_limit(0); |
81 | ini_set('memory_limit', '512M'); | 81 | ini_set('memory_limit', '512M'); |
82 | - | 82 | +include_once (dirname(__FILE__)."/classesphp/sani_request.php"); |
83 | if(isset($_GET["BBOX"])){ | 83 | if(isset($_GET["BBOX"])){ |
84 | $_GET["BBOX"] = str_replace(" ",",",$_GET["BBOX"]); | 84 | $_GET["BBOX"] = str_replace(" ",",",$_GET["BBOX"]); |
85 | } | 85 | } |
@@ -104,6 +104,10 @@ if(isset($_GET["TileMatrix"])){ | @@ -104,6 +104,10 @@ if(isset($_GET["TileMatrix"])){ | ||
104 | } | 104 | } |
105 | $_GET = array_merge($_GET,$_POST); | 105 | $_GET = array_merge($_GET,$_POST); |
106 | 106 | ||
107 | + | ||
108 | +if($_GET["id_medida_variavel"] != ""){ | ||
109 | + $_GET["id_medida_variavel"] = filter_var ( $_GET["id_medida_variavel"], FILTER_SANITIZE_NUMBER_INT); | ||
110 | +} | ||
107 | // | 111 | // |
108 | //caso nenhum parametros tenha sido enviado | 112 | //caso nenhum parametros tenha sido enviado |
109 | // | 113 | // |
@@ -125,18 +129,20 @@ if(isset($_GET["outputformat"]) && $_GET["outputformat"] != ""){ | @@ -125,18 +129,20 @@ if(isset($_GET["outputformat"]) && $_GET["outputformat"] != ""){ | ||
125 | $cache = true; | 129 | $cache = true; |
126 | //require_once(dirname(__FILE__)."/classesphp/carrega_ext.php"); | 130 | //require_once(dirname(__FILE__)."/classesphp/carrega_ext.php"); |
127 | include(dirname(__FILE__)."/ms_configura.php"); | 131 | include(dirname(__FILE__)."/ms_configura.php"); |
128 | -include(dirname(__FILE__)."/classesphp/pega_variaveis.php"); | ||
129 | include(dirname(__FILE__)."/classesphp/funcoes_gerais.php"); | 132 | include(dirname(__FILE__)."/classesphp/funcoes_gerais.php"); |
130 | // | 133 | // |
131 | //ajusta o default | 134 | //ajusta o default |
132 | // | 135 | // |
133 | -if(!isset($ows_geomtype) || $ows_geomtype == ""){ | 136 | +if(!isset($_GET["ows_geomtype"]) || $_GET["ows_geomtype"] == ""){ |
134 | $ows_geomtype = "none"; | 137 | $ows_geomtype = "none"; |
135 | } | 138 | } |
139 | +else{ | ||
140 | + $ows_geomtype = $_GET["ows_geomtype"]; | ||
141 | +} | ||
136 | // | 142 | // |
137 | //imprime na tela a ajuda | 143 | //imprime na tela a ajuda |
138 | // | 144 | // |
139 | -if(isset($ajuda)){ | 145 | +if(isset($_GET["ajuda"])){ |
140 | ogc_imprimeAjuda(); | 146 | ogc_imprimeAjuda(); |
141 | exit; | 147 | exit; |
142 | } | 148 | } |
@@ -149,44 +155,34 @@ $protocolo1 = strtolower($protocolo) . '://'.$_SERVER['SERVER_NAME']; | @@ -149,44 +155,34 @@ $protocolo1 = strtolower($protocolo) . '://'.$_SERVER['SERVER_NAME']; | ||
149 | $protocolo = strtolower($protocolo) . '://'.$_SERVER['SERVER_NAME'] .":". $_SERVER['SERVER_PORT']; | 155 | $protocolo = strtolower($protocolo) . '://'.$_SERVER['SERVER_NAME'] .":". $_SERVER['SERVER_PORT']; |
150 | $urli3geo = str_replace("/ogc.php","",$protocolo.$_SERVER["PHP_SELF"]); | 156 | $urli3geo = str_replace("/ogc.php","",$protocolo.$_SERVER["PHP_SELF"]); |
151 | // | 157 | // |
152 | -//imprime na tela a lista de temas disponiveis | ||
153 | -// | ||
154 | -if(isset($lista) && $lista != ""){ | ||
155 | - include_once(dirname(__FILE__)."/classesphp/classe_menutemas.php"); | ||
156 | - if($lista == "temas"){ | ||
157 | - ogc_imprimeListaDeTemas(); | ||
158 | - } | ||
159 | - if($lista == "temaswfs"){ | ||
160 | - ogc_imprimeListaDeTemasWfs(); | ||
161 | - } | ||
162 | - exit; | ||
163 | -} | ||
164 | -// | ||
165 | //define um nome para o mapfile caso a origem seja o sistema de metadados estatisticos | 158 | //define um nome para o mapfile caso a origem seja o sistema de metadados estatisticos |
166 | // | 159 | // |
167 | -if(isset($id_medida_variavel) && $id_medida_variavel != ""){ | ||
168 | - $tema = "ogcmetaestat".$id_medida_variavel; | 160 | +if(isset($_GET["id_medida_variavel"]) && $_GET["id_medida_variavel"] != ""){ |
161 | + $tema = "ogcmetaestat".$_GET["id_medida_variavel"]; | ||
169 | } | 162 | } |
170 | // | 163 | // |
171 | //compatibiliza variaveis | 164 | //compatibiliza variaveis |
172 | // | 165 | // |
173 | -if(!isset($tema) && isset($layers)){ | ||
174 | - $tema = $layers; | 166 | +if(!isset($tema) && isset($_GET["layers"])){ |
167 | + $tema = $_GET["layers"]; | ||
175 | } | 168 | } |
176 | -if(!isset($tema) && isset($LAYERS)){ | ||
177 | - $tema = $LAYERS; | 169 | +if(!isset($tema) && isset($_GET["LAYERS"])){ |
170 | + $tema = $_GET["LAYERS"]; | ||
178 | } | 171 | } |
179 | -if(!isset($tema) && isset($LAYER)){ | ||
180 | - $tema = $LAYER; | 172 | +if(!isset($tema) && isset($_GET["LAYER"])){ |
173 | + $tema = $_GET["LAYER"]; | ||
181 | } | 174 | } |
182 | -if(!isset($tema) && isset($temas)){ | ||
183 | - $tema = $temas; | 175 | +if(!isset($tema) && isset($_GET["temas"])){ |
176 | + $tema = $_GET["temas"]; | ||
184 | } | 177 | } |
185 | -if(isset($typeName)){ | ||
186 | - $typename = $typeName; | 178 | +if(isset($_GET["typeName"])){ |
179 | + $typename = $_GET["typeName"]; | ||
180 | + if(!isset($tema)){ | ||
181 | + $tema = $typename; | ||
182 | + } | ||
187 | } | 183 | } |
188 | -if(!isset($tema) && isset($typename)){ | ||
189 | - $tema = $typename; | 184 | +if(!isset($tema) && isset($_GET["typename"])){ |
185 | + $tema = $_GET["typename"]; | ||
190 | } | 186 | } |
191 | // | 187 | // |
192 | //garante que layers possam ser especificados de diferentes maneiras | 188 | //garante que layers possam ser especificados de diferentes maneiras |
@@ -199,6 +195,7 @@ if(!file_exists($tema)){ | @@ -199,6 +195,7 @@ if(!file_exists($tema)){ | ||
199 | 195 | ||
200 | $layers = $tema; | 196 | $layers = $tema; |
201 | //ajusta o OUTPUTFORMAT | 197 | //ajusta o OUTPUTFORMAT |
198 | +$OUTPUTFORMAT = $_GET["OUTPUTFORMAT"]; | ||
202 | if(strpos(strtolower($OUTPUTFORMAT),"kml") !== false){ | 199 | if(strpos(strtolower($OUTPUTFORMAT),"kml") !== false){ |
203 | $OUTPUTFORMAT = "kml"; | 200 | $OUTPUTFORMAT = "kml"; |
204 | } | 201 | } |
@@ -220,6 +217,7 @@ if(strtolower($OUTPUTFORMAT) == "kmz"){ | @@ -220,6 +217,7 @@ if(strtolower($OUTPUTFORMAT) == "kmz"){ | ||
220 | header("Location:".$urln); | 217 | header("Location:".$urln); |
221 | exit; | 218 | exit; |
222 | } | 219 | } |
220 | +$ogrOutput = $_GET["ogrOutput"]; | ||
223 | if(strtolower($OUTPUTFORMAT) == "kml" && $ogrOutput == false){ | 221 | if(strtolower($OUTPUTFORMAT) == "kml" && $ogrOutput == false){ |
224 | $urln = "pacotes/kmlmapserver/kmlservice.php?request=kmz&map=".$tema."&typename=".$tema; | 222 | $urln = "pacotes/kmlmapserver/kmlservice.php?request=kmz&map=".$tema."&typename=".$tema; |
225 | header("Location:".$urln); | 223 | header("Location:".$urln); |
@@ -239,6 +237,7 @@ if(strtolower($OUTPUTFORMAT) == "shape-zip" && $ogrOutput == false){ | @@ -239,6 +237,7 @@ if(strtolower($OUTPUTFORMAT) == "shape-zip" && $ogrOutput == false){ | ||
239 | // | 237 | // |
240 | //caso seja uma requisição WMS com format | 238 | //caso seja uma requisição WMS com format |
241 | // | 239 | // |
240 | +$format = $_GET["format"]; | ||
242 | if(strpos(strtolower($format),"kml") !== false){ | 241 | if(strpos(strtolower($format),"kml") !== false){ |
243 | $urln = "pacotes/kmlmapserver/kmlservice.php?request=kml&map=".$tema."&typename=".$tema; | 242 | $urln = "pacotes/kmlmapserver/kmlservice.php?request=kml&map=".$tema."&typename=".$tema; |
244 | header("Location:".$urln); | 243 | header("Location:".$urln); |
@@ -269,7 +268,7 @@ if(strtolower($OUTPUTFORMAT) == "geojson"){ | @@ -269,7 +268,7 @@ if(strtolower($OUTPUTFORMAT) == "geojson"){ | ||
269 | // | 268 | // |
270 | //recupera um mapa salvo no banco de administracao | 269 | //recupera um mapa salvo no banco de administracao |
271 | // | 270 | // |
272 | -if(!empty($restauramapa)){ | 271 | +if(!empty($_GET["restauramapa"])){ |
273 | restauraMapaSalvo(); | 272 | restauraMapaSalvo(); |
274 | } | 273 | } |
275 | // | 274 | // |
@@ -316,8 +315,8 @@ foreach ($_GET as $k=>$v){ | @@ -316,8 +315,8 @@ foreach ($_GET as $k=>$v){ | ||
316 | // | 315 | // |
317 | $req->setParameter("srsName",$req->getValueByName("SRS")); | 316 | $req->setParameter("srsName",$req->getValueByName("SRS")); |
318 | $listaepsg = $req->getValueByName("SRS")." EPSG:4618 EPSG:4291 EPSG:4326 EPSG:22521 EPSG:22522 EPSG:22523 EPSG:22524 EPSG:22525 EPSG:29101 EPSG:29119 EPSG:29120 EPSG:29121 EPSG:29122 EPSG:29177 EPSG:29178 EPSG:29179 EPSG:29180 EPSG:29181 EPSG:29182 EPSG:29183 EPSG:29184 EPSG:29185"; | 317 | $listaepsg = $req->getValueByName("SRS")." EPSG:4618 EPSG:4291 EPSG:4326 EPSG:22521 EPSG:22522 EPSG:22523 EPSG:22524 EPSG:22525 EPSG:29101 EPSG:29119 EPSG:29120 EPSG:29121 EPSG:29122 EPSG:29177 EPSG:29178 EPSG:29179 EPSG:29180 EPSG:29181 EPSG:29182 EPSG:29183 EPSG:29184 EPSG:29185"; |
319 | - | ||
320 | -if(isset($version) && !isset($VERSION)){ | 318 | +$VERSION = $_GET["VERSION"]; |
319 | +if(isset($_GET["version"]) && !isset($_GET["VERSION"])){ | ||
321 | $VERSION = $version; | 320 | $VERSION = $version; |
322 | } | 321 | } |
323 | if(!isset($VERSION) || $VERSION == ""){ | 322 | if(!isset($VERSION) || $VERSION == ""){ |
@@ -360,6 +359,7 @@ $arrayget["TileRow"] = ""; | @@ -360,6 +359,7 @@ $arrayget["TileRow"] = ""; | ||
360 | $nomeMapfileTmp = $dir_tmp."/ogc_".md5(implode("",$arrayget))."_".$agora.".map"; | 359 | $nomeMapfileTmp = $dir_tmp."/ogc_".md5(implode("",$arrayget))."_".$agora.".map"; |
361 | //essa variavel e usada para definir se a imagem final gerada devera ser cortada ou nao | 360 | //essa variavel e usada para definir se a imagem final gerada devera ser cortada ou nao |
362 | $cortePixels = 0; | 361 | $cortePixels = 0; |
362 | +$ogcwsmap = $_GET["ogcwsmap"]; | ||
363 | if(file_exists($nomeMapfileTmp) && $tipo == ""){ | 363 | if(file_exists($nomeMapfileTmp) && $tipo == ""){ |
364 | $oMap = ms_newMapobj($nomeMapfileTmp); | 364 | $oMap = ms_newMapobj($nomeMapfileTmp); |
365 | } | 365 | } |
@@ -405,7 +405,7 @@ else{ | @@ -405,7 +405,7 @@ else{ | ||
405 | //$temai3geo = true indica que o layer será buscado na pasta i3geo/temas | 405 | //$temai3geo = true indica que o layer será buscado na pasta i3geo/temas |
406 | $temai3geo = true; | 406 | $temai3geo = true; |
407 | //FIXME nao aceita gvp quando o caminho e completo | 407 | //FIXME nao aceita gvp quando o caminho e completo |
408 | - if(file_exists($_GET["tema"]) && !isset($id_medida_variavel)){ | 408 | + if(file_exists($_GET["tema"]) && !isset($_GET["id_medida_variavel"])){ |
409 | $nmap = ms_newMapobj($_GET["tema"]); | 409 | $nmap = ms_newMapobj($_GET["tema"]); |
410 | $temai3geo = false; | 410 | $temai3geo = false; |
411 | $nmap->setmetadata("ows_enable_request","*"); | 411 | $nmap->setmetadata("ows_enable_request","*"); |
@@ -413,7 +413,7 @@ else{ | @@ -413,7 +413,7 @@ else{ | ||
413 | foreach ($listatema as $tx){ | 413 | foreach ($listatema as $tx){ |
414 | $extensao = ".map"; | 414 | $extensao = ".map"; |
415 | if($temai3geo == true && file_exists($locaplic."/temas/".$tx.".php")){ | 415 | if($temai3geo == true && file_exists($locaplic."/temas/".$tx.".php")){ |
416 | - $extensao = ".php"; | 416 | + //$extensao = ".php"; |
417 | } | 417 | } |
418 | if($temai3geo == true && file_exists($locaplic."/temas/".$tx.".gvp")){ | 418 | if($temai3geo == true && file_exists($locaplic."/temas/".$tx.".gvp")){ |
419 | $extensao = ".gvp"; | 419 | $extensao = ".gvp"; |
@@ -421,23 +421,23 @@ else{ | @@ -421,23 +421,23 @@ else{ | ||
421 | if($extensao == ".map"){ | 421 | if($extensao == ".map"){ |
422 | //cria o mapfile com base no sistema de metadados estatisticos | 422 | //cria o mapfile com base no sistema de metadados estatisticos |
423 | //verifica se o id_medida_variavel existe no mapfile e nao foi passado como um parametro | 423 | //verifica se o id_medida_variavel existe no mapfile e nao foi passado como um parametro |
424 | - if(!isset($id_medida_variavel) && $temai3geo == true){ | 424 | + if(!isset($_GET["id_medida_variavel"]) && $temai3geo == true){ |
425 | $nmap = ms_newMapobj($locaplic."/temas/".$tx.".map"); | 425 | $nmap = ms_newMapobj($locaplic."/temas/".$tx.".map"); |
426 | $l = $nmap->getlayer(0); | 426 | $l = $nmap->getlayer(0); |
427 | $teste = $l->getmetadata("METAESTAT_ID_MEDIDA_VARIAVEL"); | 427 | $teste = $l->getmetadata("METAESTAT_ID_MEDIDA_VARIAVEL"); |
428 | if($teste != "" && $l->data == ""){ | 428 | if($teste != "" && $l->data == ""){ |
429 | - $id_medida_variavel = $teste; | 429 | + $_GET["id_medida_variavel"] = $teste; |
430 | } | 430 | } |
431 | } | 431 | } |
432 | - if(isset($id_medida_variavel)){ | 432 | + if(isset($_GET["id_medida_variavel"])){ |
433 | $temai3geo = false; | 433 | $temai3geo = false; |
434 | include("admin/php/classe_metaestat.php"); | 434 | include("admin/php/classe_metaestat.php"); |
435 | $m = new Metaestat(); | 435 | $m = new Metaestat(); |
436 | - $m->nomecache = "ogcmetaestat".$id_medida_variavel; | ||
437 | - $mapfileMetaestat = $m->mapfileMedidaVariavel($id_medida_variavel,"",1,"","","","","","",true); | 436 | + $m->nomecache = "ogcmetaestat".$_GET["id_medida_variavel"]; |
437 | + $mapfileMetaestat = $m->mapfileMedidaVariavel($_GET["id_medida_variavel"],"",1,"","","","","","",true); | ||
438 | $nmap = ms_newMapobj($mapfileMetaestat["mapfile"]); | 438 | $nmap = ms_newMapobj($mapfileMetaestat["mapfile"]); |
439 | $nmap->setmetadata("ows_enable_request","*"); | 439 | $nmap->setmetadata("ows_enable_request","*"); |
440 | - $req->setParameter("LAYERS", "ogcmetaestat".$id_medida_variavel); | 440 | + $req->setParameter("LAYERS", "ogcmetaestat".$_GET["id_medida_variavel"]); |
441 | } | 441 | } |
442 | if($temai3geo == true){ | 442 | if($temai3geo == true){ |
443 | $nmap = ms_newMapobj($locaplic."/temas/".$tx.".map"); | 443 | $nmap = ms_newMapobj($locaplic."/temas/".$tx.".map"); |
@@ -572,10 +572,7 @@ else{ | @@ -572,10 +572,7 @@ else{ | ||
572 | } | 572 | } |
573 | } | 573 | } |
574 | } | 574 | } |
575 | - if($extensao == ".php"){ | ||
576 | - include_once($locaplic."/temas/".$tx.".php"); | ||
577 | - eval($tx."(\$oMap);"); | ||
578 | - } | 575 | + |
579 | if($extensao == ".gvp"){ | 576 | if($extensao == ".gvp"){ |
580 | include_once($locaplic."/pacotes/gvsig/gvsig2mapfile/class.gvsig2mapfile.php"); | 577 | include_once($locaplic."/pacotes/gvsig/gvsig2mapfile/class.gvsig2mapfile.php"); |
581 | $gm = new gvsig2mapfile($locaplic."/temas/".$tx.".gvp"); | 578 | $gm = new gvsig2mapfile($locaplic."/temas/".$tx.".gvp"); |
@@ -633,7 +630,7 @@ else{ | @@ -633,7 +630,7 @@ else{ | ||
633 | $conta = 0; | 630 | $conta = 0; |
634 | $int = explode(",",$intervalo); | 631 | $int = explode(",",$intervalo); |
635 | $codigosTema = array(); | 632 | $codigosTema = array(); |
636 | - if(empty($perfil)){ | 633 | + if(empty($_GET["perfil"])){ |
637 | $perfil = ""; | 634 | $perfil = ""; |
638 | } | 635 | } |
639 | include("classesphp/classe_menutemas.php"); | 636 | include("classesphp/classe_menutemas.php"); |
@@ -721,8 +718,8 @@ else{ | @@ -721,8 +718,8 @@ else{ | ||
721 | echo "Erro no arquivo ".$locaplic."/temas/".$codigoTema.".map <br>"; | 718 | echo "Erro no arquivo ".$locaplic."/temas/".$codigoTema.".map <br>"; |
722 | $error = ms_GetErrorObj(); | 719 | $error = ms_GetErrorObj(); |
723 | while($error && $error->code != MS_NOERR){ | 720 | while($error && $error->code != MS_NOERR){ |
724 | - printf("<br>Error in %s: %s<br>\n", $error->routine, $error->message); | ||
725 | - $error = $error->next(); | 721 | + //printf("<br>Error in %s: %s<br>\n", $error->routine, $error->message); |
722 | + //$error = $error->next(); | ||
726 | } | 723 | } |
727 | } | 724 | } |
728 | } | 725 | } |
@@ -730,7 +727,8 @@ else{ | @@ -730,7 +727,8 @@ else{ | ||
730 | } | 727 | } |
731 | // | 728 | // |
732 | //a imagem do mapa recebera a legenda | 729 | //a imagem do mapa recebera a legenda |
733 | - // | 730 | + // |
731 | + $legenda = $_GET["legenda"]; | ||
734 | if((isset($legenda)) && (strtolower($legenda) == "sim")){ | 732 | if((isset($legenda)) && (strtolower($legenda) == "sim")){ |
735 | $leg = $oMap->legend; | 733 | $leg = $oMap->legend; |
736 | $leg->set("status",MS_EMBED); | 734 | $leg->set("status",MS_EMBED); |
@@ -743,6 +741,7 @@ else{ | @@ -743,6 +741,7 @@ else{ | ||
743 | //caso seja download ou json ou csv | 741 | //caso seja download ou json ou csv |
744 | // | 742 | // |
745 | processaOutputformatMapfile(); | 743 | processaOutputformatMapfile(); |
744 | + $nomeMapfileTmp = str_replace(".map","").".map"; | ||
746 | $oMap->save($nomeMapfileTmp); | 745 | $oMap->save($nomeMapfileTmp); |
747 | 746 | ||
748 | validaAcessoTemas($nomeMapfileTmp,true); | 747 | validaAcessoTemas($nomeMapfileTmp,true); |
@@ -881,8 +880,6 @@ if(isset($_GET["Z"]) && isset($_GET["X"])){ | @@ -881,8 +880,6 @@ if(isset($_GET["Z"]) && isset($_GET["X"])){ | ||
881 | $poPoint2->project($projInObj, $projOutObj); | 880 | $poPoint2->project($projInObj, $projOutObj); |
882 | $oMap->setsize(256,256); | 881 | $oMap->setsize(256,256); |
883 | $oMap->setExtent($poPoint1->x,$poPoint1->y,$poPoint2->x,$poPoint2->y); | 882 | $oMap->setExtent($poPoint1->x,$poPoint1->y,$poPoint2->x,$poPoint2->y); |
884 | - | ||
885 | - | ||
886 | 883 | ||
887 | $oMap->setProjection("proj=merc,a=6378137,b=6378137,lat_ts=0.0,lon_0=0.0,x_0=0.0,y_0=0,k=1.0,units=m"); | 884 | $oMap->setProjection("proj=merc,a=6378137,b=6378137,lat_ts=0.0,lon_0=0.0,x_0=0.0,y_0=0,k=1.0,units=m"); |
888 | 885 | ||
@@ -1124,84 +1121,16 @@ function ogc_imprimeAjuda(){ | @@ -1124,84 +1121,16 @@ function ogc_imprimeAjuda(){ | ||
1124 | echo "de dados de administracao para utiliza-lo como um WMS"; | 1121 | echo "de dados de administracao para utiliza-lo como um WMS"; |
1125 | } | 1122 | } |
1126 | function ogc_imprimeListaDeTemas(){ | 1123 | function ogc_imprimeListaDeTemas(){ |
1127 | - global $urli3geo,$perfil,$locaplic; | ||
1128 | - $m = new Menutemas("",$perfil,$locaplic,$urli3geo); | ||
1129 | - $menus = $m->pegaListaDeMenus(); | ||
1130 | - echo '<html><head><title>WMS</title><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"><meta name="description" content="OGC"><meta name="keywords" content="WMS OGC mapa sig gis webmapping geo geoprocessamento interativo meio ambiente MMA cartografia geografia"> <meta name="robots" content="index,follow">'; | ||
1131 | - echo "<body><b>Lista de temas por grupos e subgrupos e endereços de acesso aos dados por meio de Web Services WMS (os códigos dos temas estão em vermelho)</b><br><br>"; | ||
1132 | - $imprimir = ""; | ||
1133 | - foreach ($menus as $menu){ | ||
1134 | - $grupos = $m->pegaListaDeGrupos($menu["idmenu"],$listasistemas="nao",$listasgrupos="sim"); | ||
1135 | - foreach($grupos as $grupo){ | ||
1136 | - if(!empty($grupo["ogc"]) && strtolower($grupo["ogc"]) == "sim"){ | ||
1137 | - $imprimegrupo = "<i>".texto2iso($grupo["nome"])."</i>"; | ||
1138 | - foreach($grupo["subgrupos"] as $sgrupo){ | ||
1139 | - if(strtolower($sgrupo["ogc"]) == "sim"){ | ||
1140 | - $imprimesubgrupo = $sgrupo["nome"]; | ||
1141 | - $lts = $m->pegaListaDeTemas($grupo["id_n1"],$sgrupo["id_n2"],$menu["idmenu"]); | ||
1142 | - foreach($lts as $t){ | ||
1143 | - if(strtolower($t["ogc"]) == "sim"){ | ||
1144 | - $imprimir .= texto2iso($imprimegrupo)."->".texto2iso($imprimesubgrupo)."<br>"; | ||
1145 | - $imprimir .= " "; | ||
1146 | - $imprimir .= "<span style=color:red >".$t["tid"]."</span>"; | ||
1147 | - $imprimir .= " - ".texto2iso($t["nome"])." "; | ||
1148 | - $imprimir .= " <a href='".$urli3geo."/ogc.php?tema=".$t["tid"]."&service=wms&request=getcapabilities' >Getcapabilities</a>"; | ||
1149 | - $imprimir .= " <a href='".$urli3geo."/ogc.php?tema=".$t["tid"]."&SRS=EPSG:4618&WIDTH=500&HEIGHT=500&BBOX=-76.5125927,-39.3925675209,-29.5851853,9.49014852081&FORMAT=image/png&service=wms&version=1.1.0&request=getmap&layers=".$t["tid"]."' >GetMap </a>"; | ||
1150 | - if($t["link"] != " ") | ||
1151 | - $imprimir .= " <a href='".$t["link"]."' >fonte</a>"; | ||
1152 | - $imprimir .= "<br>"; | ||
1153 | - } | ||
1154 | - } | ||
1155 | - } | ||
1156 | - } | ||
1157 | - } | ||
1158 | - } | ||
1159 | - } | ||
1160 | - echo $imprimir."</body></html>"; | ||
1161 | } | 1124 | } |
1162 | function ogc_imprimeListaDeTemasWfs(){ | 1125 | function ogc_imprimeListaDeTemasWfs(){ |
1163 | - global $urli3geo,$perfil,$locaplic; | ||
1164 | - $m = new Menutemas("",$perfil,$locaplic,$urli3geo); | ||
1165 | - $menus = $m->pegaListaDeMenus(); | ||
1166 | - echo '<html><head><title>WFS</title><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"><meta name="description" content="OGC"><meta name="keywords" content="WMS OGC mapa sig gis webmapping geo geoprocessamento interativo meio ambiente MMA cartografia geografia"> <meta name="robots" content="index,follow">'; | ||
1167 | - echo "<body><b>Lista de temas por grupos e subgrupos e endereços de acesso aos dados por meio de Web Services WFS (os códigos dos temas estão em vermelho)</b><br><br>"; | ||
1168 | - $imprimir = ""; | ||
1169 | - foreach ($menus as $menu){ | ||
1170 | - $grupos = $m->pegaListaDeGrupos($menu["idmenu"],$listasistemas="nao",$listasgrupos="sim"); | ||
1171 | - foreach($grupos as $grupo){ | ||
1172 | - if(strtolower($grupo["ogc"]) == "sim"){ | ||
1173 | - $imprimegrupo = "<i>".$grupo["nome"]."</i>"; | ||
1174 | - foreach($grupo["subgrupos"] as $sgrupo){ | ||
1175 | - if(strtolower($sgrupo["ogc"]) == "sim"){ | ||
1176 | - $imprimesubgrupo = $sgrupo["nome"]; | ||
1177 | - $lts = $m->pegaListaDeTemas($grupo["id_n1"],$sgrupo["id_n2"],$menu["idmenu"]); | ||
1178 | - foreach($lts as $t){ | ||
1179 | - if(strtolower($t["ogc"]) == "sim" && strtolower($t["down"]) !== "nao"){ | ||
1180 | - $imprimir .= $imprimegrupo."->".$imprimesubgrupo."<br>"; | ||
1181 | - $imprimir .= " "; | ||
1182 | - $imprimir .= "<span style=color:red >".$t["tid"]."</span>"; | ||
1183 | - $imprimir .= " - ".$t["nome"]." "; | ||
1184 | - $imprimir .= " <a href='".$urli3geo."/ogc.php?tema=".$t["tid"]."&service=wfs&request=getcapabilities' >Getcapabilities</a>"; | ||
1185 | - $imprimir .= " <a href='".$urli3geo."/ogc.php?tema=".$t["tid"]."&SRS=EPSG:4618&service=wfs&version=1.1.0&request=getfeature&typename=".$t["tid"]."' >Getfeature </a>"; | ||
1186 | - if($t["link"] != " ") | ||
1187 | - $imprimir .= " <a href='".$t["link"]."' >fonte</a>"; | ||
1188 | - $imprimir .= "<br>"; | ||
1189 | - } | ||
1190 | - } | ||
1191 | - } | ||
1192 | - } | ||
1193 | - } | ||
1194 | - } | ||
1195 | - } | ||
1196 | - echo $imprimir."</body></html>"; | ||
1197 | } | 1126 | } |
1198 | function carregaCacheImagem($cachedir,$map,$tms){ | 1127 | function carregaCacheImagem($cachedir,$map,$tms){ |
1199 | global $dir_tmp; | 1128 | global $dir_tmp; |
1200 | if($cachedir == ""){ | 1129 | if($cachedir == ""){ |
1201 | - $nome = $dir_tmp."/cache".$tms; | 1130 | + $nome = $dir_tmp."/cache".$tms.".png"; |
1202 | } | 1131 | } |
1203 | else{ | 1132 | else{ |
1204 | - $nome = $cachedir.$tms; | 1133 | + $nome = $cachedir.$tms.".png"; |
1205 | } | 1134 | } |
1206 | if(file_exists($nome)){ | 1135 | if(file_exists($nome)){ |
1207 | header('Content-Length: '.filesize($nome)); | 1136 | header('Content-Length: '.filesize($nome)); |
@@ -1217,6 +1146,7 @@ function carregaCacheImagem($cachedir,$map,$tms){ | @@ -1217,6 +1146,7 @@ function carregaCacheImagem($cachedir,$map,$tms){ | ||
1217 | } | 1146 | } |
1218 | function salvaCacheImagem($cachedir,$map,$tms){ | 1147 | function salvaCacheImagem($cachedir,$map,$tms){ |
1219 | global $img,$dir_tmp,$cortePixels; | 1148 | global $img,$dir_tmp,$cortePixels; |
1149 | + //por seguranca | ||
1220 | if($cachedir == ""){ | 1150 | if($cachedir == ""){ |
1221 | $nome = $dir_tmp."/cache".$tms; | 1151 | $nome = $dir_tmp."/cache".$tms; |
1222 | } | 1152 | } |
@@ -1225,7 +1155,8 @@ function salvaCacheImagem($cachedir,$map,$tms){ | @@ -1225,7 +1155,8 @@ function salvaCacheImagem($cachedir,$map,$tms){ | ||
1225 | } | 1155 | } |
1226 | @mkdir(dirname($nome),0774,true); | 1156 | @mkdir(dirname($nome),0774,true); |
1227 | chmod(dirname($nome),0774); | 1157 | chmod(dirname($nome),0774); |
1228 | - $img->saveImage($nome); | 1158 | + |
1159 | + $img->saveImage($nome.".png"); | ||
1229 | // | 1160 | // |
1230 | //corta a imagem gerada para voltar ao tamanho normal | 1161 | //corta a imagem gerada para voltar ao tamanho normal |
1231 | // | 1162 | // |
@@ -1241,7 +1172,7 @@ function salvaCacheImagem($cachedir,$map,$tms){ | @@ -1241,7 +1172,7 @@ function salvaCacheImagem($cachedir,$map,$tms){ | ||
1241 | imagecopy($imgc, $img, 0 , 0 , $cortePixels , $cortePixels , 256, 256); | 1172 | imagecopy($imgc, $img, 0 , 0 , $cortePixels , $cortePixels , 256, 256); |
1242 | imagepng($imgc,$nome); | 1173 | imagepng($imgc,$nome); |
1243 | } | 1174 | } |
1244 | - chmod($nome,0777); | 1175 | + chmod($nome,0774); |
1245 | header('Content-Length: '.filesize($nome)); | 1176 | header('Content-Length: '.filesize($nome)); |
1246 | header('Content-Type: image/png'); | 1177 | header('Content-Type: image/png'); |
1247 | header('Cache-Control: max-age=3600, must-revalidate'); | 1178 | header('Cache-Control: max-age=3600, must-revalidate'); |
@@ -1496,10 +1427,10 @@ function exportaCsv(){ | @@ -1496,10 +1427,10 @@ function exportaCsv(){ | ||
1496 | 1427 | ||
1497 | } | 1428 | } |
1498 | $contents = implode("\n",$linhas); | 1429 | $contents = implode("\n",$linhas); |
1499 | - file_put_contents($arq,$contents); | 1430 | + file_put_contents($arq.".csv",$contents); |
1500 | //envia para download | 1431 | //envia para download |
1501 | ob_clean(); | 1432 | ob_clean(); |
1502 | - header('Content-Disposition: attachment; filename='.$fileName); | 1433 | + header('Content-Disposition: attachment; filename='.$fileName.".csv"); |
1503 | header("Content-type: text/csv"); | 1434 | header("Content-type: text/csv"); |
1504 | echo $contents; | 1435 | echo $contents; |
1505 | exit; | 1436 | exit; |
@@ -1545,7 +1476,7 @@ function exportaGeojson(){ | @@ -1545,7 +1476,7 @@ function exportaGeojson(){ | ||
1545 | ); | 1476 | ); |
1546 | $contents = json_encode($n[0]); | 1477 | $contents = json_encode($n[0]); |
1547 | $contents = str_replace('\"','',$contents); | 1478 | $contents = str_replace('\"','',$contents); |
1548 | - file_put_contents($arq,$contents); | 1479 | + file_put_contents($arq.".json",$contents); |
1549 | ob_clean(); | 1480 | ob_clean(); |
1550 | header("Content-type: application/json; subtype=geojson"); | 1481 | header("Content-type: application/json; subtype=geojson"); |
1551 | echo $contents; | 1482 | echo $contents; |
@@ -1560,6 +1491,7 @@ function converteenc($texto){ | @@ -1560,6 +1491,7 @@ function converteenc($texto){ | ||
1560 | } | 1491 | } |
1561 | function processaPluginI3geo(){ | 1492 | function processaPluginI3geo(){ |
1562 | global $oMap, $locaplic; | 1493 | global $oMap, $locaplic; |
1494 | + return; | ||
1563 | $numlayers = $oMap->numlayers; | 1495 | $numlayers = $oMap->numlayers; |
1564 | for ($i=0;$i < $numlayers;$i++){ | 1496 | for ($i=0;$i < $numlayers;$i++){ |
1565 | $l = $oMap->getlayer($i); | 1497 | $l = $oMap->getlayer($i); |
@@ -1620,6 +1552,7 @@ function processaPluginI3geo(){ | @@ -1620,6 +1552,7 @@ function processaPluginI3geo(){ | ||
1620 | } | 1552 | } |
1621 | //utilizada para obter os dados default quando se utiliza o plugin parametrossql | 1553 | //utilizada para obter os dados default quando se utiliza o plugin parametrossql |
1622 | function execProg($prog){ | 1554 | function execProg($prog){ |
1555 | + return; | ||
1623 | include($prog); | 1556 | include($prog); |
1624 | //$retorno variavel deve ser retornada pelo programa $prog | 1557 | //$retorno variavel deve ser retornada pelo programa $prog |
1625 | //veja como exemplo i3geo/aplicmap/daods/listaano.php | 1558 | //veja como exemplo i3geo/aplicmap/daods/listaano.php |