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 | 129 | |
130 | 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 | 133 | Include: |
133 | 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 | 138 | set_time_limit(180); |
138 | 139 | // |
139 | 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 | 143 | $nomearq = $dados1["prefixoarquivo"]; |
143 | 144 | $dimx = $dados1["dimx"]; |
144 | 145 | $dimy = $dados1["dimy"]; |
145 | 146 | if (isset($tema2) && $tema2 != "") |
146 | 147 | { |
147 | - $dados2 = $this->gravaCoordenadasPt($tema2,$limitepontos); | |
148 | + $dados2 = $this->gravaCoordenadasPt($tema2,$limitepontos,$extendelimite); | |
148 | 149 | $nomearq2 = $dados2["prefixoarquivo"]; |
149 | 150 | $dimx2 = $dados2["dimx"]; |
150 | 151 | $dimy2 = $dados2["dimy"]; |
... | ... | @@ -2281,11 +2282,13 @@ tema - nome do tema com os pontos |
2281 | 2282 | |
2282 | 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 | 2287 | return: |
2285 | 2288 | |
2286 | 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 | 2293 | $prjMapa = $this->mapa->getProjection(); |
2291 | 2294 | $layerPt = $this->mapa->getlayerbyname($tema); |
... | ... | @@ -2353,6 +2356,17 @@ function gravaCoordenadasPt($tema,$limitepontos="TRUE") |
2353 | 2356 | $yi = $ext->miny; |
2354 | 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 | 2370 | $dimx = "c(".$xi.",".$xf.")"; |
2357 | 2371 | $dimy = "c(".$yi.",".$yf.")"; |
2358 | 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 | 1277 | if(!isset($limitepontos)) |
1278 | 1278 | {$limitepontos = "";} |
1279 | 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 | 1281 | $m->salva(); |
1282 | 1282 | break; |
1283 | 1283 | /* | ... | ... |
ferramentas/pontosdistri/index.js
... | ... | @@ -38,7 +38,9 @@ comboTemasPt("temasPt",function(retorno) |
38 | 38 | var ins = "<div style=top:0px;left:0px;text-align:left; >Escolha o tema de pontos que será utilizado:</div><br><br>" |
39 | 39 | ins += retorno.dados |
40 | 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 | 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 | 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 | 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 | 116 | var tema2 = $i("temasPt2").value |
115 | 117 | if(tema == ""){alert("Escolha o segundo tema");aguarde("none");return} |
116 | 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 | 120 | //cp.set_debug(2) |
119 | 121 | cp.set_response_type("JSON"); |
120 | 122 | cp.call(p,"analiseCluster",temp); |
... | ... | @@ -152,7 +154,7 @@ function analiseKernel() |
152 | 154 | var tema = $i("temasPt").value |
153 | 155 | if(tema == ""){alert("Escolha um tema");aguarde("none");return} |
154 | 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 | 158 | //cp.set_debug(2) |
157 | 159 | cp.set_response_type("JSON"); |
158 | 160 | cp.call(p,"analiseDistriPt",temp); |
... | ... | @@ -172,7 +174,7 @@ function analiseDensidade() |
172 | 174 | var tema = $i("temasPt").value |
173 | 175 | if(tema == ""){alert("Escolha um tema");aguarde("none");return} |
174 | 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 | 178 | //cp.set_debug(2) |
177 | 179 | cp.set_response_type("JSON"); |
178 | 180 | cp.call(p,"analiseDistriPt",temp); |
... | ... | @@ -191,7 +193,7 @@ function analiseDistancia() |
191 | 193 | var tema = $i("temasPt").value |
192 | 194 | if(tema == ""){alert("Escolha um tema");aguarde("none");return} |
193 | 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 | 197 | //cp.set_debug(2) |
196 | 198 | cp.set_response_type("JSON"); |
197 | 199 | cp.call(p,"analiseDistriPt",temp); |
... | ... | @@ -205,7 +207,7 @@ function analiseRelatorio() |
205 | 207 | var tema = $i("temasPt").value |
206 | 208 | if(tema == ""){alert("Escolha um tema");aguarde("none");return} |
207 | 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 | 211 | //cp.set_debug(2) |
210 | 212 | cp.set_response_type("JSON"); |
211 | 213 | cp.call(p,"analiseDistriPt",abreRelatorio); | ... | ... |