From 72733ab8e879b34ecbed138ddeb508c3ec8dfea2 Mon Sep 17 00:00:00 2001 From: edmarmoretti Date: Thu, 4 Aug 2016 22:23:11 -0300 Subject: [PATCH] atualização do codigo --- classesphp/funcoes_gerais.php | 5 ++--- classesphp/mapa_googlemaps.php | 7 +++---- classesphp/mapa_openlayers.php | 2 -- ferramentas/parametrossql/ogc.php | 5 ++++- ogc.php | 4 ++-- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/classesphp/funcoes_gerais.php b/classesphp/funcoes_gerais.php index a185a1a..95eab26 100755 --- a/classesphp/funcoes_gerais.php +++ b/classesphp/funcoes_gerais.php @@ -445,8 +445,7 @@ Envia para o navegador uma imagem. Utilizado na tag IMG em arquivos HTML function echoimg($arquivo,$tipo){ echo header("Content-type: image/png \n\n"); header('Content-Length: '.filesize($arquivo)); - //fpassthru(fopen($arquivo, 'rb')); - readfile($arquivo); + readfile(str_replace(".png","",$arquivo).".png"); exit; } /* @@ -2292,7 +2291,7 @@ Retorno: */ function removeAcentos($var) { - $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', '?', '?', '?', '?', '?', '?'); + $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', '?', '?', '?', '?', '?', '?'); $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'); return str_replace($a, $b, $var); } diff --git a/classesphp/mapa_googlemaps.php b/classesphp/mapa_googlemaps.php index c46451b..f627d01 100755 --- a/classesphp/mapa_googlemaps.php +++ b/classesphp/mapa_googlemaps.php @@ -257,7 +257,6 @@ else{ //qd a cahamda e para um WMS, redireciona para ogc.php // if($_GET["REQUEST"] == "GetFeatureInfo" || $_GET["REQUEST"] == "getfeature"){ - //echo $_GET["mapext"];exit; if($_GET["REQUEST"] == "GetFeatureInfo"){ $mapa->setsize(256,256); $mapext = explode(",",$_GET["BBOX"]); @@ -483,7 +482,7 @@ function salvaCacheImagem(){ } $c = $cachedir."/googlemaps/$layer/$z/$x"; if(!file_exists($c."/$y.png")){ - mkdir($cachedir."/googlemaps/$layer/$z/$x",0777,true); + mkdir($cachedir."/googlemaps/$layer/$z/$x",0744,true); $img->saveImage($c."/$y.png"); // //corta a imagem gerada para voltar ao tamanho normal @@ -492,8 +491,8 @@ function salvaCacheImagem(){ $img = cortaImagemDisco($c."/$y.png",$cortePixels,256); } - chmod($cachedir."/googlemaps/$layer/$z/$x",0777); - chmod($c."/$y.png",0777); + chmod($cachedir."/googlemaps/$layer/$z/$x",0744); + chmod($c."/$y.png",0744); } return $c."/$y.png"; } diff --git a/classesphp/mapa_openlayers.php b/classesphp/mapa_openlayers.php index 8a1f397..0194845 100755 --- a/classesphp/mapa_openlayers.php +++ b/classesphp/mapa_openlayers.php @@ -87,7 +87,6 @@ if(isset($_GET["tms"])){ $lat1 = $y / $n * 180.0 - 90.0; $lat2 = ($y+1) / $n * 180.0 - 90; $_GET["BBOX"] = $lon1." ".$lat1." ".$lon2." ".$lat2; - //echo $_GET["BBOX"];exit; } //para o caso da versao 3 do OpenLayers @@ -103,7 +102,6 @@ if(isset($_GET["X"]) && !($_GET["REQUEST"] == "getfeatureinfo" || $_GET["REQUEST $_GET["WIDTH"] = 256; $_GET["HEIGHT"] = 256; $_GET["tms"] = "/".$_GET["layer"]."/".$z."/".$x."/".$y.".png"; - } if(isset($_GET["TileMatrix"])){ diff --git a/ferramentas/parametrossql/ogc.php b/ferramentas/parametrossql/ogc.php index 598f1c0..815e487 100755 --- a/ferramentas/parametrossql/ogc.php +++ b/ferramentas/parametrossql/ogc.php @@ -493,6 +493,7 @@ function renderNocacheTms(){ header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . ' GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($nomer)).' GMT', true, 200); //fpassthru(fopen($nomer, 'rb')); + $nomer = str_replace(".png","",$nome).".png"; readfile($nomer); } if($i3georendermode == 2){ @@ -523,6 +524,7 @@ function carregaCacheImagem($cachedir,$map,$tms, $plugin, $tema){ $etag = md5_file($nome); header('Etag: '.$etag); //fpassthru(fopen($nome, 'rb')); + $nome = str_replace(".png","",$nome).".png"; readfile($nome); exit; } @@ -539,7 +541,8 @@ function salvaCacheImagem($cachedir,$map,$tms, $plugin, $tema){ $nome = $cachedir.$tms; } @mkdir(dirname($nome),0744,true); - chmod(dirname($nome),0744); + chmod(dirname($nome),0744); + $nome = str_replace(".png","",$nome).".png"; $img->saveImage($nome); // //corta a imagem gerada para voltar ao tamanho normal diff --git a/ogc.php b/ogc.php index 660f472..ddbde8f 100755 --- a/ogc.php +++ b/ogc.php @@ -240,7 +240,7 @@ if(strtolower($OUTPUTFORMAT) == "shape-zip" && $ogrOutput == false){ exit; } // -//caso seja uma requisi��o WMS com format +//caso seja uma requisição WMS com format // $format = $_GET["format"]; if(strpos(strtolower($format),"kml") !== false){ @@ -510,7 +510,7 @@ else{ $l->setmetadata("wms_extent",$extensao); if (!empty($postgis_mapa)){ if ($l->connectiontype == MS_POSTGIS){ - + $lcon = $l->connection; if (($lcon == " ") || ($lcon == "") || (in_array($lcon,array_keys($postgis_mapa)))){ // -- libgit2 0.21.2