From efcda52dfbedceecb3b7fb59efd8413bb3aa83e3 Mon Sep 17 00:00:00 2001
From: Edmar Moretti
Date: Tue, 1 Mar 2011 22:14:06 +0000
Subject: [PATCH]
---
admin/admin.db | Bin 70656 -> 0 bytes
classesphp/classe_analise.php | 54 ++++++++++++++++++++++++++++++------------------------
classesphp/classe_atributos.php | 7 ++++---
classesphp/funcoes_gerais.php | 9 +++++----
classesphp/mapa_controle.php | 2 +-
ferramentas/analisageometrias/index.js.php | 9 +++++----
ferramentas/centromassa/index.js.php | 12 +++++++-----
7 files changed, 52 insertions(+), 41 deletions(-)
diff --git a/admin/admin.db b/admin/admin.db
index 0a31808..ce4ae64 100644
Binary files a/admin/admin.db and b/admin/admin.db differ
diff --git a/classesphp/classe_analise.php b/classesphp/classe_analise.php
index ab58c12..fb163a7 100644
--- a/classesphp/classe_analise.php
+++ b/classesphp/classe_analise.php
@@ -98,7 +98,7 @@ $ext - Extensão geográfica do mapa
$this->mapa = ms_newMapObj($map_file);
$this->arquivo = $map_file;
if($tema != "" && @$this->mapa->getlayerbyname($tema))
- $this->layer = $this->mapa->getlayerbyname($tema);
+ {$this->layer = $this->mapa->getlayerbyname($tema);}
$this->nome = $tema;
$this->diretorio = dirname($this->arquivo);
if($ext && $ext != ""){
@@ -949,9 +949,9 @@ $locaplic - Localização do I3geo.
{
set_time_limit(180);
if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php"))
- include_once($this->locaplic."/pacotes/phpxbase/api_conversion.php");
+ {include_once($this->locaplic."/pacotes/phpxbase/api_conversion.php");}
else
- include_once "../pacotes/phpxbase/api_conversion.php";
+ {include_once "../pacotes/phpxbase/api_conversion.php";}
$layerPt = $this->mapa->getlayerbyname($temaPt);
$layerPt->set("template","none.htm");
$layerPt->set("tolerance",0);
@@ -967,7 +967,6 @@ $locaplic - Localização do I3geo.
{
if($layerPt->getProjection() == "" )
{$layerPt->setProjection("init=epsg:4291");}
- $layerPt->setProjection("init=epsg:4291");
}
$layerPt->queryByrect($this->mapa->extent);
}
@@ -976,17 +975,16 @@ $locaplic - Localização do I3geo.
//pega um shape especifico
$sopen = $layerPt->open();
if($sopen == MS_FAILURE){return "erro";}
+ $spts = array();
for ($i = 0; $i < $res_count; ++$i)
{
$result = $layerPt->getResult($i);
$shp_index = $result->shapeindex;
$shape = $layerPt->getfeature($shp_index,-1);
- $pontos[] = $shape;
+ $spts[] = $shape;
}
$layerPt->close();
//gera o novo arquivo shape file
- // cria o shapefile
- $novoshpf = ms_newShapefileObj($nomeshp, MS_SHP_POINT);
// cria o dbf
$def = array();
foreach ($itemspt as $ni)
@@ -994,16 +992,26 @@ $locaplic - Localização do I3geo.
//pega os itens dos temas poligonais
$layersPol = array();
$temas = explode(",",$temasPo);
- foreach ($temas as $tema)
- {
- $l = $this->mapa->getlayerbyname($tema);
- $layers[] = $l;
- }
+ $layers = array();
$nomesitens = array(); //guarda os nomes dos temas e seus itens
$conta = 0;
- foreach ($layers as $layer)
+ $listaItens = array();
+ foreach ($temas as $tema)
{
+ $layer = $this->mapa->getlayerbyname($tema);
+ $layer->set("template","none.htm");
+ $layer->set("status",MS_DEFAULT);
+ if($layer->type == MS_LAYER_RASTER)
+ {
+ $lineo = $spts[0]->line(0);
+ $pt = $lineo->point(0);
+ $layer->queryByPoint($pt, 0, 0);
+ }
+ $layers[] = $layer;
$items = pegaItens($layer);
+ if(!$items)
+ {return "erro ao obter a lista de itens do tema $layer->name";}
+ $listaItens[$layer->name] = $items;
foreach ($items as $ni)
{
$def[] = array("I".$conta,"C","254");
@@ -1011,22 +1019,21 @@ $locaplic - Localização do I3geo.
$conta = $conta + 1;
}
}
- if(!function_exists(dbase_create))
+ if(!function_exists("dbase_create"))
{$db = xbase_create($nomeshp.".dbf", $def);xbase_close($db);}
else
{$db = dbase_create($nomeshp.".dbf", $def);dbase_close($db);}
//acrescenta os pontos no novo shapefile
$dbname = $nomeshp.".dbf";
- $db=xbase_open($dbname,2);
- foreach($pontos as $ponto)
+ $db=xbase_open($dbname,2);
+ // cria o shapefile
+ $novoshpf = ms_newShapefileObj($nomeshp, MS_SHP_POINT);
+ foreach($spts as $spt)
{
- $sopen = $layerPt->open();
- if($sopen == MS_FAILURE){return "erro";}
foreach ($itemspt as $ni)
- {$reg[] = $ponto->values[$ni];}
- $layerPt->close();
- $novoshpf->addShape($ponto);
- $lineo = $ponto->line(0);
+ {$reg[] = $spt->values[$ni];}
+ $novoshpf->addShape($spt);
+ $lineo = $spt->line(0);
$pt = $lineo->point(0);
//faz a pesquisa
foreach ($layers as $layer)
@@ -1035,8 +1042,7 @@ $locaplic - Localização do I3geo.
$layer->set("toleranceunits",MS_PIXELS);
$layer->set("tolerance",1);
$ident = @$layer->queryByPoint($pt, 0, 0);
- $itens = pegaItens($layer);
- $res_count = $layer->getNumresults();
+ $itens = $listaItens[$layer->name];
$sopen = $layer->open();
if($sopen == MS_FAILURE){return "erro";}
if ($res_count > 0)
diff --git a/classesphp/classe_atributos.php b/classesphp/classe_atributos.php
index fa6eb42..d3ba474 100644
--- a/classesphp/classe_atributos.php
+++ b/classesphp/classe_atributos.php
@@ -778,7 +778,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado
{
$l = $this->mapa->getlayerbyname($tema);
if($l->status == MS_DEFAULT)
- $novalista[] = $tema;
+ {$novalista[] = $tema;}
$listatemas = $novalista;
}
}
@@ -1036,7 +1036,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado
else
{
$descisarray = pegaItens($layer);
- $itsarray = pegaItens($layer);
+ $itsarray = $descisarray;
$lksarray = array();
}
}
@@ -1213,7 +1213,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado
{
$layer->set("toleranceunits",MS_PIXELS);
$layer->set("tolerance",$resolucao);
- $ident = @$layer->queryByPoint($pt, 0, 0); //0.01);
+ $ident = @$layer->queryByPoint($pt, 0, 0); //0.01);
}
//error_reporting(E_ALL);
if (($layer->type == MS_LAYER_POINT) || ($layer->type == MS_LAYER_LINE) || ($layer->type == MS_LAYER_CHART))
@@ -1238,6 +1238,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado
$locimg = $layer->getmetadata("IMGLOC"); //indica o local onde estão os ícones
$tips = $layer->getmetadata("TIP");
$itensLayer = pegaItens($layer);
+ //var_dump($itensLayer);exit;
$nitens = count($itensLayer);
if($itens == "")
{$itens = $itensLayer;}
diff --git a/classesphp/funcoes_gerais.php b/classesphp/funcoes_gerais.php
index 85734e2..a651fb2 100644
--- a/classesphp/funcoes_gerais.php
+++ b/classesphp/funcoes_gerais.php
@@ -1337,9 +1337,10 @@ function pegaItens($layer)
{
$sopen = $layer->open();
if($sopen != MS_FAILURE)
- $items = $layer->getItems();
+ {$items = $layer->getItems();}
else
- $items = array();
+ {$items = array();}
+ $layer->close();
return $items;
}
/*
@@ -1359,7 +1360,8 @@ Retorno:
*/
function buscaRapida($servico,$palavra)
{
- if (function_exists('ereg'))
+ //error_reporting(E_ALL);
+ if(!function_exists('preg_match'))
{
include_once('../pacotes/SOAPdepreciado/nusoap.php');
new Xsoapclient($servico."?wsdl","wsdl");
@@ -1369,7 +1371,6 @@ function buscaRapida($servico,$palavra)
include_once('../pacotes/SOAP/nusoap.php');
$soapclient = new nusoap_client($servico);
}
-
$vv = "erro";
$vv = $soapclient->call("procurar",array("palavra"=>$palavra,"tipoBusca"=>"qualquer"));
if($vv == ""){$vv = "erro";}
diff --git a/classesphp/mapa_controle.php b/classesphp/mapa_controle.php
index f0cee8b..d0297ce 100644
--- a/classesphp/mapa_controle.php
+++ b/classesphp/mapa_controle.php
@@ -403,7 +403,7 @@ Salva o mapa acrescentando um novo layer com o resultado.
case "PONTOEMPOLIGONO":
include_once("classe_analise.php");
copiaSeguranca($map_file);
- $m = new Analise($map_file,$tema,$locaplic,$ext);
+ $m = new Analise($map_file,$temaPt,$locaplic,$ext);
if($interface == "googlemaps")
{
$projMapa = $m->mapa->getProjection();
diff --git a/ferramentas/analisageometrias/index.js.php b/ferramentas/analisageometrias/index.js.php
index e9b8e4d..eaf99ef 100644
--- a/ferramentas/analisageometrias/index.js.php
+++ b/ferramentas/analisageometrias/index.js.php
@@ -138,7 +138,7 @@ i3GEOF.analisaGeometrias = {
ins += '';
@@ -168,7 +168,7 @@ i3GEOF.analisaGeometrias = {
ins += ' ';
ins += ' ';
ins += ' ';
- ins += '
';
+ ins += ' ';
ins += ' Operações que criam novas geometrias a partir de duas ou mais geometrias:';
ins += '
';
+ ins += ' ';
ins += ' Operações que atuam sobre uma única geometria:';
ins += '
';
+ ins += ' ';
ins += ' ';
ins += '
As operações de análise são executadas sobre as geometrias selecionadas.';
ins += '
Para maiores informações, veja: OGC, PostGis, e JTS';
@@ -232,6 +232,7 @@ i3GEOF.analisaGeometrias = {
};
YAHOO.util.Event.addListener(janela[0].close, "click", temp);
i3GEOF.analisaGeometrias.inicia(divid);
+ i3GEO.util.mudaCursor(i3GEO.configura.cursores,"pointer",i3GEO.Interface.IDMAPA,i3GEO.configura.locaplic);
},
/*
Function: ativaFoco
diff --git a/ferramentas/centromassa/index.js.php b/ferramentas/centromassa/index.js.php
index c3d81af..69762f6 100644
--- a/ferramentas/centromassa/index.js.php
+++ b/ferramentas/centromassa/index.js.php
@@ -182,18 +182,20 @@ i3GEOF.centromassa = {
i3GEO.util.comboTemas(
"i3GEOFcentromassaPontos",
function(retorno){
- $i("i3GEOcentromassaDivPontos").innerHTML = retorno.dados;
+ $i("i3GEOcentromassaDivPontos").innerHTML = retorno.dados;
+ var c = $i("i3GEOFcentromassaPontos");
$i("i3GEOcentromassaDivPontos").style.display = "block";
- if ($i("i3GEOFcentromassaPontos")){
- $i("i3GEOFcentromassaPontos").onchange = function(){
+ if (c){
+ c.onchange = function(){
$i("i3GEOondeItens").style.display = "block";
$i("i3GEOondeItens").innerHTML = "Aguarde...";
- i3GEO.mapa.ativaTema($i("i3GEOcentromassaPontos").value);
+ i3GEO.mapa.ativaTema(c.value);
i3GEOF.centromassa.comboItens();
};
}
if(i3GEO.temaAtivo !== ""){
- $i("i3GEOFcentromassaPontos").value = i3GEO.temaAtivo;
+ if(c)
+ {c.value = i3GEO.temaAtivo;}
$i("i3GEOondeItens").style.display = "block";
$i("i3GEOondeItens").innerHTML = "Aguarde...";
i3GEOF.centromassa.comboItens();
--
libgit2 0.21.2