Commit 72733ab8e879b34ecbed138ddeb508c3ec8dfea2
1 parent
fcb7d40d
Exists in
master
atualização do codigo
Showing
5 changed files
with
11 additions
and
12 deletions
Show diff stats
classesphp/funcoes_gerais.php
@@ -445,8 +445,7 @@ Envia para o navegador uma imagem. Utilizado na tag IMG em arquivos HTML | @@ -445,8 +445,7 @@ Envia para o navegador uma imagem. Utilizado na tag IMG em arquivos HTML | ||
445 | function echoimg($arquivo,$tipo){ | 445 | function echoimg($arquivo,$tipo){ |
446 | echo header("Content-type: image/png \n\n"); | 446 | echo header("Content-type: image/png \n\n"); |
447 | header('Content-Length: '.filesize($arquivo)); | 447 | header('Content-Length: '.filesize($arquivo)); |
448 | - //fpassthru(fopen($arquivo, 'rb')); | ||
449 | - readfile($arquivo); | 448 | + readfile(str_replace(".png","",$arquivo).".png"); |
450 | exit; | 449 | exit; |
451 | } | 450 | } |
452 | /* | 451 | /* |
@@ -2292,7 +2291,7 @@ Retorno: | @@ -2292,7 +2291,7 @@ Retorno: | ||
2292 | */ | 2291 | */ |
2293 | function removeAcentos($var) | 2292 | function removeAcentos($var) |
2294 | { | 2293 | { |
2295 | - $a = array('À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'ß', 'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'ÿ', 'A', 'a', 'A', 'a', 'A', 'a', 'C', 'c', 'C', 'c', 'C', 'c', 'C', 'c', 'D', 'd', 'Ð', 'd', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'G', 'g', 'G', 'g', 'G', 'g', 'G', 'g', 'H', 'h', 'H', 'h', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', '?', '?', 'J', 'j', 'K', 'k', 'L', 'l', 'L', 'l', 'L', 'l', '?', '?', 'L', 'l', 'N', 'n', 'N', 'n', 'N', 'n', '?', 'O', 'o', 'O', 'o', 'O', 'o', 'Œ', 'œ', 'R', 'r', 'R', 'r', 'R', 'r', 'S', 's', 'S', 's', 'S', 's', 'Š', 'š', 'T', 't', 'T', 't', 'T', 't', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'W', 'w', 'Y', 'y', 'Ÿ', 'Z', 'z', 'Z', 'z', 'Ž', 'ž', '?', 'ƒ', 'O', 'o', 'U', 'u', 'A', 'a', 'I', 'i', 'O', 'o', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', '?', '?', '?', '?', '?', '?'); | 2294 | + $a = array('�', 'Á', 'Â', 'Ã', '�', '�', '�', 'Ç', '�', 'É', 'Ê', '�', '�', 'Í', '�', '�', '�', '�', '�', '�', 'Ô', 'Õ', '�', '�', '�', 'Ú', '�', '�', '�', '�', '�', 'á', 'â', 'ã', '�', '�', '�', 'ç', '�', 'é', 'ê', '�', '�', 'í', '�', '�', '�', '�', '�', 'ô', 'õ', '�', '�', '�', 'ú', '�', '�', '�', '�', 'A', 'a', 'A', 'a', 'A', 'a', 'C', 'c', 'C', 'c', 'C', 'c', 'C', 'c', 'D', 'd', '�', 'd', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'G', 'g', 'G', 'g', 'G', 'g', 'G', 'g', 'H', 'h', 'H', 'h', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', '?', '?', 'J', 'j', 'K', 'k', 'L', 'l', 'L', 'l', 'L', 'l', '?', '?', 'L', 'l', 'N', 'n', 'N', 'n', 'N', 'n', '?', 'O', 'o', 'O', 'o', 'O', 'o', '�', '�', 'R', 'r', 'R', 'r', 'R', 'r', 'S', 's', 'S', 's', 'S', 's', '�', '�', 'T', 't', 'T', 't', 'T', 't', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'W', 'w', 'Y', 'y', '�', 'Z', 'z', 'Z', 'z', '�', '�', '?', '�', 'O', 'o', 'U', 'u', 'A', 'a', 'I', 'i', 'O', 'o', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', '?', '?', '?', '?', '?', '?'); |
2296 | $b = array('A', 'A', 'A', 'A', 'A', 'A', 'AE', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I', 'D', 'N', 'O', 'O', 'O', 'O', 'O', 'O', 'U', 'U', 'U', 'U', 'Y', 's', 'a', 'a', 'a', 'a', 'a', 'a', 'ae', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i', 'n', 'o', 'o', 'o', 'o', 'o', 'o', 'u', 'u', 'u', 'u', 'y', 'y', 'A', 'a', 'A', 'a', 'A', 'a', 'C', 'c', 'C', 'c', 'C', 'c', 'C', 'c', 'D', 'd', 'D', 'd', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'G', 'g', 'G', 'g', 'G', 'g', 'G', 'g', 'H', 'h', 'H', 'h', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'IJ', 'ij', 'J', 'j', 'K', 'k', 'L', 'l', 'L', 'l', 'L', 'l', 'L', 'l', 'L', 'l', 'N', 'n', 'N', 'n', 'N', 'n', 'n', 'O', 'o', 'O', 'o', 'O', 'o', 'OE', 'oe', 'R', 'r', 'R', 'r', 'R', 'r', 'S', 's', 'S', 's', 'S', 's', 'S', 's', 'T', 't', 'T', 't', 'T', 't', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'W', 'w', 'Y', 'y', 'Y', 'Z', 'z', 'Z', 'z', 'Z', 'z', 's', 'f', 'O', 'o', 'U', 'u', 'A', 'a', 'I', 'i', 'O', 'o', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'A', 'a', 'AE', 'ae', 'O', 'o'); | 2295 | $b = array('A', 'A', 'A', 'A', 'A', 'A', 'AE', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I', 'D', 'N', 'O', 'O', 'O', 'O', 'O', 'O', 'U', 'U', 'U', 'U', 'Y', 's', 'a', 'a', 'a', 'a', 'a', 'a', 'ae', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i', 'n', 'o', 'o', 'o', 'o', 'o', 'o', 'u', 'u', 'u', 'u', 'y', 'y', 'A', 'a', 'A', 'a', 'A', 'a', 'C', 'c', 'C', 'c', 'C', 'c', 'C', 'c', 'D', 'd', 'D', 'd', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'G', 'g', 'G', 'g', 'G', 'g', 'G', 'g', 'H', 'h', 'H', 'h', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'IJ', 'ij', 'J', 'j', 'K', 'k', 'L', 'l', 'L', 'l', 'L', 'l', 'L', 'l', 'L', 'l', 'N', 'n', 'N', 'n', 'N', 'n', 'n', 'O', 'o', 'O', 'o', 'O', 'o', 'OE', 'oe', 'R', 'r', 'R', 'r', 'R', 'r', 'S', 's', 'S', 's', 'S', 's', 'S', 's', 'T', 't', 'T', 't', 'T', 't', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'W', 'w', 'Y', 'y', 'Y', 'Z', 'z', 'Z', 'z', 'Z', 'z', 's', 'f', 'O', 'o', 'U', 'u', 'A', 'a', 'I', 'i', 'O', 'o', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'A', 'a', 'AE', 'ae', 'O', 'o'); |
2297 | return str_replace($a, $b, $var); | 2296 | return str_replace($a, $b, $var); |
2298 | } | 2297 | } |
classesphp/mapa_googlemaps.php
@@ -257,7 +257,6 @@ else{ | @@ -257,7 +257,6 @@ else{ | ||
257 | //qd a cahamda e para um WMS, redireciona para ogc.php | 257 | //qd a cahamda e para um WMS, redireciona para ogc.php |
258 | // | 258 | // |
259 | if($_GET["REQUEST"] == "GetFeatureInfo" || $_GET["REQUEST"] == "getfeature"){ | 259 | if($_GET["REQUEST"] == "GetFeatureInfo" || $_GET["REQUEST"] == "getfeature"){ |
260 | - //echo $_GET["mapext"];exit; | ||
261 | if($_GET["REQUEST"] == "GetFeatureInfo"){ | 260 | if($_GET["REQUEST"] == "GetFeatureInfo"){ |
262 | $mapa->setsize(256,256); | 261 | $mapa->setsize(256,256); |
263 | $mapext = explode(",",$_GET["BBOX"]); | 262 | $mapext = explode(",",$_GET["BBOX"]); |
@@ -483,7 +482,7 @@ function salvaCacheImagem(){ | @@ -483,7 +482,7 @@ function salvaCacheImagem(){ | ||
483 | } | 482 | } |
484 | $c = $cachedir."/googlemaps/$layer/$z/$x"; | 483 | $c = $cachedir."/googlemaps/$layer/$z/$x"; |
485 | if(!file_exists($c."/$y.png")){ | 484 | if(!file_exists($c."/$y.png")){ |
486 | - mkdir($cachedir."/googlemaps/$layer/$z/$x",0777,true); | 485 | + mkdir($cachedir."/googlemaps/$layer/$z/$x",0744,true); |
487 | $img->saveImage($c."/$y.png"); | 486 | $img->saveImage($c."/$y.png"); |
488 | // | 487 | // |
489 | //corta a imagem gerada para voltar ao tamanho normal | 488 | //corta a imagem gerada para voltar ao tamanho normal |
@@ -492,8 +491,8 @@ function salvaCacheImagem(){ | @@ -492,8 +491,8 @@ function salvaCacheImagem(){ | ||
492 | $img = cortaImagemDisco($c."/$y.png",$cortePixels,256); | 491 | $img = cortaImagemDisco($c."/$y.png",$cortePixels,256); |
493 | } | 492 | } |
494 | 493 | ||
495 | - chmod($cachedir."/googlemaps/$layer/$z/$x",0777); | ||
496 | - chmod($c."/$y.png",0777); | 494 | + chmod($cachedir."/googlemaps/$layer/$z/$x",0744); |
495 | + chmod($c."/$y.png",0744); | ||
497 | } | 496 | } |
498 | return $c."/$y.png"; | 497 | return $c."/$y.png"; |
499 | } | 498 | } |
classesphp/mapa_openlayers.php
@@ -87,7 +87,6 @@ if(isset($_GET["tms"])){ | @@ -87,7 +87,6 @@ if(isset($_GET["tms"])){ | ||
87 | $lat1 = $y / $n * 180.0 - 90.0; | 87 | $lat1 = $y / $n * 180.0 - 90.0; |
88 | $lat2 = ($y+1) / $n * 180.0 - 90; | 88 | $lat2 = ($y+1) / $n * 180.0 - 90; |
89 | $_GET["BBOX"] = $lon1." ".$lat1." ".$lon2." ".$lat2; | 89 | $_GET["BBOX"] = $lon1." ".$lat1." ".$lon2." ".$lat2; |
90 | - //echo $_GET["BBOX"];exit; | ||
91 | } | 90 | } |
92 | 91 | ||
93 | //para o caso da versao 3 do OpenLayers | 92 | //para o caso da versao 3 do OpenLayers |
@@ -103,7 +102,6 @@ if(isset($_GET["X"]) && !($_GET["REQUEST"] == "getfeatureinfo" || $_GET["REQUEST | @@ -103,7 +102,6 @@ if(isset($_GET["X"]) && !($_GET["REQUEST"] == "getfeatureinfo" || $_GET["REQUEST | ||
103 | $_GET["WIDTH"] = 256; | 102 | $_GET["WIDTH"] = 256; |
104 | $_GET["HEIGHT"] = 256; | 103 | $_GET["HEIGHT"] = 256; |
105 | $_GET["tms"] = "/".$_GET["layer"]."/".$z."/".$x."/".$y.".png"; | 104 | $_GET["tms"] = "/".$_GET["layer"]."/".$z."/".$x."/".$y.".png"; |
106 | - | ||
107 | } | 105 | } |
108 | 106 | ||
109 | if(isset($_GET["TileMatrix"])){ | 107 | if(isset($_GET["TileMatrix"])){ |
ferramentas/parametrossql/ogc.php
@@ -493,6 +493,7 @@ function renderNocacheTms(){ | @@ -493,6 +493,7 @@ function renderNocacheTms(){ | ||
493 | header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . ' GMT'); | 493 | header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . ' GMT'); |
494 | header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($nomer)).' GMT', true, 200); | 494 | header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($nomer)).' GMT', true, 200); |
495 | //fpassthru(fopen($nomer, 'rb')); | 495 | //fpassthru(fopen($nomer, 'rb')); |
496 | + $nomer = str_replace(".png","",$nome).".png"; | ||
496 | readfile($nomer); | 497 | readfile($nomer); |
497 | } | 498 | } |
498 | if($i3georendermode == 2){ | 499 | if($i3georendermode == 2){ |
@@ -523,6 +524,7 @@ function carregaCacheImagem($cachedir,$map,$tms, $plugin, $tema){ | @@ -523,6 +524,7 @@ function carregaCacheImagem($cachedir,$map,$tms, $plugin, $tema){ | ||
523 | $etag = md5_file($nome); | 524 | $etag = md5_file($nome); |
524 | header('Etag: '.$etag); | 525 | header('Etag: '.$etag); |
525 | //fpassthru(fopen($nome, 'rb')); | 526 | //fpassthru(fopen($nome, 'rb')); |
527 | + $nome = str_replace(".png","",$nome).".png"; | ||
526 | readfile($nome); | 528 | readfile($nome); |
527 | exit; | 529 | exit; |
528 | } | 530 | } |
@@ -539,7 +541,8 @@ function salvaCacheImagem($cachedir,$map,$tms, $plugin, $tema){ | @@ -539,7 +541,8 @@ function salvaCacheImagem($cachedir,$map,$tms, $plugin, $tema){ | ||
539 | $nome = $cachedir.$tms; | 541 | $nome = $cachedir.$tms; |
540 | } | 542 | } |
541 | @mkdir(dirname($nome),0744,true); | 543 | @mkdir(dirname($nome),0744,true); |
542 | - chmod(dirname($nome),0744); | 544 | + chmod(dirname($nome),0744); |
545 | + $nome = str_replace(".png","",$nome).".png"; | ||
543 | $img->saveImage($nome); | 546 | $img->saveImage($nome); |
544 | // | 547 | // |
545 | //corta a imagem gerada para voltar ao tamanho normal | 548 | //corta a imagem gerada para voltar ao tamanho normal |
ogc.php
@@ -240,7 +240,7 @@ if(strtolower($OUTPUTFORMAT) == "shape-zip" && $ogrOutput == false){ | @@ -240,7 +240,7 @@ if(strtolower($OUTPUTFORMAT) == "shape-zip" && $ogrOutput == false){ | ||
240 | exit; | 240 | exit; |
241 | } | 241 | } |
242 | // | 242 | // |
243 | -//caso seja uma requisi��o WMS com format | 243 | +//caso seja uma requisição WMS com format |
244 | // | 244 | // |
245 | $format = $_GET["format"]; | 245 | $format = $_GET["format"]; |
246 | if(strpos(strtolower($format),"kml") !== false){ | 246 | if(strpos(strtolower($format),"kml") !== false){ |
@@ -510,7 +510,7 @@ else{ | @@ -510,7 +510,7 @@ else{ | ||
510 | $l->setmetadata("wms_extent",$extensao); | 510 | $l->setmetadata("wms_extent",$extensao); |
511 | if (!empty($postgis_mapa)){ | 511 | if (!empty($postgis_mapa)){ |
512 | if ($l->connectiontype == MS_POSTGIS){ | 512 | if ($l->connectiontype == MS_POSTGIS){ |
513 | - | 513 | + |
514 | $lcon = $l->connection; | 514 | $lcon = $l->connection; |
515 | if (($lcon == " ") || ($lcon == "") || (in_array($lcon,array_keys($postgis_mapa)))){ | 515 | if (($lcon == " ") || ($lcon == "") || (in_array($lcon,array_keys($postgis_mapa)))){ |
516 | // | 516 | // |