Commit 67b386fda3faef3cdb48069a15c5f1b9aeb12598

Authored by Edmar Moretti
1 parent b9c2a597

Inclusão de botão para ativação da tela de parâmetros, referente à ferramenta an…

…imagif, no editor gráfico de mapfiles
admin/admin.db
No preview for this file type
admin1/catalogo/mapfile/opcoes/exec.php 100644 → 100755
admin1/catalogo/mapfile/teste/exec.php
1 <?php 1 <?php
2 /****************************************************************/ 2 /****************************************************************/
3 -//include (dirname ( __FILE__ ) . "/../../../../ms_configura.php"); 3 +// include (dirname ( __FILE__ ) . "/../../../../ms_configura.php");
4 // 4 //
5 -//checa login  
6 -//valida _GET e _POST, juntando em _GET  
7 -//pega algumas variaveis de uso mais comum  
8 -//session_start 5 +// checa login
  6 +// valida _GET e _POST, juntando em _GET
  7 +// pega algumas variaveis de uso mais comum
  8 +// session_start
9 // 9 //
10 include ("../../../php/checaLogin.php"); 10 include ("../../../php/checaLogin.php");
11 -\admin\php\login\checaLogin();  
12 -//funcoes de administracao  
13 -include ($_SESSION["locaplic"]."/admin1/php/funcoesAdmin.php"); 11 +\admin\php\login\checaLogin ();
  12 +// funcoes de administracao
  13 +include ($_SESSION ["locaplic"] . "/admin1/php/funcoesAdmin.php");
14 // 14 //
15 -//carrega outras funcoes e extensoes do PHP 15 +// carrega outras funcoes e extensoes do PHP
16 // 16 //
17 -include ($_SESSION["locaplic"]."/classesphp/carrega_ext.php"); 17 +include ($_SESSION ["locaplic"] . "/classesphp/carrega_ext.php");
18 // 18 //
19 -//carrega as funcoes locais  
20 -//depende de funcoesAdmin.php 19 +// carrega as funcoes locais
  20 +// depende de funcoesAdmin.php
21 // 21 //
22 -include ("funcoes.php"); 22 +//include ("funcoes.php");
23 // 23 //
24 -//conexao com o banco de administracao  
25 -//cria as variaveis $dbh e $dbhw alem de conexaoadmin 24 +// conexao com o banco de administracao
  25 +// cria as variaveis $dbh e $dbhw alem de conexaoadmin
26 // 26 //
27 -include ($_SESSION["locaplic"]."/admin1/php/conexao.php");  
28 -/***************************************************************/ 27 +include ($_SESSION ["locaplic"] . "/admin1/php/conexao.php");
  28 +/**
  29 + * ************************************************************
  30 + */
