Commit 50159d0b0240c38bb9bae950d2341a4c62241291
1 parent
fd5c4716
Exists in
master
and in
7 other branches
Modificações nos códigos que usam definição de projeção para que passem a usar a…
… variável de configuração de projeção do ms_configura.php
Showing
20 changed files
with
50 additions
and
39 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesphp/classe_atributos.php
| ... | ... | @@ -127,7 +127,7 @@ class Atributos |
| 127 | 127 | } |
| 128 | 128 | if($this->mapa->getmetadata("interface") == "googlemaps"){ |
| 129 | 129 | $this->projO = $this->mapa->getProjection(); |
| 130 | - $this->mapa->setProjection("init=epsg:4618,a=6378137,b=6378137"); | |
| 130 | + $this->mapa->setProjection(pegaProjecaoDefault("proj4")); | |
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | } |
| ... | ... | @@ -2382,7 +2382,7 @@ class Atributos |
| 2382 | 2382 | } |
| 2383 | 2383 | $conta = $conta + 1; |
| 2384 | 2384 | } |
| 2385 | - | |
| 2385 | + | |
| 2386 | 2386 | if($wkt == "sim"){ |
| 2387 | 2387 | $arraytemp = array( |
| 2388 | 2388 | "alias"=>"wkt", | ... | ... |
classesphp/classe_mapa.php
| ... | ... | @@ -2214,10 +2214,10 @@ class Mapa |
| 2214 | 2214 | function converteInterfacePara($interface){ |
| 2215 | 2215 | if($interface == "openlayers"){ |
| 2216 | 2216 | $prefixo = "ol"; |
| 2217 | - $this->mapa->setProjection("+proj=longlat +ellps=GRS67 +no_defs"); | |
| 2217 | + $this->mapa->setProjection(pegaProjecaoDefault("proj4")); | |
| 2218 | 2218 | } |
| 2219 | - else | |
| 2220 | - {$prefixo = "gm"; | |
| 2219 | + else{ | |
| 2220 | + $prefixo = "gm"; | |
| 2221 | 2221 | } |
| 2222 | 2222 | foreach($this->layers as $l){ |
| 2223 | 2223 | $opacidadeM = $l->getmetadata($prefixo."opacity"); | ... | ... |
classesphp/classe_selecao.php
| ... | ... | @@ -124,7 +124,7 @@ $ext - extensão geográfica do mapa |
| 124 | 124 | } |
| 125 | 125 | if($this->mapa->getmetadata("interface") == "googlemaps"){ |
| 126 | 126 | $this->projO = $this->mapa->getProjection(); |
| 127 | - $this->mapa->setProjection("init=epsg:4618,a=6378137,b=6378137"); | |
| 127 | + $this->mapa->setProjection(pegaProjecaoDefault("proj4")); | |
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | /* | ... | ... |
classesphp/classe_temas.php
| ... | ... | @@ -425,7 +425,7 @@ Calcula a extensão geográfica de um tema e ajusta o mapa para essa |
| 425 | 425 | if(!$this->layer){return "erro";} |
| 426 | 426 | if($this->mapa->getmetadata("interface") == "googlemaps"){ |
| 427 | 427 | $projO = $this->mapa->getProjection(); |
| 428 | - $this->mapa->setProjection("init=epsg:4618,a=6378137,b=6378137"); | |
| 428 | + $this->mapa->setProjection(pegaProjecaoDefault("proj4")); | |
| 429 | 429 | } |
| 430 | 430 | $prjMapa = ""; |
| 431 | 431 | $prjTema = ""; |
| ... | ... | @@ -829,7 +829,7 @@ $wkt - boolean indicando se $xy e um WKT |
| 829 | 829 | $c = $shp->getCentroid(); |
| 830 | 830 | $c = $c->x; |
| 831 | 831 | if($c > -181 && $c < 181){ |
| 832 | - $pinlayer->setprojection("proj=latlong,a=6378137,b=6378137"); | |
| 832 | + $pinlayer->setprojection(pegaProjecaoDefault("proj4")); | |
| 833 | 833 | } |
| 834 | 834 | else{ |
| 835 | 835 | $pinlayer->setprojection($this->mapa->getProjection()); | ... | ... |
classesphp/funcoes_gerais.php
| ... | ... | @@ -716,7 +716,7 @@ function retornaReferenciaDinamica($ext="",$w="",$h="") |
| 716 | 716 | $i = $interface; |
| 717 | 717 | } |
| 718 | 718 | if($i == "googlemaps"){ |
| 719 | - $objMapa->setProjection("init=epsg:4618,a=6378137,b=6378137"); | |
| 719 | + $objMapa->setProjection(pegaProjecaoDefault("proj4")); | |
| 720 | 720 | } |
| 721 | 721 | if($ext && $ext != ""){ |
| 722 | 722 | $e = explode(" ",$ext); |
| ... | ... | @@ -769,7 +769,7 @@ function retornaReferenciaDinamica($ext="",$w="",$h="") |
| 769 | 769 | $s = "var refimagem='".$nomer."';var refwidth=".$w.";var refheight=".$h.";var refpath='".$objImagem->imagepath."';var refurl='".$objImagem->imageurl."'"; |
| 770 | 770 | $mapa = ms_newMapObj($map_file); |
| 771 | 771 | if($i == "googlemaps"){ |
| 772 | - $mapa->setProjection("init=epsg:4618,a=6378137,b=6378137"); | |
| 772 | + $mapa->setProjection(pegaProjecaoDefault("proj4")); | |
| 773 | 773 | } |
| 774 | 774 | $ref = $mapa->reference; |
| 775 | 775 | $r = $ref->extent; |
| ... | ... | @@ -2873,7 +2873,7 @@ Se essa variavel nao existir, retorna o valor default baseado em EPSG:4326 |
| 2873 | 2873 | |
| 2874 | 2874 | Parametros: |
| 2875 | 2875 | |
| 2876 | -tipo {string} - se for vazio retorna todos os elementos do array. Se nao for vazio, usa $tipo como | |
| 2876 | +tipo {string} - se for vazio retorna todos os elementos do array. Se nao for vazio, usa $tipo como | |
| 2877 | 2877 | chave para retornar apenas o indice desejado (proj4, epsg, prj) |
| 2878 | 2878 | |
| 2879 | 2879 | Retorno: | ... | ... |
ferramentas/buscarapida/gadget.php
| 1 | 1 | <?php |
| 2 | 2 | include_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); |
| 3 | -if(!isset($palavra)) | |
| 4 | -{echo "Parâmetro &palavra= não foi definido. 'palavra' é a palavra que será buscada";} | |
| 5 | -if(!isset($locaplic)) | |
| 6 | -{echo "<br>Parâmetro &locaplic= não foi definido. 'locaplic' indica onde o i3geo está instalado";} | |
| 3 | +include_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); | |
| 4 | +$projecao = pegaProjecaoDefault("epsg"); | |
| 5 | +if(!isset($palavra)){ | |
| 6 | + echo "Parâmetro &palavra= não foi definido. 'palavra' é a palavra que será buscada"; | |
| 7 | +} | |
| 8 | +if(!isset($locaplic)){ | |
| 9 | + echo "<br>Parâmetro &locaplic= não foi definido. 'locaplic' indica onde o i3geo está instalado"; | |
| 10 | +} | |
| 7 | 11 | ?> |
| 8 | 12 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 9 | 13 | <head> |
| ... | ... | @@ -22,7 +26,7 @@ i3GEObuscaRapida.idresultado |
| 22 | 26 | var mapaLugar = function(wkt,layer,gid,nm) |
| 23 | 27 | { |
| 24 | 28 | var ext = i3GEO.util.wkt2ext(wkt,"polygon"); |
| 25 | - var url = "<?php echo $locaplic;?>/ms_criamapa.php?srs_wms=epsg:4618&image_wms=image/png&versao_wms=1.1.1" | |
| 29 | + var url = "<?php echo $locaplic;?>/ms_criamapa.php?srs_wms=epsg:<?php echo $projecao;?>&image_wms=image/png&versao_wms=1.1.1" | |
| 26 | 30 | url += "&url_wms=http://mapas.mma.gov.br/webservices/geonameswms.php?gid="+gid+"&"; |
| 27 | 31 | url += "&layer_wms="+layer+"&style_wms=default" |
| 28 | 32 | url += "&nome_wms="+nm+" - "+layer | ... | ... |
ferramentas/congelamapa/openlayers.php
| ... | ... | @@ -17,7 +17,7 @@ $novo_mapfile = $dir."/".nomeRandomico(5).$base; |
| 17 | 17 | copy($map_file,$novo_mapfile); |
| 18 | 18 | chmod($novo_mapfile,0777); |
| 19 | 19 | $mapa = ms_newMapObj($novo_mapfile); |
| 20 | -$mapa->setProjection("+proj=longlat +ellps=GRS67 +no_defs"); | |
| 20 | +$mapa->setProjection(pegaProjecaoDefault("proj4")); | |
| 21 | 21 | $numlayers = $mapa->numlayers; |
| 22 | 22 | $layers = array(); |
| 23 | 23 | for($i = 0;$i < $numlayers;++$i){ | ... | ... |
ferramentas/congelamapa/openlayers3.php
| ... | ... | @@ -17,7 +17,7 @@ $novo_mapfile = $dir."/".nomeRandomico(5).$base; |
| 17 | 17 | copy($map_file,$novo_mapfile); |
| 18 | 18 | chmod($novo_mapfile,0777); |
| 19 | 19 | $mapa = ms_newMapObj($novo_mapfile); |
| 20 | -$mapa->setProjection("+proj=longlat +ellps=GRS67 +no_defs"); | |
| 20 | +$mapa->setProjection(pegaProjecaoDefault("proj4")); | |
| 21 | 21 | $numlayers = $mapa->numlayers; |
| 22 | 22 | $layers = array(); |
| 23 | 23 | for($i = 0;$i < $numlayers;++$i){ | ... | ... |
ferramentas/imprimir/a4lpaisagempdf.php
| ... | ... | @@ -42,9 +42,9 @@ $map->save($temp); |
| 42 | 42 | substituiCon($temp,$postgis_mapa); |
| 43 | 43 | $map = ms_newMapObj($temp); |
| 44 | 44 | |
| 45 | -if($map->getmetadata("interface") == "googlemaps") | |
| 46 | -{ | |
| 47 | - $map->setProjection("init=epsg:4618,a=6378137,b=6378137"); | |
| 45 | +if($map->getmetadata("interface") == "googlemaps"){ | |
| 46 | + $proj4 = pegaProjecaoDefault("proj4"); | |
| 47 | + $map->setProjection($proj4); | |
| 48 | 48 | $map->set("units",MS_METERS); |
| 49 | 49 | $map->preparequery(); |
| 50 | 50 | $map->set("scaledenom",$map->scaledenom * 100000); | ... | ... |
ferramentas/imprimir/aggpng.php
| ... | ... | @@ -72,7 +72,8 @@ $of->set("imagemode","RGB"); |
| 72 | 72 | $map = ms_newMapObj($temp); |
| 73 | 73 | if($map->getmetadata("interface") == "googlemaps") |
| 74 | 74 | { |
| 75 | - $map->setProjection("init=epsg:4618,a=6378137,b=6378137"); | |
| 75 | + $proj4 = pegaProjecaoDefault("proj4"); | |
| 76 | + $map->setProjection($proj4); | |
| 76 | 77 | $map->set("units",MS_METERS); |
| 77 | 78 | $map->preparequery(); |
| 78 | 79 | $map->set("scaledenom",$map->scaledenom * 100000); | ... | ... |
ferramentas/imprimir/geotif.php
| ... | ... | @@ -71,7 +71,8 @@ $of->set("imagemode","RGB"); |
| 71 | 71 | $map = ms_newMapObj($temp); |
| 72 | 72 | if($map->getmetadata("interface") == "googlemaps") |
| 73 | 73 | { |
| 74 | - $map->setProjection("init=epsg:4618,a=6378137,b=6378137"); | |
| 74 | + $proj4 = pegaProjecaoDefault("proj4"); | |
| 75 | + $map->setProjection($proj4); | |
| 75 | 76 | $map->set("units",MS_METERS); |
| 76 | 77 | $map->preparequery(); |
| 77 | 78 | $map->set("scaledenom",$map->scaledenom * 100000); | ... | ... |
ferramentas/imprimir/jpeg.php
| ... | ... | @@ -74,7 +74,8 @@ $of->set("mimetype","image/jpeg"); |
| 74 | 74 | $of->set("extension","jpg"); |
| 75 | 75 | if($map->getmetadata("interface") == "googlemaps") |
| 76 | 76 | { |
| 77 | - $map->setProjection("init=epsg:4618,a=6378137,b=6378137"); | |
| 77 | + $proj4 = pegaProjecaoDefault("proj4"); | |
| 78 | + $map->setProjection($proj4); | |
| 78 | 79 | $map->set("units",MS_METERS); |
| 79 | 80 | $map->preparequery(); |
| 80 | 81 | $map->set("scaledenom",$map->scaledenom * 100000); | ... | ... |
ferramentas/imprimir/svg.php
| ... | ... | @@ -69,7 +69,8 @@ substituiCon($temp,$postgis_mapa); |
| 69 | 69 | $map = ms_newMapObj($temp); |
| 70 | 70 | if($map->getmetadata("interface") == "googlemaps") |
| 71 | 71 | { |
| 72 | - $map->setProjection("init=epsg:4618,a=6378137,b=6378137"); | |
| 72 | + $proj4 = pegaProjecaoDefault("proj4"); | |
| 73 | + $map->setProjection($proj4); | |
| 73 | 74 | $map->set("units",MS_METERS); |
| 74 | 75 | $map->preparequery(); |
| 75 | 76 | $map->set("scaledenom",$map->scaledenom * 100000); | ... | ... |
ferramentas/parametrossql/ogc.php
| ... | ... | @@ -12,6 +12,8 @@ require_once(dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
| 12 | 12 | include(dirname(__FILE__)."/../../ms_configura.php"); |
| 13 | 13 | include(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); |
| 14 | 14 | include(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
| 15 | +$projDefault = pegaProjecaoDefault(); | |
| 16 | + | |
| 15 | 17 | $temas = $tema; |
| 16 | 18 | if(isset($_GET["sld"]) || isset($_GET["filter"])){ |
| 17 | 19 | $cache = false; |
| ... | ... | @@ -40,7 +42,7 @@ if($_GET["SRS"] == "EPSG:900913"){ |
| 40 | 42 | $req = ms_newowsrequestobj(); |
| 41 | 43 | $_GET = array_merge($_GET,$_POST); |
| 42 | 44 | if(!isset($_GET["srs"]) && !isset($_GET["SRS"])){ |
| 43 | - $_GET["srs"] = "EPSG:4326"; | |
| 45 | + $_GET["srs"] = "EPSG:".$projDefault["epsg"]; | |
| 44 | 46 | } |
| 45 | 47 | foreach ($_GET as $k=>$v){ |
| 46 | 48 | $req->setParameter(strtoupper($k), $v); |
| ... | ... | @@ -97,7 +99,7 @@ else{ |
| 97 | 99 | $oMap->setmetadata("ows_enable_request","*"); |
| 98 | 100 | //parametro mandatario |
| 99 | 101 | if($oMap->getmetadata("wms_srs") == ""){ |
| 100 | - $oMap->setmetadata("wms_srs","EPSG:4326"); | |
| 102 | + $oMap->setmetadata("wms_srs","EPSG:".$projDefault["epsg"]); | |
| 101 | 103 | } |
| 102 | 104 | |
| 103 | 105 | $e = $oMap->extent; |
| ... | ... | @@ -310,7 +312,7 @@ if(isset($_GET["Z"]) && isset($_GET["X"])){ |
| 310 | 312 | $x--; |
| 311 | 313 | $y--; |
| 312 | 314 | |
| 313 | - $projInObj = ms_newprojectionobj("proj=latlong,a=6378137,b=6378137"); | |
| 315 | + $projInObj = ms_newprojectionobj($projDefault["proj4"]); | |
| 314 | 316 | $projOutObj = ms_newprojectionobj("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"); |
| 315 | 317 | |
| 316 | 318 | $poPoint1 = ms_newpointobj(); |
| ... | ... | @@ -324,7 +326,7 @@ if(isset($_GET["Z"]) && isset($_GET["X"])){ |
| 324 | 326 | |
| 325 | 327 | $oMap->getlayer(0)->set("status",MS_DEFAULT); |
| 326 | 328 | $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"); |
| 327 | - $layer0->setProjection("proj=latlong,a=6378137,b=6378137"); | |
| 329 | + $layer0->setProjection($projDefault["proj4"]); | |
| 328 | 330 | // |
| 329 | 331 | //se o layer foi marcado para corte altera os parametros para ampliar o mapa |
| 330 | 332 | //antes de gerar a imagem |
| ... | ... | @@ -401,7 +403,7 @@ if(strtolower($req->getValueByName("REQUEST")) == "getfeature"){ |
| 401 | 403 | $req->setParameter("TYPENAME",$l->name); |
| 402 | 404 | } |
| 403 | 405 | if($l->getProjection() == "" ){ |
| 404 | - $l->setProjection("proj=latlong,a=6378137,b=6378137"); | |
| 406 | + $l->setProjection($projDefault["proj4"]); | |
| 405 | 407 | } |
| 406 | 408 | if(strtolower($req->getValueByName("SRS")) == "epsg:900913"){ |
| 407 | 409 | $req->setParameter("SRS","EPSG:3857"); | ... | ... |
ferramentas/telaremota/openlayers1.php
| ... | ... | @@ -119,7 +119,7 @@ function inicia(){ |
| 119 | 119 | OpenLayers.ImgPath = "../../pacotes/openlayers/img/" |
| 120 | 120 | OpenLayers.Lang.setCode("pt-BR"); |
| 121 | 121 | var urlLayer = "../../classesphp/mapa_openlayers.php?DESLIGACACHE=sim&g_sid=<?php echo $g_sid;?>&telaR=<?php echo $telaR;?>"; |
| 122 | - | |
| 122 | + | |
| 123 | 123 | var remoto = new OpenLayers.Layer.WMS( |
| 124 | 124 | "Remoto", |
| 125 | 125 | urlLayer, |
| ... | ... | @@ -168,7 +168,7 @@ function inicia(){ |
| 168 | 168 | "http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map", |
| 169 | 169 | { |
| 170 | 170 | layers : "baseraster", |
| 171 | - srs : "EPSG:4618", | |
| 171 | + srs : "EPSG:4326", | |
| 172 | 172 | format : "image/png", |
| 173 | 173 | isBaseLayer : false |
| 174 | 174 | }, { | ... | ... |
ferramentas/wkt2layer/exec.php
| ... | ... | @@ -45,7 +45,7 @@ Insere elementos no mapa como um layer do tipo feature baseado em wkt |
| 45 | 45 | $c = $shp->getCentroid(); |
| 46 | 46 | $c = $c->x; |
| 47 | 47 | if($c > -181 && $c < 181){ |
| 48 | - $l->setprojection("proj=latlong,a=6378137,b=6378137"); | |
| 48 | + $l->setprojection(pegaProjecaoDefault("proj4")); | |
| 49 | 49 | } |
| 50 | 50 | else{ |
| 51 | 51 | $l->setprojection($this->mapa->getProjection()); | ... | ... |
ogc.htm
| ... | ... | @@ -199,6 +199,8 @@ A:hover { |
| 199 | 199 | ins += |
| 200 | 200 | "<p><a target=blank href='"+servico+"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="+tema+"' />testar getmap</a>"; |
| 201 | 201 | ins += |
| 202 | + "<p><a target=blank href='"+servico+"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=getlegendgraphic&layers="+tema+"' />testar getLegendGraphic</a>"; | |
| 203 | + ins += | |
| 202 | 204 | "<p><a target=blank href='"+servico+"format=application/openlayers&bbox=-76.5125927,-39.3925675209,-29.5851853,9.49014852081&layers="+tema+"' />visualizar com openLayers</a>"; |
| 203 | 205 | ins += |
| 204 | 206 | "<p><a target=blank href='"+servico+"OUTPUTFORMAT=shape-zip&bbox=-76.5125927,-39.3925675209,-29.5851853,9.49014852081&service=wfs&version=1.1.0&request=getfeature&layers="+tema+"&typeName="+tema+"' />download shapefile via WFS</a>"; | ... | ... |
ogc.php
| ... | ... | @@ -212,7 +212,7 @@ if(!empty($restauramapa)){ |
| 212 | 212 | //para operar como o Geoserver, abre o openlayers |
| 213 | 213 | // |
| 214 | 214 | if(isset($format) && strtolower($format) == "application/openlayers"){ |
| 215 | - $urln = dirname($_SERVER["PHP_SELF"])."/mashups/openlayers.php?layers=".$layers."&mapext=".$bbox."&botoes=pan,zoombox,zoomtot,identifica"; | |
| 215 | + $urln = dirname($_SERVER["PHP_SELF"])."/mashups/openlayers.php?layers=".$layers."&mapext=".$bbox."&botoes=pan,zoombox,zoomtot,identifica,legenda"; | |
| 216 | 216 | //echo $urln;exit; |
| 217 | 217 | if(!headers_sent()){ |
| 218 | 218 | header("Location:".$urln); |
| ... | ... | @@ -752,11 +752,11 @@ if(isset($_GET["Z"]) && isset($_GET["X"])){ |
| 752 | 752 | $x = $_GET["X"]; |
| 753 | 753 | $y = $_GET["Y"]; |
| 754 | 754 | $z = $_GET["Z"]; |
| 755 | - | |
| 755 | + $proj4 = pegaProjecaoDefault("proj4"); | |
| 756 | 756 | if(file_exists($tema)){ |
| 757 | 757 | $layer0 = $oMap->getlayer(0); |
| 758 | 758 | $layer0->set("status",MS_DEFAULT); |
| 759 | - $layer0->setProjection("proj=latlong,a=6378137,b=6378137"); | |
| 759 | + $layer0->setProjection($proj4); | |
| 760 | 760 | } |
| 761 | 761 | else{ |
| 762 | 762 | //pode ter mais de um tema |
| ... | ... | @@ -764,7 +764,7 @@ if(isset($_GET["Z"]) && isset($_GET["X"])){ |
| 764 | 764 | foreach($lista as $nomeLayer){ |
| 765 | 765 | $layer0 = $oMap->getlayerbyname($nomeLayer); |
| 766 | 766 | $layer0->set("status",MS_DEFAULT); |
| 767 | - $layer0->setProjection("proj=latlong,a=6378137,b=6378137"); | |
| 767 | + $layer0->setProjection($proj4); | |
| 768 | 768 | } |
| 769 | 769 | } |
| 770 | 770 | // |
| ... | ... | @@ -880,7 +880,7 @@ if(strtolower($req->getValueByName("REQUEST")) == "getfeature"){ |
| 880 | 880 | $req->setParameter("TYPENAME",$l->name); |
| 881 | 881 | } |
| 882 | 882 | if($l->getProjection() == "" ){ |
| 883 | - $l->setProjection("proj=latlong,a=6378137,b=6378137"); | |
| 883 | + $l->setProjection(pegaProjecaoDefault("proj4")); | |
| 884 | 884 | } |
| 885 | 885 | if(strtolower($req->getValueByName("SRS")) == "epsg:900913"){ |
| 886 | 886 | $req->setParameter("SRS","EPSG:3857"); | ... | ... |
pacotes/kmlmapserver/classes/layerserver.class.php