Commit a587dfae1e5f9debbd10c071e98326fb79e32bab

Authored by Edmar Moretti
1 parent bbfa1a1d
Exists in master

Atualização do código

ferramentas/identifica/twitter.php
... ... @@ -13,6 +13,7 @@ p {
13 13 </head>
14 14 <body style="background-color: white; margin: 10px">
15 15 <?php
  16 + include_once (dirname(__FILE__)."/../../classesphp/sani_request.php");
16 17 if(empty($_GET["km"]))
17 18 {
18 19 $km = 5;
... ...
ferramentas/identifica/twitterplaces.php
... ... @@ -13,6 +13,7 @@ text-align:left;
13 13 </head>
14 14 <body style="background-color:white;margin:10px">
15 15 <?php
  16 +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php");
16 17 include(dirname(__FILE__)."/../../classesphp/carrega_ext.php");
17 18 $s = PHP_SHLIB_SUFFIX;
18 19 if(!function_exists('curl_init'))
... ...
ferramentas/importarwmc/upload.php
... ... @@ -17,6 +17,7 @@ $map_file = $_SESSION[&quot;map_file&quot;];
17 17 <body bgcolor="white" style="background-color:white;text-align:left;">
18 18 <p>
19 19 <?php
  20 +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php");
20 21 error_reporting(0);
21 22 require_once (dirname(__FILE__)."/../../ms_configura.php");
22 23 $dirmap = dirname($map_file);
... ...
ferramentas/inserexy2/exec.php
1 1 <?php
2   -include_once(dirname(__FILE__)."/../inicia.php");
  2 +include_once(dirname(__FILE__)."/../safe.php");
3 3 //
4 4 //faz a busca da fun&ccedil;&atilde;o que deve ser executada
5 5 //
... ... @@ -17,18 +17,14 @@ Insere um ponto em um shape file existente.
17 17 include_once(dirname(__FILE__)."/../../classesphp/classe_shp.php");
18 18 copiaSeguranca($map_file);
19 19 $m = new SHP($map_file,$tema);
20   - if (!isset($projecao)){$projecao = "";}
21   - $m->insereSHP($xy,$projecao,$item,$valor);
  20 + if (!isset($_GET["projecao"])){$_GET["projecao"] = "";}
  21 + $m->insereSHP($_GET["xy"],$_GET["projecao"],$_GET["item"],$_GET["valor"]);
22 22 $_SESSION["contadorsalva"]++;
23 23 redesenhaMapa();
24 24 break;
25 25 }
26   -if (!connection_aborted()){
27   - if(isset($map_file) && isset($postgis_mapa) && $map_file != "")
  26 +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){
28 27 restauraCon($map_file,$postgis_mapa);
29   - cpjson($retorno);
30 28 }
31   -else
32   -{exit();}
33   -
  29 +cpjson($retorno);
34 30 ?>
35 31 \ No newline at end of file
... ...
ferramentas/markercluster/.project
... ... @@ -1,17 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<projectDescription>
3   - <name>ferramentas heatmap</name>
4   - <comment></comment>
5   - <projects>
6   - </projects>
7   - <buildSpec>
8   - <buildCommand>
9   - <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
10   - <arguments>
11   - </arguments>
12   - </buildCommand>
13   - </buildSpec>
14   - <natures>
15   - <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
16   - </natures>
17   -</projectDescription>
ferramentas/markercluster/.settings/.jsdtscope
... ... @@ -1,4 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<classpath>
3   - <classpathentry kind="output" path=""/>
4   -</classpath>
ferramentas/markercluster/.settings/org.eclipse.wst.jsdt.ui.superType.container
... ... @@ -1 +0,0 @@
1   -org.eclipse.wst.jsdt.launching.JRE_CONTAINER
2 0 \ No newline at end of file
ferramentas/markercluster/.settings/org.eclipse.wst.jsdt.ui.superType.name
... ... @@ -1 +0,0 @@
1   -Global
2 0 \ No newline at end of file
ferramentas/markercluster/exec.php
1 1 <?php
2   -include_once(dirname(__FILE__)."/../inicia.php");
  2 +include_once(dirname(__FILE__)."/../safe.php");
3 3 //
4 4 //faz a busca da fun&ccedil;&atilde;o que deve ser executada
5 5 //
... ... @@ -17,7 +17,7 @@ Adiciona ao mapa uma nova camada para calculo do mapa de calor
17 17 $layer = $map->getlayerbyname($tema);
18 18 $novolayer = ms_newLayerObj($map, $layer);
19 19 $novolayer->setmetadata("tema",$titulo);
20   - $parametros = '{"plugin":"markercluster","parametros":{"tipoEstilos": "default","opacity":"'.$opacidade.'","gridSize":"'.$gridSize.'"}}';
  20 + $parametros = '{"plugin":"markercluster","parametros":{"tipoEstilos": "default","opacity":"'.$_GET["opacidade"].'","gridSize":"'.$_GET["gridSize"].'"}}';
21 21 $novolayer->setmetadata("PLUGINI3GEO",$parametros);
22 22 $novolayer->set("name",$nameLayer);
23 23 $novolayer->set("group","");
... ... @@ -25,10 +25,8 @@ Adiciona ao mapa uma nova camada para calculo do mapa de calor
25 25 $retorno = $nameLayer;
26 26 break;
27 27 }
28   -if (!connection_aborted()){
29   - cpjson($retorno);
30   -}
31   -else{
32   - exit();
  28 +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){
  29 + restauraCon($map_file,$postgis_mapa);
33 30 }
  31 +cpjson($retorno);