29 if (\admin\php\funcoesAdmin\verificaOperacaoSessao ( "admin/html/editormapfile" ) === false) { 31 if (\admin\php\funcoesAdmin\verificaOperacaoSessao ( "admin/html/editormapfile" ) === false) {
30 header ( "HTTP/1.1 403 Vc nao pode realizar essa operacao" ); 32 header ( "HTTP/1.1 403 Vc nao pode realizar essa operacao" );
31 exit (); 33 exit ();
32 } 34 }
33 35
34 -$codigo = str_replace(" ","",$_POST["codigo"]);  
35 -if(empty($codigo)){ 36 +$codigo = str_replace ( " ", "", $_POST ["codigo"] );
  37 +if (empty ( $codigo )) {
36 header ( "HTTP/1.1 500 erro parametro invalido" ); 38 header ( "HTTP/1.1 500 erro parametro invalido" );
37 exit (); 39 exit ();
38 } 40 }
39 -$tema = $_SESSION["locaplic"]."/temas/".$codigo.".map";  
40 -if(!file_exists($tema)){ 41 +$tema = $_SESSION ["locaplic"] . "/temas/" . $codigo . ".map";
  42 +if (! file_exists ( $tema )) {
41 header ( "HTTP/1.1 500 erro mapfile nao encontrado" ); 43 header ( "HTTP/1.1 500 erro mapfile nao encontrado" );
42 exit (); 44 exit ();
43 } 45 }
@@ -45,273 +47,511 @@ if(!file_exists($tema)){ @@ -45,273 +47,511 @@ if(!file_exists($tema)){
45 $funcao = strtoupper ( $funcao ); 47 $funcao = strtoupper ( $funcao );
46 switch ($funcao) { 48 switch ($funcao) {
47 case "TESTAIMG" : 49 case "TESTAIMG" :
48 - $versao = \admin\php\funcoesAdmin\versao();  
49 - $versao = $versao["principal"];  
50 - ms_ResetErrorList();  
51 - $tempo = microtime(true);  
52 - $retorno = testaMapaImg($tema); 50 + $versao = \admin\php\funcoesAdmin\versao ();
  51 + $versao = $versao ["principal"];
  52 + ms_ResetErrorList ();
  53 + $tempo = microtime ( true );
  54 + $retorno = testaMapaImg ( $tema );
53 \admin\php\funcoesAdmin\retornaJSON ( $retorno ); 55 \admin\php\funcoesAdmin\retornaJSON ( $retorno );
54 break; 56 break;
55 case "TESTATABELA" : 57 case "TESTATABELA" :
56 - $versao = \admin\php\funcoesAdmin\versao();  
57 - $versao = $versao["principal"];  
58 - ms_ResetErrorList();  
59 - $tempo = microtime(true);  
60 - $retorno = testaTabela($tema); 58 + $versao = \admin\php\funcoesAdmin\versao ();
  59 + $versao = $versao ["principal"];
  60 + ms_ResetErrorList ();
  61 + $tempo = microtime ( true );
  62 + $retorno = testaTabela ( $tema );
61 \admin\php\funcoesAdmin\retornaJSON ( $retorno ); 63 \admin\php\funcoesAdmin\retornaJSON ( $retorno );
62 break; 64 break;
63 } 65 }
64 -function mapaBase($locaplic,$versao,$base){  
65 - if($base == "" || !isset($base)){ 66 +function mapaBase($locaplic, $versao, $base) {
  67 + if ($base == "" || ! isset ( $base )) {
66 $base = ""; 68 $base = "";
67 - if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){  
68 - $base = $_SESSION["locaplic"]."/aplicmap/geral1windowsv".$versao.".map";  
69 - }  
70 - else{  
71 - if($base == "" && file_exists('/var/www/i3geo/aplicmap/geral1debianv'.$versao.'.map')){  
72 - $base = "/var/www/i3geo/aplicmap/geral1debianv".$versao.".map"; 69 + if (strtoupper ( substr ( PHP_OS, 0, 3 ) == 'WIN' )) {
  70 + $base = $_SESSION ["locaplic"] . "/aplicmap/geral1windowsv" . $versao . ".map";
  71 + } else {
  72 + if ($base == "" && file_exists ( '/var/www/i3geo/aplicmap/geral1debianv' . $versao . '.map' )) {
  73 + $base = "/var/www/i3geo/aplicmap/geral1debianv" . $versao . ".map";
73 } 74 }
74 - if($base == "" && file_exists('/var/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){  
75 - $base = "/var/www/html/i3geo/aplicmap/geral1fedorav".$versao.".map"; 75 + if ($base == "" && file_exists ( '/var/www/html/i3geo/aplicmap/geral1fedorav' . $versao . '.map' )) {
  76 + $base = "/var/www/html/i3geo/aplicmap/geral1fedorav" . $versao . ".map";
76 } 77 }
77 - if($base == "" && file_exists('/opt/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){  
78 - $base = "/opt/www/html/i3geo/aplicmap/geral1v".$versao.".map"; 78 + if ($base == "" && file_exists ( '/opt/www/html/i3geo/aplicmap/geral1fedorav' . $versao . '.map' )) {
  79 + $base = "/opt/www/html/i3geo/aplicmap/geral1v" . $versao . ".map";
79 } 80 }
80 - if($base == ""){  
81 - $base = $_SESSION["locaplic"]."/aplicmap/geral1v".$versao.".map"; 81 + if ($base == "") {
  82 + $base = $_SESSION ["locaplic"] . "/aplicmap/geral1v" . $versao . ".map";
82 } 83 }
83 } 84 }
84 } 85 }
85 return $base; 86 return $base;
86 } 87 }
87 -function testaTabela($tema){  
88 - global $versao,$base,$tempo;  
89 - $dir_tmp = $_SESSION["dir_tmp"];  
90 - $postgis_mapa = $_SESSION["postgis_mapa"];  
91 - $locaplic = $_SESSION["locaplic"];  
92 - $base = mapaBase($locaplic,$versao,$base); 88 +function testaTabela($tema) {
  89 + global $versao, $base, $tempo;
  90 + $dir_tmp = $_SESSION ["dir_tmp"];
  91 + $postgis_mapa = $_SESSION ["postgis_mapa"];
  92 + $locaplic = $_SESSION ["locaplic"];
  93 + $base = mapaBase ( $locaplic, $versao, $base );
93 94
94 - $mapa = ms_newMapObj($base);  
95 - $nmapa = ms_newMapObj($tema);  
96 - error_reporting (E_ALL);  
97 - ms_ResetErrorList(); 95 + $mapa = ms_newMapObj ( $base );
  96 + $nmapa = ms_newMapObj ( $tema );
  97 + error_reporting ( E_ALL );
  98 + ms_ResetErrorList ();
98 99
99 $numlayers = $nmapa->numlayers; 100 $numlayers = $nmapa->numlayers;
100 $dados = ""; 101 $dados = "";
101 - for ($i=0;$i < $numlayers;$i++){  
102 - $layern = $nmapa->getlayer($i);  
103 - $layern->set("status",MS_DEFAULT);  
104 - error_reporting (E_ALL);  
105 - if($layern->classitem != "" && $layern->connectiontype == 7 && $layern->numclasses > 0 && $layern->getmetadata("wms_sld_body") == ""){ 102 + for($i = 0; $i < $numlayers; $i ++) {
  103 + $layern = $nmapa->getlayer ( $i );
  104 + $layern->set ( "status", MS_DEFAULT );
  105 + error_reporting ( E_ALL );
  106 + if ($layern->classitem != "" && $layern->connectiontype == 7 && $layern->numclasses > 0 && $layern->getmetadata ( "wms_sld_body" ) == "") {
106 $tipotemp = $layern->type; 107 $tipotemp = $layern->type;
107 - $tiporep = $layern->getmetadata("tipooriginal");  
108 - $layern->set("type",MS_LAYER_POLYGON);  
109 - if ($tiporep == "linear"){  
110 - $layern->set("type",MS_LAYER_LINE); 108 + $tiporep = $layern->getmetadata ( "tipooriginal" );
  109 + $layern->set ( "type", MS_LAYER_POLYGON );
  110 + if ($tiporep == "linear") {
  111 + $layern->set ( "type", MS_LAYER_LINE );
111 } 112 }
112 - if ($tiporep == "pontual"){  
113 - $layern->set("type",MS_LAYER_POINT); 113 + if ($tiporep == "pontual") {
  114 + $layern->set ( "type", MS_LAYER_POINT );
114 } 115 }
115 - $sld = $layern->generateSLD();  
116 - if($sld != ""){  
117 - $layern->setmetadata("wms_sld_body",str_replace('"',"'",$sld)); 116 + $sld = $layern->generateSLD ();
  117 + if ($sld != "") {
  118 + $layern->setmetadata ( "wms_sld_body", str_replace ( '"', "'", $sld ) );
118 } 119 }
119 - $layern->set("type",$tipotemp); 120 + $layern->set ( "type", $tipotemp );
120 } 121 }
121 - $layerAdicionado = ms_newLayerObj($mapa, $layern); 122 + $layerAdicionado = ms_newLayerObj ( $mapa, $layern );
122 $pegarext = $layern->name; 123 $pegarext = $layern->name;
123 } 124 }
124 125
125 - zoomTema($pegarext,$mapa);  
126 - include_once($_SESSION["locaplic"]."/classesphp/classe_atributos.php"); 126 + zoomTema ( $pegarext, $mapa );
  127 + include_once ($_SESSION ["locaplic"] . "/classesphp/classe_atributos.php");
127 128
128 - $t = new Atributos($mapa,$layern->name); 129 + $t = new Atributos ( $mapa, $layern->name );
129 130
130 - $r = $t->itensTexto();  
131 - $colunas = explode(";",$r["itens"]); 131 + $r = $t->itensTexto ();
  132 + $colunas = explode ( ";", $r ["itens"] );
132 133
133 - $ncolunas = count($colunas);  
134 - $registros = $r["valores"];  
135 - $nregistros = count($registros); 134 + $ncolunas = count ( $colunas );
  135 + $registros = $r ["valores"];
  136 + $nregistros = count ( $registros );
136 $error = ""; 137 $error = "";
137 - $error = ms_GetErrorObj(); 138 + $error = ms_GetErrorObj ();
138 $tab = ""; 139 $tab = "";
139 - while($error && $error->code != MS_NOERR){ 140 + while ( $error && $error->code != MS_NOERR ) {
140 $tab .= "<br>Error in %s: %s<br>"; 141 $tab .= "<br>Error in %s: %s<br>";
141 $tab .= $error->routine; 142 $tab .= $error->routine;
142 $tab .= $error->message; 143 $tab .= $error->message;
143 - $error = $error->next(); 144 + $error = $error->next ();
144 } 145 }
145 $tab .= "Registros em ISO-8859-1 s&atilde;o convertidos para UTF8<br>"; 146 $tab .= "Registros em ISO-8859-1 s&atilde;o convertidos para UTF8<br>";
146 - $tab .= "Registros: ".$nregistros;"<br>"; 147 + $tab .= "Registros: " . $nregistros;
  148 + "<br>";
147 $tab .= "<br><b>Tempo leitura (s): "; 149 $tab .= "<br><b>Tempo leitura (s): ";
148 - $tab .= microtime(true) - $tempo; 150 + $tab .= microtime ( true ) - $tempo;
149 $tab .= "</b>"; 151 $tab .= "</b>";
150 $tab .= "<table>"; 152 $tab .= "<table>";
151 $tab .= "<tr>"; 153 $tab .= "<tr>";
152 - foreach($colunas as $co){  
153 - $tab .= "<td><b>".$co."</b></td>"; 154 + foreach ( $colunas as $co ) {
  155 + $tab .= "<td><b>" . $co . "</b></td>";
154 } 156 }
155 $tab .= "</tr>"; 157 $tab .= "</tr>";
156 - foreach($registros as $reg){ 158 + foreach ( $registros as $reg ) {
157 $tab .= "<tr>"; 159 $tab .= "<tr>";
158 - $cc = explode(";",$reg);  
159 - foreach($cc as $c){ 160 + $cc = explode ( ";", $reg );
  161 + foreach ( $cc as $c ) {
160 if (mb_detect_encoding ( $c, 'UTF-8, ISO-8859-1' ) == "ISO-8859-1") { 162 if (mb_detect_encoding ( $c, 'UTF-8, ISO-8859-1' ) == "ISO-8859-1") {
161 $c = utf8_encode ( $c ); 163 $c = utf8_encode ( $c );
162 } 164 }
163 - $tab .= "<td>".$c."</td>"; 165 + $tab .= "<td>" . $c . "</td>";
164 } 166 }
165 $tab .= "</tr>"; 167 $tab .= "</tr>";
166 } 168 }
167 $tab .= "</table>"; 169 $tab .= "</table>";
168 $tab .= "<br><b>Tempo total (montagem da tabela) (s): "; 170 $tab .= "<br><b>Tempo total (montagem da tabela) (s): ";
169 - $tab .= microtime(true) - $tempo; 171 + $tab .= microtime ( true ) - $tempo;
170 $tab .= "</b>"; 172 $tab .= "</b>";
171 return $tab; 173 return $tab;
172 } 174 }
173 -function testaMapaImg($tema){  
174 - global $versao,$base,$tempo;  
175 - $dir_tmp = $_SESSION["dir_tmp"];  
176 - $postgis_mapa = $_SESSION["postgis_mapa"];  
177 - $locaplic = $_SESSION["locaplic"];  
178 - $base = mapaBase($_SESSION["locaplic"],$versao,$base);  
179 - $mapa = ms_newMapObj($base);  
180 - error_reporting (E_ALL);  
181 - ms_ResetErrorList(); 175 +function testaMapaImg($tema) {
  176 + global $versao, $base, $tempo;
  177 + $dir_tmp = $_SESSION ["dir_tmp"];
  178 + $postgis_mapa = $_SESSION ["postgis_mapa"];
  179 + $locaplic = $_SESSION ["locaplic"];
  180 + $base = mapaBase ( $_SESSION ["locaplic"], $versao, $base );
  181 + $mapa = ms_newMapObj ( $base );
  182 + error_reporting ( E_ALL );
  183 + ms_ResetErrorList ();
182 try { 184 try {
183 ms_newMapObj ( $tema ); 185 ms_newMapObj ( $tema );
184 } catch ( Exception $e ) { 186 } catch ( Exception $e ) {
185 - return array("imgMapa"=>"","imgLegenda"=>"","tempo"=> (microtime(true) - $tempo),"erro"=>"Objeto map nao pode ser criado. Erro fatal.");  
186 - }  
187 - if(@ms_newMapObj($tema)){  
188 - $nmapa = ms_newMapObj($tema); 187 + return array (
  188 + "imgMapa" => "",
  189 + "imgLegenda" => "",
  190 + "tempo" => (microtime ( true ) - $tempo),
  191 + "erro" => "Objeto map nao pode ser criado. Erro fatal."
  192 + );
189 } 193 }
190 - else{ 194 + if (@ms_newMapObj ( $tema )) {
  195 + $nmapa = ms_newMapObj ( $tema );
  196 + } else {
191 $erro = ""; 197 $erro = "";
192 - $error = ms_GetErrorObj();  
193 - while($error && $error->code != MS_NOERR){ 198 + $error = ms_GetErrorObj ();
  199 + while ( $error && $error->code != MS_NOERR ) {
194 $erro .= "<br>Error in %s: %s<br>\n"; 200 $erro .= "<br>Error in %s: %s<br>\n";
195 - $erro .= "<br>".$error->routine;  
196 - $erro .= "<br>".$error->message;  
197 - $error = $error->next(); 201 + $erro .= "<br>" . $error->routine;
  202 + $erro .= "<br>" . $error->message;
  203 + $error = $error->next ();
198 } 204 }
199 - return array("imgMapa"=>"","imgLegenda"=>"","tempo"=> (microtime(true) - $tempo),"erro"=>$erro); 205 + return array (
  206 + "imgMapa" => "",
  207 + "imgLegenda" => "",
  208 + "tempo" => (microtime ( true ) - $tempo),
  209 + "erro" => $erro
  210 + );
200 } 211 }
201 - \admin\php\funcoesAdmin\substituiConObj($mapa,$postgis_mapa);  
202 - \admin\php\funcoesAdmin\substituiConObj($nmapa,$postgis_mapa); 212 + \admin\php\funcoesAdmin\substituiConObj ( $mapa, $postgis_mapa );
  213 + \admin\php\funcoesAdmin\substituiConObj ( $nmapa, $postgis_mapa );
203 214
204 $numlayers = $nmapa->numlayers; 215 $numlayers = $nmapa->numlayers;
205 $dados = ""; 216 $dados = "";
206 - $simbolos = array();  
207 - for ($i=0;$i < $numlayers;$i++){  
208 - $layern = $nmapa->getlayer($i);  
209 - $layern->set("status",MS_DEFAULT);  
210 - autoClasses($layern,$nmapa);  
211 - error_reporting (E_ALL);  
212 - if($layern->classitem != "" && $layern->connectiontype == 7 && $layern->numclasses > 0 && $layern->getmetadata("wms_sld_body") == ""){ 217 + $simbolos = array ();
  218 + for($i = 0; $i < $numlayers; $i ++) {
  219 + $layern = $nmapa->getlayer ( $i );
  220 + $layern->set ( "status", MS_DEFAULT );
  221 + autoClasses ( $layern, $nmapa );
  222 + error_reporting ( E_ALL );
  223 + if ($layern->classitem != "" && $layern->connectiontype == 7 && $layern->numclasses > 0 && $layern->getmetadata ( "wms_sld_body" ) == "") {
213 $tipotemp = $layern->type; 224 $tipotemp = $layern->type;
214 - $tiporep = $layern->getmetadata("tipooriginal");  
215 - $layern->set("type",MS_LAYER_POLYGON);  
216 - if ($tiporep == "linear"){  
217 - $layern->set("type",MS_LAYER_LINE); 225 + $tiporep = $layern->getmetadata ( "tipooriginal" );
  226 + $layern->set ( "type", MS_LAYER_POLYGON );
  227 + if ($tiporep == "linear") {
  228 + $layern->set ( "type", MS_LAYER_LINE );
218 } 229 }
219 - if ($tiporep == "pontual"){  
220 - $layern->set("type",MS_LAYER_POINT); 230 + if ($tiporep == "pontual") {
  231 + $layern->set ( "type", MS_LAYER_POINT );
221 } 232 }
222 - $sld = $layern->generateSLD();  
223 - if($sld != ""){  
224 - $layern->setmetadata("wms_sld_body",str_replace('"',"'",$sld)); 233 + $sld = $layern->generateSLD ();
  234 + if ($sld != "") {
  235 + $layern->setmetadata ( "wms_sld_body", str_replace ( '"', "'", $sld ) );
225 } 236 }
226 - $layern->set("type",$tipotemp); 237 + $layern->set ( "type", $tipotemp );
227 } 238 }
228 - //pega simbolos locais e aplica no novo mapa  
229 - cloneInlineSymbol($layern,$nmapa,$mapa); 239 + // pega simbolos locais e aplica no novo mapa
  240 + cloneInlineSymbol ( $layern, $nmapa, $mapa );
230 241
231 - $layerAdicionado = ms_newLayerObj($mapa, $layern); 242 + $layerAdicionado = ms_newLayerObj ( $mapa, $layern );
232 243
233 - corrigeLayerGrid($layern,$layerAdicionado); 244 + corrigeLayerGrid ( $layern, $layerAdicionado );
234 $pegarext = $layern->name; 245 $pegarext = $layern->name;
235 } 246 }
236 - zoomTema($pegarext,$mapa);  
237 - $mapa->setsize(500,500); 247 + zoomTema ( $pegarext, $mapa );
  248 + $mapa->setsize ( 500, 500 );
238 $sca = $mapa->scalebar; 249 $sca = $mapa->scalebar;
239 - $sca->set("status",MS_OFF);  
240 - $objImagem = @$mapa->draw();  
241 - //corrige o titulo da legenda 250 + $sca->set ( "status", MS_OFF );
  251 + $objImagem = @$mapa->draw ();
  252 + // corrige o titulo da legenda
242 $numlayers = $mapa->numlayers; 253 $numlayers = $mapa->numlayers;
243 - for ($j=0;$j < $numlayers;$j++){  
244 - $l = $mapa->getlayer($j);  
245 - if($l->type != 3 && $l->type != 4){ 254 + for($j = 0; $j < $numlayers; $j ++) {
  255 + $l = $mapa->getlayer ( $j );
  256 + if ($l->type != 3 && $l->type != 4) {
246 $nclass = $l->numclasses; 257 $nclass = $l->numclasses;
247 - for($i=0;$i<$nclass;$i++){  
248 - $classe = $l->getclass($i);  
249 - if($classe->title === ""){ 258 + for($i = 0; $i < $nclass; $i ++) {
  259 + $classe = $l->getclass ( $i );
  260 + if ($classe->title === "") {
250 $classe->title = $classe->name; 261 $classe->title = $classe->name;
251 } 262 }
252 } 263 }
253 } 264 }
254 } 265 }
255 - $objImagemLegenda = @$mapa->drawLegend();  
256 - if (!$objImagem){ 266 + $objImagemLegenda = @$mapa->drawLegend ();
  267 + if (! $objImagem) {
257 $error = ""; 268 $error = "";
258 $erro = ""; 269 $erro = "";
259 - $error = ms_GetErrorObj();  
260 - while($error && $error->code != MS_NOERR){  
261 - $erro .= "<br>Error in %s: %s<br>"; 270 + $error = ms_GetErrorObj ();
  271 + while ( $error && $error->code != MS_NOERR ) {
  272 + $erro .= "<br>Error in %s: %s<br>";
262 $erro .= "<br>" . $error->routine; 273 $erro .= "<br>" . $error->routine;
263 $erro .= "<br>" . $error->message; 274 $erro .= "<br>" . $error->message;
264 - $error = $error->next(); 275 + $error = $error->next ();
265 } 276 }
266 - return array("imgMapa"=>"","imgLegenda"=>"","tempo"=> (microtime(true) - $tempo),"erro"=>$erro); 277 + return array (
  278 + "imgMapa" => "",
  279 + "imgLegenda" => "",
  280 + "tempo" => (microtime ( true ) - $tempo),
  281 + "erro" => $erro
  282 + );
267 } 283 }
268 - if($objImagem->imagepath == ""){  
269 - return array("imgMapa"=>"","imgLegenda"=>"","tempo"=> (microtime(true) - $tempo),"erro"=>"Erro IMAGEPATH vazio"); 284 + if ($objImagem->imagepath == "") {
  285 + return array (
  286 + "imgMapa" => "",
  287 + "imgLegenda" => "",
  288 + "tempo" => (microtime ( true ) - $tempo),
  289 + "erro" => "Erro IMAGEPATH vazio"
  290 + );
270 } 291 }
271 - $nomec = ($objImagem->imagepath).\admin\php\funcoesAdmin\nomeRandomico()."teste.png";  
272 - $objImagem->saveImage($nomec); 292 + $nomec = ($objImagem->imagepath) . \admin\php\funcoesAdmin\nomeRandomico () . "teste.png";
  293 + $objImagem->saveImage ( $nomec );
273 294
274 - $nomel = ($objImagemLegenda->imagepath).\admin\php\funcoesAdmin\nomeRandomico()."testel.png";  
275 - $objImagemLegenda->saveImage($nomel); 295 + $nomel = ($objImagemLegenda->imagepath) . \admin\php\funcoesAdmin\nomeRandomico () . "testel.png";
  296 + $objImagemLegenda->saveImage ( $nomel );
276 297
277 $erro = ""; 298 $erro = "";
278 $error = ""; 299 $error = "";
279 - $error = ms_GetErrorObj();  
280 - while($error && $error->code != MS_NOERR){ 300 + $error = ms_GetErrorObj ();
  301 + while ( $error && $error->code != MS_NOERR ) {
281 $erro .= "<br>Error in %s: %s<br>"; 302 $erro .= "<br>Error in %s: %s<br>";
282 $erro .= "<br>" . $error->routine; 303 $erro .= "<br>" . $error->routine;
283 $erro .= "<br>" . $error->message; 304 $erro .= "<br>" . $error->message;
284 - $error = $error->next(); 305 + $error = $error->next ();
285 } 306 }
286 - return array("imgMapa"=>($objImagem->imageurl).basename($nomec),"imgLegenda"=>($objImagemLegenda->imageurl).basename($nomel),"tempo"=> (microtime(true) - $tempo),"erro"=>$erro); 307 + return array (
  308 + "imgMapa" => ($objImagem->imageurl) . basename ( $nomec ),
  309 + "imgLegenda" => ($objImagemLegenda->imageurl) . basename ( $nomel ),
  310 + "tempo" => (microtime ( true ) - $tempo),
  311 + "erro" => $erro
  312 + );
287 } 313 }
288 -function zoomTema($nomelayer,&$mapa){  
289 - $layer = $mapa->getlayerbyname($nomelayer);  
290 - if($layer->data == "" && $layer->connection == "")  
291 - {return;}  
292 - $prjMapa = $mapa->getProjection();  
293 - $prjTema = $layer->getProjection(); 314 +function zoomTema($nomelayer, &$mapa) {
  315 + $layer = $mapa->getlayerbyname ( $nomelayer );
  316 + if ($layer->data == "" && $layer->connection == "") {
  317 + return;
  318 + }
  319 + $prjMapa = $mapa->getProjection ();
  320 + $prjTema = $layer->getProjection ();
294 $extatual = $mapa->extent; 321 $extatual = $mapa->extent;
295 - $ret = $layer->getmetadata("extensao");  
296 - if($layer->type > 2 && $ret == "")  
297 - {return;} 322 + $ret = $layer->getmetadata ( "extensao" );
  323 + if ($layer->type > 2 && $ret == "") {
  324 + return;
  325 + }
298 $ct = $layer->connectiontype; 326 $ct = $layer->connectiontype;
299 - if(($ret == "") && ($ct != 1))  
300 - {return;}  
301 - if ($ret == ""){  
302 - $ret = $layer->getextent();  
303 - //reprojeta o retangulo  
304 - if (($prjTema != "") && ($prjMapa != $prjTema)){  
305 - $projInObj = ms_newprojectionobj($prjTema);  
306 - $projOutObj = ms_newprojectionobj($prjMapa);  
307 - $ret->project($projInObj, $projOutObj); 327 + if (($ret == "") && ($ct != 1)) {
  328 + return;
  329 + }
  330 + if ($ret == "") {
  331 + $ret = $layer->getextent ();
  332 + // reprojeta o retangulo
  333 + if (($prjTema != "") && ($prjMapa != $prjTema)) {
  334 + $projInObj = ms_newprojectionobj ( $prjTema );
  335 + $projOutObj = ms_newprojectionobj ( $prjMapa );
  336 + $ret->project ( $projInObj, $projOutObj );
  337 + }
  338 + $extatual->setextent ( $ret->minx, $ret->miny, $ret->maxx, $ret->maxy );
  339 + } else {
  340 + $ret = explode ( " ", $ret );
  341 + $extatual->setextent ( $ret [0], $ret [1], $ret [2], $ret [3] );
  342 + }
  343 +}
  344 +function autoClasses(&$nlayer, $mapa, $locaplic = null) {
  345 + $postgis_mapa = $_SESSION ["postgis_mapa"];
  346 + ;
  347 + $substituicon = "nao";
  348 + if ($nlayer->connectiontype == MS_POSTGIS) {
  349 + if ($nlayer->connection == " ") {
  350 + $nlayer->set ( "connection", $postgis_mapa );
  351 + $substituicon = "sim";
  352 + }
  353 + }
  354 + //
  355 + // gera classes automaticamente (temas vetoriais)
  356 + if ($nlayer->getmetadata ( "classesitem" ) != "") {
  357 + $itemnome = $nlayer->getmetadata ( "classesnome" );
  358 + $itemid = $nlayer->getmetadata ( "classesitem" );
  359 + $itemcor = $nlayer->getmetadata ( "classescor" );
  360 + $itemsimbolo = $nlayer->getmetadata ( "classesimbolo" );
  361 + $itemtamanho = $nlayer->getmetadata ( "classestamanho" );
  362 + $classeoriginal = $nlayer->getclass ( 0 );
  363 + //
  364 + // pega a extensao geografica que devera ser utilizada
  365 + //
  366 + $prjMapa = $mapa->getProjection ();
  367 + $prjTema = $nlayer->getProjection ();
  368 + $ret = $nlayer->getmetadata ( "extensao" );
  369 + if ($ret == "") {
  370 + $ret = $nlayer->getextent ();
  371 + // reprojeta o retangulo
  372 + if (($prjTema != "") && ($prjMapa != $prjTema)) {
  373 + $projInObj = ms_newprojectionobj ( $prjTema );
  374 + $projOutObj = ms_newprojectionobj ( $prjMapa );
  375 + $ret->project ( $projInObj, $projOutObj );
  376 + }
  377 + } else {
  378 + $temp = explode ( " ", $ret );
  379 + $ret = ms_newRectObj ();
  380 + $ret->setextent ( $temp [0], $temp [1], $temp [2], $temp [3] );
  381 + }
  382 + //
  383 + $sopen = $nlayer->open ();
  384 + if ($sopen == MS_FAILURE) {
  385 + return "erro";
  386 + }
  387 +
  388 + $status = $nlayer->whichShapes ( $ret );
  389 + $parametrosClasses = array ();
  390 + if ($status == 0) {
  391 + while ( $shape = $nlayer->nextShape () ) {
  392 + $id = trim ( $shape->values [$itemid] );
  393 + if (! $parametrosClasses [$id]) {
  394 + $nome = "";
  395 + if ($itemnome != "")
  396 + $nome = trim ( $shape->values [$itemnome] );
  397 + $cor = "";
  398 + if ($itemcor != "")
  399 + $cor = explode ( ",", trim ( $shape->values [$itemcor] ) );
  400 + if (count ( $cor ) != 3)
  401 + $cor = explode ( " ", trim ( $shape->values [$itemcor] ) );
  402 + $tamanho = "";
  403 + if ($itemtamanho != "")
  404 + $tamanho = trim ( $shape->values [$itemtamanho] );
  405 + $simbolo = "";
  406 + if ($itemsimbolo != "")
  407 + $simbolo = trim ( $shape->values [$itemsimbolo] );
  408 + $parametrosClasses [$id] = array (
  409 + "nome" => $nome,
  410 + "cor" => $cor,
  411 + "tamanho" => $tamanho,
  412 + "simbolo" => $simbolo
  413 + );
  414 + }
  415 + }
  416 + $fechou = $nlayer->close ();
  417 + // echo "<pre>";var_dump($parametrosClasses);
  418 + if (count ( $parametrosClasses ) > 0) {
  419 + $ids = array_keys ( $parametrosClasses );
  420 + for($i = 0; $i < count ( $parametrosClasses ); ++ $i) {
  421 + $p = $parametrosClasses [$ids [$i]];
  422 + // echo "<pre>";var_dump($p);
  423 + $nclasse = ms_newClassObj ( $nlayer, $classeoriginal );
  424 + if ($p ["nome"] != "")
  425 + $nclasse->set ( "name", $p ["nome"] );
  426 + $estilo = $nclasse->getstyle ( 0 );
  427 + if ($p ["cor"] != "") {
  428 + $cor = $p ["cor"];
  429 + $ncor = $estilo->color;
  430 + if ($ncor == "")
  431 + $ncor = $estilo->outlinecolor;
  432 + $ncor->setrgb ( $cor [0], $cor [1], $cor [2] );
  433 + }
  434 + if ($p ["tamanho"] != "")
  435 + $estilo->set ( "size", $p ["tamanho"] );
  436 + if ($p ["simbolo"] != "")
  437 + $estilo->set ( "symbolname", $p ["simbolo"] );
  438 + $strE = "('[" . $itemid . "]'eq'" . $ids [$i] . "')";
  439 + $nclasse->setexpression ( $strE );
  440 + }
  441 + $classeoriginal->set ( "status", MS_DELETE );
  442 + }
  443 + }
  444 + if ($substituicon == "sim") {
  445 + $nlayer->set ( "connection", " " );
308 } 446 }
309 - $extatual->setextent($ret->minx,$ret->miny,$ret->maxx,$ret->maxy);  
310 } 447 }
311 - else{  
312 - $ret = explode(" ",$ret);  
313 - $extatual->setextent($ret[0],$ret[1],$ret[2],$ret[3]); 448 + $pf = $nlayer->getmetadata ( "palletefile" );
  449 + if ($pf != "") {
  450 + if (! file_exists ( $pf )) {
  451 + return;
  452 + }
  453 + $ps = $nlayer->getmetadata ( "palletesteps" );
  454 + if ($ps == "")
  455 + $ps = 8;
  456 + //
  457 + // pega os valores do arquivo
  458 + //
  459 + $rules = array ();
  460 + $abre = fopen ( $pf, "r" );
  461 + $paletteRules = array ();
  462 + while ( ! feof ( $abre ) ) {
  463 + $line = trim ( fgets ( $abre ) );
  464 + $pos = strpos ( $line, "#" );
  465 + if ($pos === false || $pos > 0) {
  466 + $paletteEntry = explode ( " ", $line );
  467 + $rules [] = array (
  468 + "v0" => $paletteEntry [0],
  469 + "v1" => $paletteEntry [1],
  470 + "r0" => $paletteEntry [2],
  471 + "g0" => $paletteEntry [3],
  472 + "b0" => $paletteEntry [4],
  473 + "r1" => $paletteEntry [5],
  474 + "g1" => $paletteEntry [6],
  475 + "b1" => $paletteEntry [7]
  476 + );
  477 + }
  478 + }
  479 + fclose ( $abre );
  480 + foreach ( $rules as $rule ) {
  481 + $delta = ceil ( ($rule ["v1"] - $rule ["v0"]) / $ps );
  482 + $legenda = true;
  483 + for($value = $rule ["v0"]; $value < $rule ["v1"]; $value += $delta) {
  484 + $class = ms_newClassObj ( $nlayer );
  485 + $style = ms_newStyleObj ( $class );
  486 + if ($legenda) {
  487 + $class->set ( name, round ( $value, 0 ) );
  488 + $legenda = true;
  489 + }
  490 + $expression = "([pixel] > " . round ( $value, 0 ) . " AND [pixel] <= " . round ( $value + $delta, 0 ) . ")";
  491 + $class->setExpression ( $expression );
  492 + $rgb = getRGBpallete ( $rule, $value );
  493 + $style->color->setRGB ( $rgb [0], $rgb [1], $rgb [2] );
  494 + }
  495 + }
314 } 496 }
  497 + return;
315 } 498 }
  499 +function getRGBpallete($rule, $value) {
  500 + $escala = ($value - $rule ["v0"]) / ($rule ["v1"] - $rule ["v0"]);
  501 + $r = $rule ["r0"] + round ( ($rule ["r1"] - $rule ["r0"]) * $escala, 0 );
  502 + $g = $rule ["g0"] + round ( ($rule ["g1"] - $rule ["g0"]) * $escala, 0 );
  503 + $b = $rule ["b0"] + round ( ($rule ["b1"] - $rule ["b0"]) * $escala, 0 );
  504 + return array (
  505 + $r,
  506 + $g,
  507 + $b
  508 + );
  509 +}
  510 +function cloneInlineSymbol($layern, $nmapa, $mapa) {
  511 + $numclasses = $layern->numclasses;
  512 + for($ci = 0; $ci < $numclasses; $ci ++) {
  513 + $classe = $layern->getclass ( $ci );
  514 + $numestilos = $classe->numstyles;
  515 + for($ei = 0; $ei < $numestilos; $ei ++) {
  516 + $estilo = $classe->getstyle ( $ei );
  517 + if ($estilo->symbolname != "") {
  518 + $nomesimbolo = $estilo->symbolname;
  519 + $simbolo = $nmapa->getSymbolObjectById ( $nmapa->getSymbolByName ( $nomesimbolo ) );
  520 + if ($simbolo->inmapfile == MS_TRUE || file_exists ( $nomesimbolo )) {
  521 + $simbolon = new symbolObj ( $mapa, $nomesimbolo );
  522 + $simbolon->set ( "inmapfile", MS_TRUE );
  523 +
  524 + $simbolon->setImagePath ( $simbolo->imagepath );
  525 + $simbolon->setPoints ( $simbolo->getPointsArray () );
  526 + // $simbolon->setPattern($simbolo->getPatternArray());
  527 + $simbolon->set ( "type", $simbolo->type );
  528 + // $simbolon->set("antialias",$simbolo->antialias);
  529 + $simbolon->set ( "character", $simbolo->character );
  530 + $simbolon->set ( "filled", $simbolo->filled );
316 531
  532 + // $simbolon->set("font",$simbolo->font);
  533 + // $simbolon->set("position",$simbolo->position);
  534 + $simbolon->set ( "sizex", $simbolo->sizex );
  535 + $simbolon->set ( "sizey", $simbolo->sizey );
  536 + $simbolon->set ( "transparent", $simbolo->transparent );
  537 + $simbolon->set ( "transparentcolor", $simbolo->transparentcolor );
  538 + // $simbolon->set("anchorpoint",$simbolo->anchorpoint);
  539 + }
  540 + }
  541 + }
  542 + }
  543 +}
  544 +function corrigeLayerGrid($layerOrigem,$layerDestino){
  545 + if($layerOrigem->connectiontype == MS_GRATICULE){
  546 + ms_newgridobj($layerDestino);
  547 + $layerDestino->grid->set("labelformat", $layerOrigem->grid->labelformat);
  548 + $layerDestino->grid->set("mininterval", $layerOrigem->grid->mininterval);
  549 + $layerDestino->grid->set("maxinterval", $layerOrigem->grid->maxinterval);
  550 + $layerDestino->grid->set("minsubdivide", $layerOrigem->grid->minsubdivide);
  551 + $layerDestino->grid->set("maxsubdivide", $layerOrigem->grid->maxsubdivide);
  552 + $layerDestino->grid->set("minarcs", $layerOrigem->grid->minarcs);
  553 + $layerDestino->grid->set("maxarcs", $layerOrigem->grid->maxarcs);
  554 + //$layerDestino->updatefromstring("LAYER GRID LABELFORMAT '" . $layerOrigem->grid->labelformat . "' END END");
  555 + }
  556 +}
317 ?> 557 ?>
admin1/php/checaLogin.php
@@ -53,7 +53,10 @@ function checaLogin(){ @@ -53,7 +53,10 @@ function checaLogin(){
53 session_id ( $_COOKIE ["i3geocodigologin"] ); 53 session_id ( $_COOKIE ["i3geocodigologin"] );
54 session_start (); 54 session_start ();
55 if(empty($_SESSION["locaplic"])){ 55 if(empty($_SESSION["locaplic"])){
56 - header ( "HTTP/1.1 403 Inicie o sistema pela pagina principal" ); 56 + if(defined("ONDEI3GEO")){
  57 + header("Location:" . ONDEI3GEO . "/admin1/index.php");
  58 + }
  59 + //header ( "HTTP/1.1 403 Inicie o sistema pela pagina principal" );
57 exit; 60 exit;
58 } 61 }
59 //verifica tambem se o usuario entrou pela pagina de administracao principal 62 //verifica tambem se o usuario entrou pela pagina de administracao principal
@@ -71,6 +74,7 @@ function checaLogin(){ @@ -71,6 +74,7 @@ function checaLogin(){
71 } 74 }
72 } else { 75 } else {
73 header ( "HTTP/1.1 403 Usuario nao logado" ); 76 header ( "HTTP/1.1 403 Usuario nao logado" );
  77 + //header("Location:");
74 exit (); 78 exit ();
75 } 79 }
76 // verifica se o login pode ser realizado 80 // verifica se o login pode ser realizado
admin1/php/funcoesAdmin.php
@@ -506,7 +506,7 @@ function substituiCon($map_file,$postgis_mapa) @@ -506,7 +506,7 @@ function substituiCon($map_file,$postgis_mapa)
506 } 506 }
507 return true; 507 return true;
508 } 508 }
509 -function substituiConObj($mapa,$postgis_mapa){ 509 +function substituiConObj($objMap,$postgis_mapa){
510 error_reporting (E_ALL); 510 error_reporting (E_ALL);
511 if (!empty($postgis_mapa)){ 511 if (!empty($postgis_mapa)){
512 $numlayers = $objMap->numlayers; 512 $numlayers = $objMap->numlayers;
ferramentas/atalhosedicao/index.js
@@ -132,6 +132,7 @@ i3GEOF.atalhosedicao = @@ -132,6 +132,7 @@ i3GEOF.atalhosedicao =
132 } 132 }
133 }); 133 });
134 $i("i3GEOFatalhosedicaoTme-button").style.width = "200px"; 134 $i("i3GEOFatalhosedicaoTme-button").style.width = "200px";
  135 +
