From 71f6cef35f43d42856105eacf83c9f9660b5ff05 Mon Sep 17 00:00:00 2001 From: edmarmoretti Date: Tue, 9 Aug 2016 20:52:24 -0300 Subject: [PATCH] Atualização das ferramentas --- ferramentas/conectargeorss/exec.php | 15 +++++---------- ferramentas/congelamapa/openlayers.php | 7 +++++++ ferramentas/congelamapa/openlayers3.php | 6 ++++++ ferramentas/convertews/exec.php | 15 ++++++--------- ferramentas/dissolve/exec.php | 11 ++++------- ferramentas/distanciaptpt/exec.php | 15 ++++++--------- ferramentas/etiqueta/exec.php | 19 ++++++++----------- ferramentas/geonames/opentouchmaps.php | 3 ++- ferramentas/gradecoord/exec.php | 11 ++++------- ferramentas/gradehex/exec.php | 17 +++++++---------- ferramentas/gradepol/exec.php | 22 ++++++++++------------ ferramentas/gradepontos/exec.php | 21 +++++++++------------ ferramentas/graficotema/exec.php | 11 ++++------- ferramentas/heatmap/.project | 17 ----------------- ferramentas/heatmap/.settings/.jsdtscope | 4 ---- ferramentas/heatmap/.settings/org.eclipse.wst.jsdt.ui.superType.container | 1 - ferramentas/heatmap/.settings/org.eclipse.wst.jsdt.ui.superType.name | 1 - ferramentas/heatmap/exec.php | 20 +++++++++----------- ferramentas/heatmap/funcoes.php | 8 ++++---- ferramentas/heatmap/googlemaps_js.php | 12 +++++++++++- ferramentas/heatmap/openlayers_js.php | 13 +++++++++++-- 21 files changed, 113 insertions(+), 136 deletions(-) delete mode 100755 ferramentas/heatmap/.project delete mode 100755 ferramentas/heatmap/.settings/.jsdtscope delete mode 100755 ferramentas/heatmap/.settings/org.eclipse.wst.jsdt.ui.superType.container delete mode 100755 ferramentas/heatmap/.settings/org.eclipse.wst.jsdt.ui.superType.name diff --git a/ferramentas/conectargeorss/exec.php b/ferramentas/conectargeorss/exec.php index 3f5b8cb..1a4afb1 100755 --- a/ferramentas/conectargeorss/exec.php +++ b/ferramentas/conectargeorss/exec.php @@ -1,5 +1,5 @@ adicionaTemaGeoRSS($servico,$dir_tmp,$locaplic,$canal); + $retorno = $m->adicionaTemaGeoRSS($_GET["servico"],$dir_tmp,$locaplic,$_GET["canal"]); if ($retorno != "erro"){ $m->salva(); $_SESSION["contadorsalva"]++; @@ -28,13 +28,8 @@ Adiciona um tema baseado em um RSS. } break; } -if (!connection_aborted()){ - if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ - restauraCon($map_file,$postgis_mapa); - } - cpjson($retorno); -} -else{ - exit; +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ + restauraCon($map_file,$postgis_mapa); } +cpjson($retorno); ?> \ No newline at end of file diff --git a/ferramentas/congelamapa/openlayers.php b/ferramentas/congelamapa/openlayers.php index daf7d67..9944b01 100755 --- a/ferramentas/congelamapa/openlayers.php +++ b/ferramentas/congelamapa/openlayers.php @@ -1,4 +1,5 @@ converteWS($locmapserv,$h); - $wmc = $m->converteWMC($locmapserv,$h); + if(!isset($_GET["h"])){$_GET["h"] = "";} + $wms = $m->converteWS($locmapserv,$_GET["h"]); + $wmc = $m->converteWMC($locmapserv,$_GET["h"]); $retorno = array("wms"=>$wms,"wmc"=>$wmc); break; } -if (!connection_aborted()){ - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ restauraCon($map_file,$postgis_mapa); - cpjson($retorno); } -else -{exit();} +cpjson($retorno); ?> \ No newline at end of file diff --git a/ferramentas/dissolve/exec.php b/ferramentas/dissolve/exec.php index efc62b0..c1aa675 100755 --- a/ferramentas/dissolve/exec.php +++ b/ferramentas/dissolve/exec.php @@ -1,5 +1,5 @@ dissolvePoligono($item,$locaplic); + $retorno = $m->dissolvePoligono($_GET["item"],$locaplic); $m->salva(); $_SESSION["contadorsalva"]++; break; } -if (!connection_aborted()){ - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ restauraCon($map_file,$postgis_mapa); - cpjson($retorno); } -else -{exit();} +cpjson($retorno); ?> \ No newline at end of file diff --git a/ferramentas/distanciaptpt/exec.php b/ferramentas/distanciaptpt/exec.php index e24b3bc..1dbfe13 100755 --- a/ferramentas/distanciaptpt/exec.php +++ b/ferramentas/distanciaptpt/exec.php @@ -1,5 +1,5 @@ criaBuffer($distancia,$locaplic); - $retorno = $m->distanciaptpt($temaorigem,$temadestino,$temaoverlay,$locaplic,$itemorigem,$itemdestino); + $m = new Analise($map_file,$_GET["temaorigem"],$locaplic,$ext); + $temaoverlay = $m->criaBuffer($_GET["distancia"],$locaplic); + $retorno = $m->distanciaptpt($_GET["temaorigem"],$_GET["temadestino"],$temaoverlay,$locaplic,$_GET["itemorigem"],$_GET["itemdestino"]); $m->salva(); $_SESSION["contadorsalva"]++; break; } -if (!connection_aborted()){ - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ restauraCon($map_file,$postgis_mapa); - cpjson($retorno); } -else -{exit();} +cpjson($retorno); ?> \ No newline at end of file diff --git a/ferramentas/etiqueta/exec.php b/ferramentas/etiqueta/exec.php index 8b4132e..7ae54db 100755 --- a/ferramentas/etiqueta/exec.php +++ b/ferramentas/etiqueta/exec.php @@ -1,5 +1,5 @@ layer->setmetadata("IDENTIFICA",""); - $m->layer->setmetadata("TIP",$tips); - $m->layer->setmetadata("ITENS",$itens); + $m->layer->setmetadata("TIP",$_GET["tips"]); + $m->layer->setmetadata("ITENS",$_GET["itens"]); //$m->layer->setmetadata("ITENSDESC",base64_decode($itensdesc)); //$m->layer->setmetadata("ITENSLINK",base64_decode($itenslink)); - $m->layer->setmetadata("ITENSDESC",$itensdesc); - $m->layer->setmetadata("ITENSLINK",$itenslink); - $m->layer->setmetadata("itembuscarapida",$itembuscarapida); + $m->layer->setmetadata("ITENSDESC",$_GET["itensdesc"]); + $m->layer->setmetadata("ITENSLINK",$_GET["itenslink"]); + $m->layer->setmetadata("itembuscarapida",$_GET["itembuscarapida"]); $m->salva(); $_SESSION["contadorsalva"]++; $retorno = "ok"; @@ -57,11 +57,8 @@ Obtém os dados sobre itens, itensdesc, etc $retorno = $m->pegaDadosEtiquetas(); break; } -if (!connection_aborted()){ - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ restauraCon($map_file,$postgis_mapa); - cpjson($retorno); } -else -{exit();} +cpjson($retorno); ?> \ No newline at end of file diff --git a/ferramentas/geonames/opentouchmaps.php b/ferramentas/geonames/opentouchmaps.php index 95ab5dc..728ff6a 100755 --- a/ferramentas/geonames/opentouchmaps.php +++ b/ferramentas/geonames/opentouchmaps.php @@ -14,10 +14,11 @@ text-align:left; O código de barras abaixo pode ser lido por dispositivos móveis, como os celulares ou pdas."; echo "