34 32 ?>
35 33 \ No newline at end of file
... ...
ferramentas/markercluster/funcoes.php
... ... @@ -20,9 +20,8 @@ function markerclusterDados($map_file){
20 20 $resultado[] = '{"lat":"'.$r["y"].'","lng":"'.$r["x"].'","count":"'.$r["valores"][0]["valor"].'"}';
21 21 }
22 22 }
23   - if (!connection_aborted()){
24   - if(isset($map_file) && isset($postgis_mapa) && $map_file != "")
25   - restauraCon($map_file,$postgis_mapa);
  23 + if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){
  24 + restauraCon($map_file,$postgis_mapa);
26 25 }
27 26 return $resultado;
28 27 }
... ... @@ -60,11 +59,9 @@ function markerclusterMapfile(){
60 59  
61 60 $tempMapa = ms_newMapObj($dir."/../../temas/{$layer}.map");
62 61 $layern = $tempMapa->getlayer(0);
  62 + restauraConObj($mapa,$postgis_mapa);
63 63 ms_newLayerObj($mapa, $layern);
64 64 $mapa->save($map_file);
65   - if(!empty($postgis_mapa)){
66   - //substituiCon($map_file,$postgis_mapa);
67   - }
68 65 }
69 66 return $map_file;
70 67 }
... ...
ferramentas/markercluster/googlemaps_js.php
... ... @@ -17,10 +17,14 @@ nomevariavel nome da variavel javascript que sera retornada com os valores
17 17 */
18 18 $dir = dirname(__FILE__);
19 19 //inicializa o programa verificando seguranca e pegando os parametros enviados pela URL e pela secao
20   -include_once($dir."/../inicia.php");
  20 +include_once($dir."/../safe.php");
21 21  
22 22 include_once($dir."/funcoes.php");
23 23  
  24 +$layer = $_GET["layer"];
  25 +$tipoEstilos = $_GET["tipoEstilos"];
  26 +$coluna = $_GET["coluna"];
  27 +