135 new YAHOO.widget.Button("i3GEOFatalhosedicaoStorymap", { 136 new YAHOO.widget.Button("i3GEOFatalhosedicaoStorymap", {
136 onclick : { 137 onclick : {
137 fn : function() { 138 fn : function() {
@@ -142,6 +143,17 @@ i3GEOF.atalhosedicao = @@ -142,6 +143,17 @@ i3GEOF.atalhosedicao =
142 }); 143 });
143 $i("i3GEOFatalhosedicaoStorymap-button").style.width = "200px"; 144 $i("i3GEOFatalhosedicaoStorymap-button").style.width = "200px";
144 145
  146 +
  147 + new YAHOO.widget.Button("i3GEOFatalhosedicaoAnimagif", {
  148 + onclick : {
  149 + fn : function() {
  150 + i3GEO.temaAtivo = i3GEOF.atalhosedicao.tema;
  151 + i3GEO.tema.dialogo.animagif(i3GEOF.atalhosedicao.tema);
  152 + }
  153 + }
  154 + });
  155 + $i("i3GEOFatalhosedicaoAnimagif-button").style.width = "200px";
  156 +
145 new YAHOO.widget.Button("i3GEOFatalhosedicaoTemaComGrafico", { 157 new YAHOO.widget.Button("i3GEOFatalhosedicaoTemaComGrafico", {
146 onclick : { 158 onclick : {
147 fn : function() { 159 fn : function() {
ferramentas/atalhosedicao/template_mst.html
@@ -80,8 +80,10 @@ @@ -80,8 +80,10 @@
80 <p class='paragrafo'> 80 <p class='paragrafo'>
81 <input id='i3GEOFatalhosedicaoTme' type='button' value='TME' /> 81 <input id='i3GEOFatalhosedicaoTme' type='button' value='TME' />
82 </p> 82 </p>
83 - <br>  
84 - <p class='paragrafo'> 83 + <p class='paragrafo'>
85 <input id='i3GEOFatalhosedicaoStorymap' type='button' value='Storymap' /> 84 <input id='i3GEOFatalhosedicaoStorymap' type='button' value='Storymap' />
86 </p> 85 </p>
  86 + <p class='paragrafo'>
  87 + <input id='i3GEOFatalhosedicaoAnimagif' type='button' value='Animagif' />
  88 + </p>
87 </div> 89 </div>
88 \ No newline at end of file 90 \ No newline at end of file
temas/_lbiomashp.map
@@ -6,38 +6,38 @@ MAP @@ -6,38 +6,38 @@ MAP
6 DATA "/var/www/i3geo/aplicmap/dados/biomas.shp" 6 DATA "/var/www/i3geo/aplicmap/dados/biomas.shp"
7 METADATA 7 METADATA
8 "METAESTAT_ID_MEDIDA_VARIAVEL" "" 8 "METAESTAT_ID_MEDIDA_VARIAVEL" ""
9 - "cache" "SIM"  
10 "TIP" "CD_LEGENDA" 9 "TIP" "CD_LEGENDA"
  10 + "cache" "SIM"
11 "CLASSE" "sim" 11 "CLASSE" "sim"
12 - "permitekmz" "SIM"  
13 "temporizador" "" 12 "temporizador" ""
14 - "ITENSDESC" "Teste de acentuação" 13 + "permitekmz" "SIM"
15 "iconetema" "" 14 "iconetema" ""
16 - "editavel" ""  
17 - "ESCALA" "250000" 15 + "ITENSDESC" "Teste de acentuação"
18 "TILES" "SIM" 16 "TILES" "SIM"
  17 + "ESCALA" "250000"
  18 + "editavel" ""
19 "METAESTAT_CODIGO_TIPO_REGIAO" "" 19 "METAESTAT_CODIGO_TIPO_REGIAO" ""
20 "extensao" "-73.990940816816 -33.74827031115 -34.822855820777 5.272224303909" 20 "extensao" "-73.990940816816 -33.74827031115 -34.822855820777 5.272224303909"
21 "permitedownload" "SIM" 21 "permitedownload" "SIM"
22 "permitecomentario" "NAO" 22 "permitecomentario" "NAO"
23 - "metaestat" ""  
24 "escondido" "NAO" 23 "escondido" "NAO"
25 - "esquematabelaeditavel" "" 24 + "metaestat" ""
26 "download" "SIM" 25 "download" "SIM"
  26 + "esquematabelaeditavel" ""
27 "itembuscarapida" "CD_LEGENDA" 27 "itembuscarapida" "CD_LEGENDA"
28 - "arquivokmz" ""  
29 - "arquivodownload" ""  
30 "ITENS" "CD_LEGENDA" 28 "ITENS" "CD_LEGENDA"
31 - "transitioneffect" "NAO"  
32 - "permiteogc" "SIM" 29 + "arquivodownload" ""
  30 + "arquivokmz" ""
33 "permitekml" "SIM" 31 "permitekml" "SIM"
34 - "TEMA" "Biomas shapefile (acentuação)" 32 + "permiteogc" "SIM"
  33 + "transitioneffect" "NAO"
35 "convcaracter" "SIM" 34 "convcaracter" "SIM"
36 - "colunageometria" ""  
37 - "colunaidunico" "" 35 + "TEMA" "Biomas shapefile (acentuação)"
38 "cortepixels" "" 36 "cortepixels" ""
39 - "aplicaextensao" "NAO" 37 + "colunaidunico" ""
  38 + "colunageometria" ""
40 "identifica" "sim" 39 "identifica" "sim"
  40 + "aplicaextensao" "NAO"
41 "tabelaeditavel" "" 41 "tabelaeditavel" ""
42 END # METADATA 42 END # METADATA
43 NAME "_lbiomashp" 43 NAME "_lbiomashp"
@@ -46,6 +46,7 @@ MAP @@ -46,6 +46,7 @@ MAP
46 PROCESSING "POLYLINE_NO_CLIP=True" 46 PROCESSING "POLYLINE_NO_CLIP=True"
47 STATUS DEFAULT 47 STATUS DEFAULT
48 TEMPLATE "none.htm" 48 TEMPLATE "none.htm"
  49 + TILEITEM "location"
49 OPACITY 90 50 OPACITY 90
50 TYPE POLYGON 51 TYPE POLYGON
51 UNITS METERS 52 UNITS METERS