Commit 60293166ca75f513762f866dfc430ccbc5f2c813
1 parent
b968db97
Exists in
master
and in
7 other branches
ticket #83 fechado - extender a área considerada na geração das imagens nas oper…
…ações de análise de distâncias
Showing
3 changed files
with
27 additions
and
11 deletions
Show diff stats
classesphp/classe_analise.php
@@ -129,22 +129,23 @@ $sigma - desvio padrão para a opção kernel | @@ -129,22 +129,23 @@ $sigma - desvio padrão para a opção kernel | ||
129 | 129 | ||
130 | $limitepontos - "TRUE"|"FALSE" limita o resultado ao limite geográfico dos pontos se "TRUE" ou ao limite do mapa se "FALSE" | 130 | $limitepontos - "TRUE"|"FALSE" limita o resultado ao limite geográfico dos pontos se "TRUE" ou ao limite do mapa se "FALSE" |
131 | 131 | ||
132 | +$extendelimite - extende o limite dos pontos em um determinado percentual em relação a área final de abrangência | ||
132 | Include: | 133 | Include: |
133 | <class.palette.php> | 134 | <class.palette.php> |
134 | */ | 135 | */ |
135 | - function analiseDistriPt($locaplic,$dir_tmp,$R_path,$numclasses,$tipo,$cori,$corf,$tmpurl,$sigma="",$limitepontos="TRUE",$tema2="") | 136 | + function analiseDistriPt($locaplic,$dir_tmp,$R_path,$numclasses,$tipo,$cori,$corf,$tmpurl,$sigma="",$limitepontos="TRUE",$tema2="",$extendelimite=5) |
136 | { | 137 | { |
137 | set_time_limit(180); | 138 | set_time_limit(180); |
138 | // | 139 | // |
139 | //pega os dados do tema dois para as funções que o utilizam | 140 | //pega os dados do tema dois para as funções que o utilizam |
140 | // | 141 | // |
141 | - $dados1 = $this->gravaCoordenadasPt($this->nome,$limitepontos); | 142 | + $dados1 = $this->gravaCoordenadasPt($this->nome,$limitepontos,$extendelimite); |
142 | $nomearq = $dados1["prefixoarquivo"]; | 143 | $nomearq = $dados1["prefixoarquivo"]; |
143 | $dimx = $dados1["dimx"]; | 144 | $dimx = $dados1["dimx"]; |
144 | $dimy = $dados1["dimy"]; | 145 | $dimy = $dados1["dimy"]; |
145 | if (isset($tema2) && $tema2 != "") | 146 | if (isset($tema2) && $tema2 != "") |
146 | { | 147 | { |
147 | - $dados2 = $this->gravaCoordenadasPt($tema2,$limitepontos); | 148 | + $dados2 = $this->gravaCoordenadasPt($tema2,$limitepontos,$extendelimite); |
148 | $nomearq2 = $dados2["prefixoarquivo"]; | 149 | $nomearq2 = $dados2["prefixoarquivo"]; |
149 | $dimx2 = $dados2["dimx"]; | 150 | $dimx2 = $dados2["dimx"]; |
150 | $dimy2 = $dados2["dimy"]; | 151 | $dimy2 = $dados2["dimy"]; |
@@ -2281,11 +2282,13 @@ tema - nome do tema com os pontos | @@ -2281,11 +2282,13 @@ tema - nome do tema com os pontos | ||
2281 | 2282 | ||
2282 | limitepontos - FALSE para considerar a extensão geográfica do mapa atual e TRUE para considerar como limite as ocorrências pontuais do tema | 2283 | limitepontos - FALSE para considerar a extensão geográfica do mapa atual e TRUE para considerar como limite as ocorrências pontuais do tema |
2283 | 2284 | ||
2285 | +extendelimite - percentual utilizado para extender o limite da área resultante | ||
2286 | + | ||
2284 | return: | 2287 | return: |
2285 | 2288 | ||
2286 | array com as dimensões em x e y e nome dos arquivos com x e y gerados. | 2289 | array com as dimensões em x e y e nome dos arquivos com x e y gerados. |
2287 | */ | 2290 | */ |
2288 | -function gravaCoordenadasPt($tema,$limitepontos="TRUE") | 2291 | +function gravaCoordenadasPt($tema,$limitepontos="TRUE",$extendelimite) |
2289 | { | 2292 | { |
2290 | $prjMapa = $this->mapa->getProjection(); | 2293 | $prjMapa = $this->mapa->getProjection(); |
2291 | $layerPt = $this->mapa->getlayerbyname($tema); | 2294 | $layerPt = $this->mapa->getlayerbyname($tema); |
@@ -2353,6 +2356,17 @@ function gravaCoordenadasPt($tema,$limitepontos="TRUE") | @@ -2353,6 +2356,17 @@ function gravaCoordenadasPt($tema,$limitepontos="TRUE") | ||
2353 | $yi = $ext->miny; | 2356 | $yi = $ext->miny; |
2354 | $yf = $ext->maxy; | 2357 | $yf = $ext->maxy; |
2355 | } | 2358 | } |
2359 | + if($extendelimite > 0) | ||
2360 | + { | ||
2361 | + $dx = $xf - $xi; | ||
2362 | + $dy = $yf - $yi; | ||
2363 | + $maisx = ($dx * $extendelimite) / 100; | ||
2364 | + $maisy = ($dy * $extendelimite) / 100; | ||
2365 | + $xi = $xi - $maisx; | ||
2366 | + $xf = $xf + $maisx; | ||
2367 | + $yi = $yi - $maisy; | ||
2368 | + $yf = $yf + $maisy; | ||
2369 | + } | ||
2356 | $dimx = "c(".$xi.",".$xf.")"; | 2370 | $dimx = "c(".$xi.",".$xf.")"; |
2357 | $dimy = "c(".$yi.",".$yf.")"; | 2371 | $dimy = "c(".$yi.",".$yf.")"; |
2358 | return array("dimx"=>$dimx,"dimy"=>$dimy,"arqx"=>($nomearq."x"),"arqy"=>($nomearq."y"),"prefixoarquivo"=>$nomearq); | 2372 | return array("dimx"=>$dimx,"dimy"=>$dimy,"arqx"=>($nomearq."x"),"arqy"=>($nomearq."y"),"prefixoarquivo"=>$nomearq); |
classesphp/mapa_controle.php
@@ -1277,7 +1277,7 @@ Include: | @@ -1277,7 +1277,7 @@ Include: | ||
1277 | if(!isset($limitepontos)) | 1277 | if(!isset($limitepontos)) |
1278 | {$limitepontos = "";} | 1278 | {$limitepontos = "";} |
1279 | $m = new Analise($map_file,$tema); | 1279 | $m = new Analise($map_file,$tema); |
1280 | - $cp->set_data($m->analiseDistriPt($locaplic,$dir_tmp,$R_path,$numclasses,$tipo,$cori,$corf,$tmpurl,$sigma,$limitepontos,$tema2)); | 1280 | + $cp->set_data($m->analiseDistriPt($locaplic,$dir_tmp,$R_path,$numclasses,$tipo,$cori,$corf,$tmpurl,$sigma,$limitepontos,$tema2,$extendelimite)); |
1281 | $m->salva(); | 1281 | $m->salva(); |
1282 | break; | 1282 | break; |
1283 | /* | 1283 | /* |
ferramentas/pontosdistri/index.js
@@ -38,7 +38,9 @@ comboTemasPt("temasPt",function(retorno) | @@ -38,7 +38,9 @@ comboTemasPt("temasPt",function(retorno) | ||
38 | var ins = "<div style=top:0px;left:0px;text-align:left; >Escolha o tema de pontos que será utilizado:</div><br><br>" | 38 | var ins = "<div style=top:0px;left:0px;text-align:left; >Escolha o tema de pontos que será utilizado:</div><br><br>" |
39 | ins += retorno.dados | 39 | ins += retorno.dados |
40 | ins += "<br><br><div style=top:0px;left:0px;text-align:left; >Restringe a análise aos limites de abrangência dos pontos? "+simnao("limitePontos")+"<div>" | 40 | ins += "<br><br><div style=top:0px;left:0px;text-align:left; >Restringe a análise aos limites de abrangência dos pontos? "+simnao("limitePontos")+"<div>" |
41 | - ins += "<br><br><div style=top:0px;left:0px;text-align:left; onclick='analiseDensidade()' ><input id=botao1 size=35 type=button value='Densidade de pontos' /></div><br>" | 41 | + ins += "<br><div style=top:0px;left:-10px;text-align:left; >Extende os limites de abrangência dos pontos em <input type=text size=3 value=10 id=extendelimite /> %<div>" |
42 | + | ||
43 | + ins += "<br><div style=top:0px;left:0px;text-align:left; onclick='analiseDensidade()' ><input id=botao1 size=35 type=button value='Densidade de pontos' /></div><br>" | ||
42 | ins += "<div style=top:0px;left:0px;text-align:left; onclick='analiseDistancia()' ><input id=botao2 size=35 type=button value='Distância entre pontos' /></div><br>" | 44 | ins += "<div style=top:0px;left:0px;text-align:left; onclick='analiseDistancia()' ><input id=botao2 size=35 type=button value='Distância entre pontos' /></div><br>" |
43 | ins += "<div style='padding:1px;left:0px;border: 1px solid gray;'><div style=top:0px;left:0px;text-align:left; onclick='analiseKernel()' ><input id=botaokernel size=35 type=button value='Kernel' /></div>" | 45 | ins += "<div style='padding:1px;left:0px;border: 1px solid gray;'><div style=top:0px;left:0px;text-align:left; onclick='analiseKernel()' ><input id=botaokernel size=35 type=button value='Kernel' /></div>" |
44 | ins += "<div>Desvio padrão (sigma):<input class='digitar' type=text size=3 value='' id=sigma /></div></div><br>" | 46 | ins += "<div>Desvio padrão (sigma):<input class='digitar' type=text size=3 value='' id=sigma /></div></div><br>" |
@@ -114,7 +116,7 @@ function analiseCluster() | @@ -114,7 +116,7 @@ function analiseCluster() | ||
114 | var tema2 = $i("temasPt2").value | 116 | var tema2 = $i("temasPt2").value |
115 | if(tema == ""){alert("Escolha o segundo tema");aguarde("none");return} | 117 | if(tema == ""){alert("Escolha o segundo tema");aguarde("none");return} |
116 | var cp = new cpaint(); | 118 | var cp = new cpaint(); |
117 | - var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=analiseDistriPt&tema="+tema+"&tipo=cluster&numclasses=&cori=&corf=&sigma=&limitepontos=&tema2="+tema2 | 119 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=analiseDistriPt&tema="+tema+"&tipo=cluster&numclasses=&cori=&corf=&sigma=&limitepontos=&tema2="+tema2+"&extendelimite="+$i("extendelimite").value |
118 | //cp.set_debug(2) | 120 | //cp.set_debug(2) |
119 | cp.set_response_type("JSON"); | 121 | cp.set_response_type("JSON"); |
120 | cp.call(p,"analiseCluster",temp); | 122 | cp.call(p,"analiseCluster",temp); |
@@ -152,7 +154,7 @@ function analiseKernel() | @@ -152,7 +154,7 @@ function analiseKernel() | ||
152 | var tema = $i("temasPt").value | 154 | var tema = $i("temasPt").value |
153 | if(tema == ""){alert("Escolha um tema");aguarde("none");return} | 155 | if(tema == ""){alert("Escolha um tema");aguarde("none");return} |
154 | var cp = new cpaint(); | 156 | var cp = new cpaint(); |
155 | - var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=analiseDistriPt&tema2=&tema="+tema+"&numclasses="+n+"&cori="+ci+"&corf="+cf+"&tipo=kernel&sigma="+$i("sigma").value+"&limitepontos="+$i("limitePontos").value | 157 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=analiseDistriPt&tema2=&tema="+tema+"&numclasses="+n+"&cori="+ci+"&corf="+cf+"&tipo=kernel&sigma="+$i("sigma").value+"&limitepontos="+$i("limitePontos").value+"&extendelimite="+$i("extendelimite").value |
156 | //cp.set_debug(2) | 158 | //cp.set_debug(2) |
157 | cp.set_response_type("JSON"); | 159 | cp.set_response_type("JSON"); |
158 | cp.call(p,"analiseDistriPt",temp); | 160 | cp.call(p,"analiseDistriPt",temp); |
@@ -172,7 +174,7 @@ function analiseDensidade() | @@ -172,7 +174,7 @@ function analiseDensidade() | ||
172 | var tema = $i("temasPt").value | 174 | var tema = $i("temasPt").value |
173 | if(tema == ""){alert("Escolha um tema");aguarde("none");return} | 175 | if(tema == ""){alert("Escolha um tema");aguarde("none");return} |
174 | var cp = new cpaint(); | 176 | var cp = new cpaint(); |
175 | - var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=analiseDistriPt&tema2=&tema="+tema+"&numclasses="+n+"&cori="+ci+"&corf="+cf+"&tipo=densidade&limitepontos="+$i("limitePontos").value | 177 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=analiseDistriPt&tema2=&tema="+tema+"&numclasses="+n+"&cori="+ci+"&corf="+cf+"&tipo=densidade&limitepontos="+$i("limitePontos").value+"&extendelimite="+$i("extendelimite").value |
176 | //cp.set_debug(2) | 178 | //cp.set_debug(2) |
177 | cp.set_response_type("JSON"); | 179 | cp.set_response_type("JSON"); |
178 | cp.call(p,"analiseDistriPt",temp); | 180 | cp.call(p,"analiseDistriPt",temp); |
@@ -191,7 +193,7 @@ function analiseDistancia() | @@ -191,7 +193,7 @@ function analiseDistancia() | ||
191 | var tema = $i("temasPt").value | 193 | var tema = $i("temasPt").value |
192 | if(tema == ""){alert("Escolha um tema");aguarde("none");return} | 194 | if(tema == ""){alert("Escolha um tema");aguarde("none");return} |
193 | var cp = new cpaint(); | 195 | var cp = new cpaint(); |
194 | - var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=analiseDistriPt&tema2=&tema="+tema+"&numclasses="+n+"&cori="+ci+"&corf="+cf+"&tipo=distancia&limitepontos="+$i("limitePontos").value | 196 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=analiseDistriPt&tema2=&tema="+tema+"&numclasses="+n+"&cori="+ci+"&corf="+cf+"&tipo=distancia&limitepontos="+$i("limitePontos").value+"&extendelimite="+$i("extendelimite").value |
195 | //cp.set_debug(2) | 197 | //cp.set_debug(2) |
196 | cp.set_response_type("JSON"); | 198 | cp.set_response_type("JSON"); |
197 | cp.call(p,"analiseDistriPt",temp); | 199 | cp.call(p,"analiseDistriPt",temp); |
@@ -205,7 +207,7 @@ function analiseRelatorio() | @@ -205,7 +207,7 @@ function analiseRelatorio() | ||
205 | var tema = $i("temasPt").value | 207 | var tema = $i("temasPt").value |
206 | if(tema == ""){alert("Escolha um tema");aguarde("none");return} | 208 | if(tema == ""){alert("Escolha um tema");aguarde("none");return} |
207 | var cp = new cpaint(); | 209 | var cp = new cpaint(); |
208 | - var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=analiseDistriPt&tema2=&tema="+tema+"&numclasses="+n+"&cori="+ci+"&corf="+cf+"&tipo=relatorio&limitepontos="+$i("limitePontos").value | 210 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=analiseDistriPt&tema2=&tema="+tema+"&numclasses="+n+"&cori="+ci+"&corf="+cf+"&tipo=relatorio&limitepontos="+$i("limitePontos").value+"&extendelimite="+$i("extendelimite").value |
209 | //cp.set_debug(2) | 211 | //cp.set_debug(2) |
210 | cp.set_response_type("JSON"); | 212 | cp.set_response_type("JSON"); |
211 | cp.call(p,"analiseDistriPt",abreRelatorio); | 213 | cp.call(p,"analiseDistriPt",abreRelatorio); |