24 28 $map_file = markerclusterMapfile();
25 29 $resultado = markerclusterDados($map_file);
26 30 $tipoEstilos = markerclusterEstilos($map_file,$layer,$tipoEstilos);
... ...
ferramentas/markercluster/openlayers_js.php
... ... @@ -18,34 +18,29 @@ nomevariavel nome da variavel javascript que sera retornada com os valores
18 18 $dir = dirname(__FILE__);
19 19  
20 20 //inicializa o programa verificando seguranca e pegando os parametros enviados pela URL e pela secao
21   -include_once($dir."/../inicia.php");
  21 +include_once($dir."/../safe.php");
22 22 include_once($dir."/funcoes.php");
23 23  
  24 +$layer = $_GET["layer"];
  25 +$tipoEstilos = $_GET["tipoEstilos"];
  26 +$coluna = $_GET["coluna"];
  27 +
24 28 //o plugin pode ser chamado sem um mapfile criado
25 29 //usando apenas o mapfile existente em i3geo/temas
26 30 //nesse caso e necessario cirar um mapfile temporario
27   -if($g_sid != ""){
28   - session_name("i3GeoPHP");
29   - session_id($g_sid);
30   - session_start();
31   - if(!empty($_SESSION["map_file"])){
32   - $mapateste = ms_newMapObj($_SESSION["map_file"]);
33   - if($mapateste->getlayerbyname($layer) != ""){
34   - $map_file = $_SESSION["map_file"];
35   - }
  31 +if(!empty($_SESSION["map_file"])){
  32 + $mapateste = ms_newMapObj($_SESSION["map_file"]);
  33 + if($mapateste->getlayerbyname($layer) != ""){
  34 + $map_file = $_SESSION["map_file"];
  35 + }
  36 + else{
  37 + $map_file = "";
36 38 }
37 39 }
38 40 $map_file = markerclusterMapfile();
39 41 //no caso do SAIKU, o nome do mapfile pode estar na sessao
40 42 if($map_file == ""){
41   - session_name("i3GeoPHP");
42   - session_start();
43   - if(!empty($_SESSION["map_file"])){
44   - $mapateste = ms_newMapObj($_SESSION["map_file"]);
45   - if($mapateste->getlayerbyname($layer) != ""){
46   - $map_file = $_SESSION["map_file"];
47   - }
48   - }
  43 + $map_file = $_SESSION["map_file"];
49 44 }
50 45 $resultado = markerclusterDados($map_file);
51 46 $tipoEstilos = markerclusterEstilos($map_file,$layer,$tipoEstilos);
... ...
ferramentas/mascara/exec.php
1 1 <?php
2   -include_once(dirname(__FILE__)."/../inicia.php");
  2 +include_once(dirname(__FILE__)."/../safe.php");
3 3 //
4 4 //faz a busca da fun&ccedil;&atilde;o que deve ser executada
5 5 //
... ... @@ -21,7 +21,7 @@ switch (strtoupper($funcao))
21 21 case "APLICAR":
22 22 $map = ms_newMapObj($map_file);
23 23 $c = $map->numlayers;
24   - $mascarar = explode(",",$mascarar);
  24 + $mascarar = explode(",",$_GET["mascarar"]);
25 25 for ($i=0;$i < $c;++$i) {
26 26 $l = $map->getlayer($i);
27 27 if($l->mask == $tema){
... ... @@ -35,9 +35,8 @@ switch (strtoupper($funcao))
35 35 $map->save($map_file);
36 36 break;
37 37 }
38   -if (!connection_aborted()){
39   - cpjson($retorno);
  38 +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){
  39 + restauraCon($map_file,$postgis_mapa);
40 40 }
41   -else
42   -{exit();}
  41 +cpjson($retorno);
43 42 ?>
44 43 \ No newline at end of file
... ...
ferramentas/melhorcaminho/exec.php
1 1 <?php
2   -include_once(dirname(__FILE__)."/../inicia.php");
  2 +include_once(dirname(__FILE__)."/../safe.php");
3 3 //
4 4 //faz a busca da fun&ccedil;&atilde;o que deve ser executada
5 5 //
... ... @@ -43,7 +43,7 @@ switch (strtoupper($funcao))
43 43 case "MELHORCAMINHO":
44 44 //converte os parametros em um arquivo YAML
45 45 $mapa = ms_newMapObj($map_file);
46   - $layer = $mapa->getlayerbyname($raster);
  46 + $layer = $mapa->getlayerbyname($_GET["raster"]);
47 47 $cost_surface_path = $layer->data;
48 48 $prefixo = nomeRandomico(3);
49 49 //verifica se o mapa de custo existe
... ... @@ -51,6 +51,8 @@ switch (strtoupper($funcao))
51 51 $pathresult = $dir_tmp."/melhorcaminho_".nomeRandomico();
52 52 //cria a pasta onde os resultados serao armazenados
53 53 mkdir ($pathresult,0744);
  54 + $pta = $_GET["pta"];
  55 + $ptb = $_GET["ptb"];
54 56  
55 57 //parametros para o calculo de melhor caminho e linha reta
56 58 $best = array(
... ... @@ -76,7 +78,7 @@ switch (strtoupper($funcao))
76 78 $buf = array(
77 79 "p3"=> array(
78 80 "calculation_type" =>"best_path_within_buffer",
79   - "buffer_km" => $buffer,
  81 + "buffer_km" => $_GET["buffer"],
80 82 "file_prefix" => $prefixo,
81 83 "start_coord" => "[$pta]",
82 84 "stop_coord" => "[$ptb]"
... ... @@ -85,6 +87,7 @@ switch (strtoupper($funcao))
85 87 $processos[] = $buf;
86 88 }
87 89 //parametros para calculo com reclassificacao
  90 + $lut = $_GET["lut"];
88 91 if($lut != ""){
89 92 //pega os valores da lut
90 93 $lista = explode("|",$lut);
... ... @@ -111,6 +114,7 @@ switch (strtoupper($funcao))
111 114 $processos[] = $lut;
112 115 }
113 116 //parametros para o calculo quando o usuario escolhe um layer que contem um shapefile
  117 + $temausuario = $_GET["temausuario"];
114 118 if($temausuario != ""){
115 119 //exporta o layer como um shapefile pois pode ser postgis
116 120 $shparq = downloadTema2($map_file,$temausuario,$locaplic,$dir_tmp,$postgis_mapa);
... ... @@ -222,7 +226,7 @@ switch (strtoupper($funcao))
222 226 $retorno = $pathresult;
223 227 break;
224 228 case "RELATORIO":
225   - $yaml = yaml_parse_file($caminho."/result.yaml");
  229 + $yaml = yaml_parse_file($_GET["caminho"]."/result.yaml");
226 230 $resultados = $yaml["results"];
227 231 $retorno = array();
228 232 foreach($resultados as $r){
... ... @@ -230,12 +234,8 @@ switch (strtoupper($funcao))
230 234 }
231 235 break;
232 236 }
233   -if (!connection_aborted()){
234   - if(isset($map_file) && isset($postgis_mapa) && $map_file != "")
  237 +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){
235 238 restauraCon($map_file,$postgis_mapa);
236   - cpjson($retorno);
237   -}
238   -else{
239   - exit();
240 239 }
  240 +cpjson($retorno);
241 241 ?>
242 242 \ No newline at end of file
... ...
ferramentas/mmscale/exec.php
1 1 <?php
2   -include_once(dirname(__FILE__)."/../inicia.php");
  2 +include_once(dirname(__FILE__)."/../safe.php");
3 3 //
4 4 //faz a busca da fun&ccedil;&atilde;o que deve ser executada
5 5 //
... ... @@ -13,14 +13,14 @@ Valor: MINMAX
13 13 case "MINMAX":
14 14 $mapa = ms_newMapObj($map_file);
15 15 $layer = $mapa->getlayerbyname($tema);
16   - if(empty($maxscaledenom)){
17   - $maxscaledenom = -1;
  16 + if(empty($_GET["maxscaledenom"])){
  17 + $_GET["maxscaledenom"] = -1;
18 18 }
19   - if(empty($minscaledenom)){
20   - $minscaledenom = -1;
  19 + if(empty($_GET["minscaledenom"])){
  20 + $_GET["minscaledenom"] = -1;
21 21 }
22   - $layer->set("maxscaledenom",$maxscaledenom);
23   - $layer->set("minscaledenom",$minscaledenom);
  22 + $layer->set("maxscaledenom",$_GET["maxscaledenom"]);
  23 + $layer->set("minscaledenom",$_GET["minscaledenom"]);
24 24 $layer->setmetadata("cache","");
25 25 $mapa->save($map_file);
26 26 $retorno = "ok";
... ... @@ -34,12 +34,8 @@ Valor: MINMAX
34 34 );
35 35 break;
36 36 }
37   -if (!connection_aborted()){
38   - if(isset($map_file) && isset($postgis_mapa) && $map_file != "")
  37 +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){
39 38 restauraCon($map_file,$postgis_mapa);
40   - cpjson($retorno);
41   -}
42   -else{
43   - exit();
44 39 }
  40 +cpjson($retorno);
45 41 ?>
... ...
ferramentas/nptpol/exec.php
1 1 <?php
2   -include_once(dirname(__FILE__)."/../inicia.php");
  2 +include_once(dirname(__FILE__)."/../safe.php");
3 3 //
4 4 //faz a busca da fun&ccedil;&atilde;o que deve ser executada
5 5 //
... ... @@ -19,16 +19,13 @@ Salva o mapa acrescentando um novo layer com o resultado.
19 19 include_once(dirname(__FILE__)."/../../classesphp/classe_analise.php");
20 20 copiaSeguranca($map_file);
21 21 $m = new Analise($map_file,$tema,$locaplic,$ext);
22   - $retorno = $m->nptPol($temaPt,$temaPo,$locaplic,$somaritem);
  22 + $retorno = $m->nptPol($_GET["temaPt"],$_GET["temaPo"],$locaplic,$_GET["somaritem"]);
23 23 $m->salva();
24 24 $_SESSION["contadorsalva"]++;
25 25 break;
26 26 }
27   -if (!connection_aborted()){
28   - if(isset($map_file) && isset($postgis_mapa) && $map_file != "")
  27 +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){
29 28 restauraCon($map_file,$postgis_mapa);
30   - cpjson($retorno);
31 29 }
32   -else
33   -{exit();}
  30 +cpjson($retorno);
34 31 ?>
35 32 \ No newline at end of file
... ...
ferramentas/nuvemtags/exec.php
1 1 <?php
2   -include_once(dirname(__FILE__)."/../inicia.php");
  2 +include_once(dirname(__FILE__)."/../safe.php");
3 3 //
4 4 //faz a busca da fun&ccedil;&atilde;o que deve ser executada
5 5 //
... ... @@ -15,16 +15,13 @@ Pega a lista de tags registrados nos menus de temas.
15 15 */
16 16 case "LISTATAGS":
17 17 include_once(dirname(__FILE__)."/../../classesphp/classe_menutemas.php");
18   - $m = new Menutemas($map_file,$perfil,$locaplic,$urli3geo);
19   - $retorno = $m->listatags($rss,$nrss);
  18 + $m = new Menutemas($map_file,$perfil,$locaplic,$_GET["urli3geo"]);
  19 + $retorno = $m->listatags($_GET["rss"],$_GET["nrss"]);
20 20 break;
21 21  
22 22 }
23   -if (!connection_aborted()){
24   - if(isset($map_file) && isset($postgis_mapa) && $map_file != "")
  23 +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){
25 24 restauraCon($map_file,$postgis_mapa);
26   - cpjson($retorno);
27 25 }
28   -else
29   -{exit();}
  26 +cpjson($retorno);
30 27 ?>
31 28 \ No newline at end of file
... ...