Se o seu dispositivo possuir o software adequado, fotografe o código para abrir o navegador de internet ou clique no link."; -echo "

$d
"; +echo "

$d
"; echo ""; ?>

diff --git a/ferramentas/gradecoord/exec.php b/ferramentas/gradecoord/exec.php index e74bcf2..9c93677 100755 --- a/ferramentas/gradecoord/exec.php +++ b/ferramentas/gradecoord/exec.php @@ -1,5 +1,5 @@ gradeCoord($intervalo,$corlinha,$larguralinha,$tipolinha,$tamanhotexto,$fonte,$cortexto,$incluitexto,$mascara,$shadowcolor,$shadowsizex,$shadowsizey); + $m->gradeCoord($_GET["intervalo"],$_GET["corlinha"],$_GET["larguralinha"],$_GET["tipolinha"],$_GET["tamanhotexto"],$_GET["fonte"],$_GET["cortexto"],$_GET["incluitexto"],$_GET["mascara"],$_GET["shadowcolor"],$_GET["shadowsizex"],$_GET["shadowsizey"]); $m->salva(); $retorno = "ok"; break; } -if (!connection_aborted()){ - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ restauraCon($map_file,$postgis_mapa); - cpjson($retorno); } -else -{exit();} +cpjson($retorno); ?> \ No newline at end of file diff --git a/ferramentas/gradehex/exec.php b/ferramentas/gradehex/exec.php index 65663bb..56376ab 100755 --- a/ferramentas/gradehex/exec.php +++ b/ferramentas/gradehex/exec.php @@ -1,5 +1,5 @@ gradeDeHex($dd,$px,$py,$locaplic,$nptx,$npty,$proj); + $retorno = $m->gradeDeHex($_GET["dd"],$_GET["px"],$_GET["py"],$locaplic,$_GET["nptx"],$_GET["npty"],$_GET["proj"]); $m->salva(); $_SESSION["contadorsalva"]++; break; } -if (!connection_aborted()){ - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ restauraCon($map_file,$postgis_mapa); - cpjson($retorno); } -else -{exit();} +cpjson($retorno); ?> \ No newline at end of file diff --git a/ferramentas/gradepol/exec.php b/ferramentas/gradepol/exec.php index 32377a6..6ab974a 100755 --- a/ferramentas/gradepol/exec.php +++ b/ferramentas/gradepol/exec.php @@ -1,5 +1,5 @@ gradeDePol($xdd,$ydd,$px,$py,$locaplic,$nptx,$npty,$proj); + else{ + $_GET["proj"] = false; + } + + $retorno = $m->gradeDePol($_GET["dd"],$_GET["px"],$_GET["py"],$locaplic,$_GET["nptx"],$_GET["npty"],$_GET["proj"]); $m->salva(); $_SESSION["contadorsalva"]++; break; } -if (!connection_aborted()){ - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ restauraCon($map_file,$postgis_mapa); - cpjson($retorno); } -else -{exit();} +cpjson($retorno); ?> \ No newline at end of file diff --git a/ferramentas/gradepontos/exec.php b/ferramentas/gradepontos/exec.php index 2831f5c..a6845a3 100755 --- a/ferramentas/gradepontos/exec.php +++ b/ferramentas/gradepontos/exec.php @@ -1,5 +1,5 @@ gradeDePontos($xdd,$ydd,$px,$py,$locaplic,$nptx,$npty,$proj); + else{ + $_GET["proj"] = false; + } + $retorno = $m->gradeDePontos($_GET["dd"],$_GET["px"],$_GET["py"],$locaplic,$_GET["nptx"],$_GET["npty"],$_GET["proj"]); $m->salva(); $_SESSION["contadorsalva"]++; break; } -if (!connection_aborted()){ - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ restauraCon($map_file,$postgis_mapa); - cpjson($retorno); } -else -{exit();} +cpjson($retorno); ?> \ No newline at end of file diff --git a/ferramentas/graficotema/exec.php b/ferramentas/graficotema/exec.php index 21ac969..90ba651 100755 --- a/ferramentas/graficotema/exec.php +++ b/ferramentas/graficotema/exec.php @@ -1,5 +1,5 @@ graficotema($lista,$tamanho,$tipo,$outlinecolor,$offset,$mesmoTema); + $m->graficotema($_GET["lista"],$_GET["tamanho"],$_GET["tipo"],$_GET["outlinecolor"],$_GET["offset"],$_GET["mesmoTema"]); $m->salva(); $_SESSION["contadorsalva"]++; redesenhaMapa(); break; } -if (!connection_aborted()){ - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ restauraCon($map_file,$postgis_mapa); - cpjson($retorno); } -else -{exit();} +cpjson($retorno); ?> \ No newline at end of file diff --git a/ferramentas/heatmap/.project b/ferramentas/heatmap/.project deleted file mode 100755 index ceeee04..0000000 --- a/ferramentas/heatmap/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - ferramentas heatmap - - - - - - org.eclipse.wst.jsdt.core.javascriptValidator - - - - - - org.eclipse.wst.jsdt.core.jsNature - - diff --git a/ferramentas/heatmap/.settings/.jsdtscope b/ferramentas/heatmap/.settings/.jsdtscope deleted file mode 100755 index 0e4b119..0000000 --- a/ferramentas/heatmap/.settings/.jsdtscope +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/ferramentas/heatmap/.settings/org.eclipse.wst.jsdt.ui.superType.container b/ferramentas/heatmap/.settings/org.eclipse.wst.jsdt.ui.superType.container deleted file mode 100755 index 49c8cd4..0000000 --- a/ferramentas/heatmap/.settings/org.eclipse.wst.jsdt.ui.superType.container +++ /dev/null @@ -1 +0,0 @@ -org.eclipse.wst.jsdt.launching.JRE_CONTAINER \ No newline at end of file diff --git a/ferramentas/heatmap/.settings/org.eclipse.wst.jsdt.ui.superType.name b/ferramentas/heatmap/.settings/org.eclipse.wst.jsdt.ui.superType.name deleted file mode 100755 index 11006e2..0000000 --- a/ferramentas/heatmap/.settings/org.eclipse.wst.jsdt.ui.superType.name +++ /dev/null @@ -1 +0,0 @@ -Global \ No newline at end of file diff --git a/ferramentas/heatmap/exec.php b/ferramentas/heatmap/exec.php index ef71d34..16657d7 100755 --- a/ferramentas/heatmap/exec.php +++ b/ferramentas/heatmap/exec.php @@ -1,5 +1,5 @@ getlayerbyname($tema); - $novolayer = ms_newLayerObj($map, $layer); - $novolayer->setmetadata("tema",$titulo); - $parametros = '{"plugin":"heatmap","parametros":{"tipoGradiente":"default","valorPonto":"'.$valorPonto.'","coluna":"'.$coluna.'","radius":"'.$raio.'"}}'; + $novolayer = ms_newLayerObj($map, $_GET["layer"]); + $novolayer->setmetadata("tema",$_GET["titulo"]); + $parametros = '{"plugin":"heatmap","parametros":{"tipoGradiente":"default","valorPonto":"'.$_GET["valorPonto"].'","coluna":"'.$_GET["coluna"].'","radius":"'.$_GET["raio"].'"}}'; $novolayer->setmetadata("PLUGINI3GEO",$parametros); $novolayer->set("name",$nameLayer); $novolayer->set("group",""); - if(!empty($opacidade)){ - $novolayer->set("opacity",$opacidade); + if(!empty($_GET["opacidade_GET["])){ + $novolayer->set("opacity",$_GET["opacidade"]); } $map->save($map_file); $retorno = $nameLayer; break; } -if (!connection_aborted()){ - cpjson($retorno); -} -else{ - exit(); +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ + restauraCon($map_file,$postgis_mapa); } +cpjson($retorno); ?> \ No newline at end of file diff --git a/ferramentas/heatmap/funcoes.php b/ferramentas/heatmap/funcoes.php index 2e09d6c..2c273d9 100755 --- a/ferramentas/heatmap/funcoes.php +++ b/ferramentas/heatmap/funcoes.php @@ -23,10 +23,10 @@ function heatmapDados($map_file){ $resultado[] = '{"lat":"'.$r["y"].'","lng":"'.$r["x"].'","count":"'.$r["valores"][0]["valor"].'"}'; } } - if (!connection_aborted()){ - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") - restauraCon($map_file,$postgis_mapa); + if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ + restauraCon($map_file,$postgis_mapa); } + return $resultado; } function heatmapMapfile(){ @@ -66,7 +66,7 @@ function heatmapMapfile(){ ms_newLayerObj($mapa, $layern); $mapa->save($map_file); if(!empty($postgis_mapa)){ - //substituiCon($map_file,$postgis_mapa); + restauraCon($map_file,$postgis_mapa); } } return $map_file; diff --git a/ferramentas/heatmap/googlemaps_js.php b/ferramentas/heatmap/googlemaps_js.php index 686e7db..7168d0f 100755 --- a/ferramentas/heatmap/googlemaps_js.php +++ b/ferramentas/heatmap/googlemaps_js.php @@ -17,13 +17,23 @@ nomevariavel nome da variavel javascript que sera retornada com os valores */ $dir = dirname(__FILE__); //inicializa o programa verificando seguranca e pegando os parametros enviados pela URL e pela secao -include_once($dir."/../inicia.php"); +include_once($dir."/../safe.php"); include_once($dir."/funcoes.php"); +$layer = $_GET["layer"]; +$tipoGradiente = $_GET["tipoGradiente"]; +$coluna = $_GET["coluna"]; +$valorPonto = $_GET["valorPonto"]; + + $map_file = heatmapMapfile(); $resultado = heatmapDados($map_file); $gradiente = heatmapGradiente($map_file,$layer,$tipoGradiente); +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ + restauraCon($map_file,$postgis_mapa); +} + echo $nomevariavel.' = ['.implode(",",$resultado).'];'; echo $nomevariavelConfig.' = '.$gradiente.';'; diff --git a/ferramentas/heatmap/openlayers_js.php b/ferramentas/heatmap/openlayers_js.php index a3461dc..d7c61ae 100755 --- a/ferramentas/heatmap/openlayers_js.php +++ b/ferramentas/heatmap/openlayers_js.php @@ -18,12 +18,17 @@ nomevariavel nome da variavel javascript que sera retornada com os valores $dir = dirname(__FILE__); //inicializa o programa verificando seguranca e pegando os parametros enviados pela URL e pela secao -include_once($dir."/../inicia.php"); +include_once($dir."/../safe.php"); include_once($dir."/funcoes.php"); +$layer = $_GET["layer"]; +$tipoGradiente = $_GET["tipoGradiente"]; +$coluna = $_GET["coluna"]; +$valorPonto = $_GET["valorPonto"]; + //o plugin pode ser chamado sem um mapfile criado //usando apenas o mapfile existente em i3geo/temas -//nesse caso e necessario cirar um mapfile temporario +//nesse caso e necessario criar um mapfile temporario if($g_sid != ""){ session_name("i3GeoPHP"); session_id($g_sid); @@ -50,6 +55,10 @@ if($map_file == ""){ $resultado = heatmapDados($map_file); $gradiente = heatmapGradiente($map_file,$layer,$tipoGradiente); +if(isset($map_file) && isset($postgis_mapa) && $map_file != ""){ + restauraCon($map_file,$postgis_mapa); +} + echo $nomevariavel.' = ['.implode(",",$resultado).'];'; echo $nomevariavelConfig.' = '.$gradiente.';'; -- libgit2 0.21.2