Commit 2e327a06bedf7a267f8a3d1485e7dedd79b73970
1 parent
eaee0a84
Exists in
master
and in
7 other branches
Adição da opção de geração do mapa com AGG
Showing
3 changed files
with
91 additions
and
81 deletions
Show diff stats
| @@ -0,0 +1,87 @@ | @@ -0,0 +1,87 @@ | ||
| 1 | +<?php | ||
| 2 | +/* | ||
| 3 | +About: Licença | ||
| 4 | + | ||
| 5 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
| 6 | + | ||
| 7 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
| 8 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | ||
| 9 | + | ||
| 10 | +Este programa é software livre; você pode redistribuí-lo | ||
| 11 | +e/ou modificá-lo sob os termos da Licença Pública Geral | ||
| 12 | +GNU conforme publicada pela Free Software Foundation; | ||
| 13 | +tanto a versão 2 da Licença. | ||
| 14 | +Este programa é distribuído na expectativa de que seja útil, | ||
| 15 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
| 16 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
| 17 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
| 18 | +Você deve ter recebido uma cópia da Licença Pública Geral do | ||
| 19 | +GNU junto com este programa; se não, escreva para a | ||
| 20 | +Free Software Foundation, Inc., no endereço | ||
| 21 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
| 22 | +*/ | ||
| 23 | +require_once("../../classesphp/pega_variaveis.php"); | ||
| 24 | +error_reporting(0); | ||
| 25 | +session_name("i3GeoPHP"); | ||
| 26 | +if (isset($g_sid)) | ||
| 27 | +{session_id($g_sid);} | ||
| 28 | +session_start(); | ||
| 29 | +foreach(array_keys($_SESSION) as $k) | ||
| 30 | +{ | ||
| 31 | + eval("\$".$k."='".$_SESSION[$k]."';"); | ||
| 32 | +} | ||
| 33 | +$postgis_mapa = $_SESSION["postgis_mapa"]; | ||
| 34 | +// | ||
| 35 | +//se as extensões já estiverem carregadas no PHP, vc pode comentar essa linha para que o processamento fique mais rápido | ||
| 36 | +// | ||
| 37 | +include_once ("../../classesphp/carrega_ext.php"); | ||
| 38 | +// | ||
| 39 | +//carrega o phpmapscript | ||
| 40 | +// | ||
| 41 | +$exts = get_loaded_extensions(); | ||
| 42 | +if (array_search( "MapScript", $exts) != TRUE) | ||
| 43 | +{ | ||
| 44 | + if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | ||
| 45 | + { | ||
| 46 | + if(!@dl('php_mapscript_48.dll')) | ||
| 47 | + dl('php_mapscript.dll'); | ||
| 48 | + } | ||
| 49 | + else | ||
| 50 | + {dl('php_mapscript.so');} | ||
| 51 | +} | ||
| 52 | +require("../../classesphp/funcoes_gerais.php"); | ||
| 53 | +error_reporting(0); | ||
| 54 | +$nomes = nomeRandomico(); | ||
| 55 | +$map = ms_newMapObj($map_file); | ||
| 56 | +$temp = str_replace(".map","xxx.map",$map_file); | ||
| 57 | +$map->save($temp); | ||
| 58 | +substituiCon($temp,$postgis_mapa); | ||
| 59 | +$map = ms_newMapObj($temp); | ||
| 60 | +//$legenda =$map->legend; | ||
| 61 | +//$legenda->set("status",MS_EMBED); | ||
| 62 | +//altera o nome das classes vazias | ||
| 63 | +$temas = $map->getalllayernames(); | ||
| 64 | +foreach ($temas as $tema) | ||
| 65 | +{ | ||
| 66 | + $layer = $map->getlayerbyname($tema); | ||
| 67 | + if (($layer->data != "") && ($layer->getmetadata("escondido") != "SIM") && ($layer->getmetadata("tema") != "NAO")) | ||
| 68 | + { | ||
| 69 | + if ($layer->numclasses > 0) | ||
| 70 | + { | ||
| 71 | + $classe = $layer->getclass(0); | ||
| 72 | + if (($classe->name == "") || ($classe->name == " ")) | ||
| 73 | + {$classe->set("name",$layer->getmetadata("tema"));} | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | +} | ||
| 77 | +$of = $map->outputformat; | ||
| 78 | +$of->set("driver","AGG/PNG"); | ||
| 79 | +$of->set("imagemode","RGB"); | ||
| 80 | + | ||
| 81 | +$imgo = $map->draw(); | ||
| 82 | +$nomer = ($imgo->imagepath)."mapa".$nomes.".png"; | ||
| 83 | +$imgo->saveImage($nomer); | ||
| 84 | +$protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); | ||
| 85 | +$nomemapa = strtolower($protocolo[0])."://".$_SERVER['HTTP_HOST'].($imgo->imageurl).basename($nomer); | ||
| 86 | +echo "<a style=font-family:Verdana,Arial,Helvetica,sans-serif; href='$nomemapa' >Arquivo gerado! Clique para ver.</a>"; | ||
| 87 | +?> | ||
| 0 | \ No newline at end of file | 88 | \ No newline at end of file |
ferramentas/imprimir/index.htm
| @@ -23,6 +23,10 @@ | @@ -23,6 +23,10 @@ | ||
| 23 | <td><input style='cursor:pointer' onclick=abreI(this) type=radio value="geotif.php" name=cmodelo /></td> | 23 | <td><input style='cursor:pointer' onclick=abreI(this) type=radio value="geotif.php" name=cmodelo /></td> |
| 24 | <td>Geo Tiff</td> | 24 | <td>Geo Tiff</td> |
| 25 | </tr> | 25 | </tr> |
| 26 | + <tr> | ||
| 27 | + <td><input style='cursor:pointer' onclick=abreI(this) type=radio value="aggpng.php" name=cmodelo /></td> | ||
| 28 | + <td>Agg/Png alta qualidade</td> | ||
| 29 | + </tr> | ||
| 26 | </table> | 30 | </table> |
| 27 | </div> | 31 | </div> |
| 28 | </body> | 32 | </body> |
ferramentas/imprimir/svg.php
| @@ -1,81 +0,0 @@ | @@ -1,81 +0,0 @@ | ||
| 1 | -<?php | ||
| 2 | -/* | ||
| 3 | -About: Licença | ||
| 4 | - | ||
| 5 | -I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
| 6 | - | ||
| 7 | -Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
| 8 | -Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | ||
| 9 | - | ||
| 10 | -Este programa é software livre; você pode redistribuí-lo | ||
| 11 | -e/ou modificá-lo sob os termos da Licença Pública Geral | ||
| 12 | -GNU conforme publicada pela Free Software Foundation; | ||
| 13 | -tanto a versão 2 da Licença. | ||
| 14 | -Este programa é distribuído na expectativa de que seja útil, | ||
| 15 | -porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
| 16 | -de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
| 17 | -Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
| 18 | -Você deve ter recebido uma cópia da Licença Pública Geral do | ||
| 19 | -GNU junto com este programa; se não, escreva para a | ||
| 20 | -Free Software Foundation, Inc., no endereço | ||
| 21 | -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
| 22 | -*/ | ||
| 23 | -require_once("../../classesphp/pega_variaveis.php"); | ||
| 24 | -session_name("i3GeoPHP"); | ||
| 25 | -if (isset($g_sid)) | ||
| 26 | -{session_id($g_sid);} | ||
| 27 | -session_start(); | ||
| 28 | -foreach(array_keys($_SESSION) as $k) | ||
| 29 | -{ | ||
| 30 | - eval("\$".$k."='".$_SESSION[$k]."';"); | ||
| 31 | -} | ||
| 32 | -$postgis_mapa = $_SESSION["postgis_mapa"]; | ||
| 33 | -// | ||
| 34 | -//se as extensões já estiverem carregadas no PHP, vc pode comentar essa linha para que o processamento fique mais rápido | ||
| 35 | -// | ||
| 36 | -include_once ("../../classesphp/carrega_ext.php"); | ||
| 37 | -// | ||
| 38 | -//carrega o phpmapscript | ||
| 39 | -// | ||
| 40 | -$exts = get_loaded_extensions(); | ||
| 41 | -if (array_search( "MapScript", $exts) != TRUE) | ||
| 42 | -{ | ||
| 43 | - if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | ||
| 44 | - { | ||
| 45 | - if(!@dl('php_mapscript_48.dll')) | ||
| 46 | - dl('php_mapscript.dll'); | ||
| 47 | - } | ||
| 48 | - else | ||
| 49 | - {dl('php_mapscript.so');} | ||
| 50 | -} | ||
| 51 | -require("../../classesphp/funcoes_gerais.php"); | ||
| 52 | - | ||
| 53 | -error_reporting(E_ALL); | ||
| 54 | -$nomes = nomeRandomico(); | ||
| 55 | -$map = ms_newMapObj($map_file); | ||
| 56 | -//altera o nome das classes vazias | ||
| 57 | -$temas = $map->getalllayernames(); | ||
| 58 | -foreach ($temas as $tema) | ||
| 59 | -{ | ||
| 60 | - $layer = $map->getlayerbyname($tema); | ||
| 61 | - if (($layer->data != "") && ($layer->getmetadata("escondido") != "SIM") && ($layer->getmetadata("tema") != "NAO")) | ||
| 62 | - { | ||
| 63 | - if ($layer->numclasses > 0) | ||
| 64 | - { | ||
| 65 | - $classe = $layer->getclass(0); | ||
| 66 | - if (($classe->name == "") || ($classe->name == " ")) | ||
| 67 | - {$classe->set("name",$layer->getmetadata("tema"));} | ||
| 68 | - } | ||
| 69 | - } | ||
| 70 | -} | ||
| 71 | -$of = $map->outputformat; | ||
| 72 | - | ||
| 73 | -$of->set("driver","svg"); | ||
| 74 | - | ||
| 75 | -$imgo = $map->draw(); | ||
| 76 | -$nomer = ($imgo->imagepath)."mapa".$nomes.".svg"; | ||
| 77 | -$imgo->saveImage($nomer); | ||
| 78 | -$protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); | ||
| 79 | -$nomemapa = strtolower($protocolo[0])."://".$_SERVER['HTTP_HOST'].($imgo->imageurl).basename($nomer); | ||
| 80 | -echo "<a style=font-family:Verdana,Arial,Helvetica,sans-serif; href='$nomemapa' >Arquivo gerado! Clique para ver.</a>"; | ||
| 81 | -?> | ||
| 82 | \ No newline at end of file | 0 | \ No newline at end of file |