From 798714c427a1963c0937f007b2a4e98c97bc4cdd Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Wed, 17 Nov 2010 20:20:26 +0000 Subject: [PATCH] Limpeza do diretório "aplicmap" removendo-se mapfiles sem uso --- classesphp/classe_analise.php | 12 ------------ classesphp/classe_mapa.php | 23 ++++++----------------- classesphp/funcoes_gerais.php | 8 -------- ferramentas/upload/upload.php | 13 ++++++++----- ferramentas/uploaddbf/upload.php | 13 ++++++++----- ferramentas/uploadgpx/upload.php | 13 ++++++++----- guia_de_migracao.txt | 2 ++ 7 files changed, 32 insertions(+), 52 deletions(-) diff --git a/classesphp/classe_analise.php b/classesphp/classe_analise.php index a7dee6a..f0a56a5 100644 --- a/classesphp/classe_analise.php +++ b/classesphp/classe_analise.php @@ -1183,10 +1183,6 @@ function distanciaptpt($temaorigem,$temadestino,$temaoverlay,$locaplic,$itemorig $novoshpf->free(); xbase_close($db); //adiciona no mapa atual o novo tema - if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) - {$mapt = ms_newMapObj($locaplic."\\aplicmap\\novotema.map");} - else - {$mapt = ms_newMapObj($locaplic."/aplicmap/novotema.map");} $novolayer = criaLayer($this->mapa,MS_LAYER_LINE,MS_DEFAULT,("Distancias (".$nomefinal.")"),$metaClasse="SIM"); $novolayer->set("data",$nomeshp.".shp"); $novolayer->setmetadata("DOWNLOAD","SIM"); @@ -1303,10 +1299,6 @@ nome do layer criado com o buffer. $novoshpf->free(); xbase_close($db); //adiciona no mapa atual o novo tema - if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) - {$mapt = ms_newMapObj($locaplic."\\aplicmap\\novotema.map");} - else - {$mapt = ms_newMapObj($locaplic."/aplicmap/novotema.map");} $novolayer = criaLayer($this->mapa,MS_LAYER_POLYGON,MS_DEFAULT,("Buffer (".$nomebuffer.")"),$metaClasse="SIM"); $novolayer->set("data",$nomeshp.".shp"); $novolayer->setmetadata("DOWNLOAD","SIM"); @@ -1392,10 +1384,6 @@ $locaplic - Localização do I3geo. $novoshpf->free(); xbase_close($db); //adiciona no mapa atual o novo tema - if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) - {$mapt = ms_newMapObj($locaplic."\\aplicmap\\novotema.map");} - else - {$mapt = ms_newMapObj($locaplic."/aplicmap/novotema.map");} $novolayer = criaLayer($this->mapa,MS_LAYER_POINT,MS_DEFAULT,("Centróide (".$nomeCentroides.")"),$metaClasse="SIM"); $novolayer->set("data",$nomeshp.".shp"); $novolayer->setmetadata("DOWNLOAD","SIM"); diff --git a/classesphp/classe_mapa.php b/classesphp/classe_mapa.php index 8a806da..9294e6e 100644 --- a/classesphp/classe_mapa.php +++ b/classesphp/classe_mapa.php @@ -1125,12 +1125,12 @@ Include: //limpa selecao if (file_exists($this->qyfile)) {unlink ($this->qyfile);} - $nmap = ms_newMapObj($locaplic."/aplicmap/novotema.map"); - $layer = $nmap->getlayerbyname("novotema"); - //$layer->set("name",nomeRandomico()); + $layer = ms_newLayerObj($this->mapa); $layer->set("status",MS_DEFAULT); if($nomecamada == "default") $nomecamada = $tema; + $layer->setmetadata("CLASSE","SIM"); + $layer->setmetadata("TEXTO","NAO"); $layer->setmetadata("tema",$nomecamada); $layer->setmetadata("nomeoriginal",$tema); //nome original do layer no web service $layer->setmetadata("tipooriginal",$tiporep); @@ -1140,8 +1140,8 @@ Include: if ($tiporep == "linear") { $layer->set("type",MS_LAYER_LINE); - $classe = $layer->getclass(0); - $estilo = $classe->getstyle(0); + $classe = ms_newClassObj($layer); + $estilo = ms_newStyleObj($classe); $cor = $estilo->color; $cor->setRGB(-1,-1,-1); } @@ -1210,21 +1210,10 @@ Include: } $layer->setmetadata("wms_format",$im); $layer->setmetadata("wfs","nao"); - //verifica se o serviço tem wfs - /* - $wfs = existeWFS(); - if ($wfs != "nao") - { - $layer->setmetadata("wfs","sim"); - //$existeWFS = existeTemaWFS(); - //if ($existeWFS == "sim") - //{$layer->setmetadata("wfs","sim");} - } - */ $layer->setmetadata("wfs","nao"); $c = $layer->offsite; $c->setrgb(255,255,255); - ms_newLayerObj($this->mapa, $layer); + $of = $this->mapa->outputformat; $of->set("imagemode",MS_IMAGEMODE_RGB); $this->salva(); diff --git a/classesphp/funcoes_gerais.php b/classesphp/funcoes_gerais.php index ca4fee7..255d38c 100644 --- a/classesphp/funcoes_gerais.php +++ b/classesphp/funcoes_gerais.php @@ -1776,10 +1776,6 @@ function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE) $nomeshp = $dir_tmp."/".$novonomelayer; if(file_exists($nomeshp.".shp")) {return $nomeshp;} - if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) - {$mapt = ms_newMapObj($locaplic."\\aplicmap\\novotema.map");} - else - {$mapt = ms_newMapObj($locaplic."/aplicmap/novotema.map");} $novoshpf = ms_newShapefileObj($nomeshp, $tipol); $novoshpf->free(); //se for do tipo features @@ -1833,12 +1829,8 @@ function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE) $existesel = carregaquery($map_file,&$layer,&$map); if ($existesel == "nao") {@$layer->queryByrect($map->extent);} - //pega cada registro $res_count = $layer->getNumresults(); - - //echo $res_count;exit; - if ($res_count > 0) { $sopen = $layer->open(); diff --git a/ferramentas/upload/upload.php b/ferramentas/upload/upload.php index 3026570..40d00fa 100644 --- a/ferramentas/upload/upload.php +++ b/ferramentas/upload/upload.php @@ -43,8 +43,7 @@ if (isset($_FILES['i3GEOuploadshp']['name'])) if($status == 1) { echo "

Arquivo enviado. Adicionando tema...

"; - $mapt = ms_newMapObj($locaplic."/aplicmap/novotema.map"); - $novolayer = $mapt->getLayerByName("novotema"); + $novolayer = ms_newLayerObj($mapa); $novolayer->set("data",$dirmap."/".$_FILES['i3GEOuploadshp']['name']); $novolayer->set("name",$_FILES['i3GEOuploadshp']['name']); $novolayer->setmetadata("TEMA",$_FILES['i3GEOuploadshp']['name']); @@ -56,15 +55,19 @@ if (isset($_FILES['i3GEOuploadshp']['name'])) if ($tipo == 3){$novolayer->set("type",MS_LAYER_LINE);} if ($tipo == 5){$novolayer->set("type",MS_LAYER_POLYGON);} $novolayer->setmetadata("TEMALOCAL","SIM"); + $novolayer->setmetadata("CLASSE","SIM"); + $novolayer->setmetadata("TEXTO","NAO"); //if (($tipo != 3) and ($tipo != 8 )){$novolayer->set("type",0);} $novolayer->setfilter(""); - $classe = $novolayer->getclass(0); - $estilo = $classe->getstyle(0); + $classe = ms_newClassObj($novolayer); + $estilo = ms_newStyleObj($classe); if ($tipo == 1) { $estilo->set("symbolname","ponto"); $estilo->set("size",6); } + $estilo->color->setrgb(200,50,0); + $estilo->outlinecolor->setrgb(0,0,0); // le os itens $novolayer->set("status",MS_DEFAULT); $abriu = $novolayer->open(); @@ -77,7 +80,7 @@ if (isset($_FILES['i3GEOuploadshp']['name'])) $novolayer->setmetadata("ITENSDESC",$its); $novolayer->set("template","none.htm"); } - if($uploadEPSG != "") + if(isset($uploadEPSG) && $uploadEPSG != "") {$novolayer->setProjection("init=epsg:".$uploadEPSG);} $adiciona = ms_newLayerObj($mapa, $novolayer); $salvo = $mapa->save($map_file); diff --git a/ferramentas/uploaddbf/upload.php b/ferramentas/uploaddbf/upload.php index 3b1211c..c1e2806 100644 --- a/ferramentas/uploaddbf/upload.php +++ b/ferramentas/uploaddbf/upload.php @@ -108,17 +108,20 @@ if (isset($_FILES['i3GEOuploaddbffile']['name'])) } } $shapefileObj->free(); - $mapt = ms_newMapObj($locaplic."/aplicmap/novotema.map"); - $novolayer = $mapt->getLayerByName("novotema"); + $novolayer = ms_newLayerObj($mapa); $novolayer->set("data",$nomeshp); $novolayer->set("name",basename($nomeshp)); $novolayer->setmetadata("TEMA",basename($nomeshp)); $novolayer->setmetadata("DOWNLOAD","SIM"); $novolayer->setmetadata("TEMALOCAL","SIM"); + $novolayer->setmetadata("CLASSE","SIM"); + $novolayer->setmetadata("TEXTO","NAO"); $novolayer->set("type",MS_LAYER_POINT); $novolayer->setfilter(""); - $classe = $novolayer->getclass(0); - $estilo = $classe->getstyle(0); + $classe = ms_newClassObj($novolayer); + $estilo = ms_newStyleObj($classe); + $estilo->color->setrgb(200,50,0); + $estilo->outlinecolor->setrgb(0,0,0); $estilo->set("symbolname","ponto"); $estilo->set("size",6); // le os itens @@ -133,7 +136,7 @@ if (isset($_FILES['i3GEOuploaddbffile']['name'])) $novolayer->setmetadata("ITENSDESC",$its); $novolayer->set("template","none.htm"); } - if($uploaddbfEPSG != "") + if(isset($uploadEPSG) && $uploaddbfEPSG != "") {$novolayer->setProjection("init=epsg:".$uploaddbfEPSG);} $adiciona = ms_newLayerObj($mapa, $novolayer); $salvo = $mapa->save($map_file); diff --git a/ferramentas/uploadgpx/upload.php b/ferramentas/uploadgpx/upload.php index 37bb68d..f4844eb 100644 --- a/ferramentas/uploadgpx/upload.php +++ b/ferramentas/uploadgpx/upload.php @@ -38,8 +38,7 @@ if (isset($_FILES['i3GEOuploadgpx']['name'])) if($status == 1) { echo "

Arquivo enviado. Adicionando tema...

"; - $mapt = ms_newMapObj($locaplic."/aplicmap/novotema.map"); - $novolayer = $mapt->getLayerByName("novotema"); + $novolayer = ms_newLayerObj($mapa); $tipos = array("waypoints","routes","tracks","route_points","track_points"); foreach($tipos as $tipo){ $novolayer->set("connection",$dirmap."/".$_FILES['i3GEOuploadgpx']['name']); @@ -51,6 +50,8 @@ if (isset($_FILES['i3GEOuploadgpx']['name'])) $novolayer->set("name",$nome.$tipo); $novolayer->setmetadata("TEMA",$_FILES['i3GEOuploadgpx']['name']." ".$tipo); $novolayer->setmetadata("DOWNLOAD","SIM"); + $novolayer->setmetadata("CLASSE","SIM"); + $novolayer->setmetadata("TEXTO","NAO"); if($tipo == "waypoints" || $tipo == "route_points" ||$tipo == "track_points") {$novolayer->set("type",MS_LAYER_POINT);} else @@ -58,17 +59,19 @@ if (isset($_FILES['i3GEOuploadgpx']['name'])) $novolayer->set("data",$tipo); $novolayer->setmetadata("TEMALOCAL","SIM"); $novolayer->setfilter(""); - $classe = $novolayer->getclass(0); - $estilo = $classe->getstyle(0); + $classe = ms_newClassObj($novolayer); + $estilo = ms_newStyleObj($classe); if($tipo == "waypoints" || $tipo == "route_points" ||$tipo == "track_points") { $estilo->set("symbolname","ponto"); $estilo->set("size",6); } + $estilo->color->setrgb(200,50,0); + $estilo->outlinecolor->setrgb(0,0,0); // le os itens $novolayer->set("status",MS_DEFAULT); $novolayer->set("template","none.htm"); - if($uploadEPSG != "") + if(isset($uploadEPSG) && $uploadEPSG != "") {$novolayer->setProjection("init=epsg:".$uploadEPSG);} $adiciona = ms_newLayerObj($mapa, $novolayer); } diff --git a/guia_de_migracao.txt b/guia_de_migracao.txt index 21eca59..414d219 100644 --- a/guia_de_migracao.txt +++ b/guia_de_migracao.txt @@ -16,6 +16,8 @@ Para a versão 4.5 http://localhost/i3geo/ms_criamapa.php?interface=zerocal.htm ou http://localhost/i3geo/interface/zerocal.htm + A pasta "images" foi removida e as imagens movidas para a pasta "imagens\depreciado" + ------------------------------------------------------------------------------------------------- -- libgit2 0.21.2