Commit 3b5d04204974aa693e3e094deb0869a963a9986f

Authored by Edmar Moretti
1 parent 35514fbc

incluida rotina de projeção de pontos na análise de distribuição

Showing 1 changed file with 8 additions and 0 deletions   Show diff stats
classesphp/classe_analise.php
@@ -130,6 +130,8 @@ Include: @@ -130,6 +130,8 @@ Include:
130 */ 130 */
131 function analiseDistriPt($locaplic,$dir_tmp,$R_path,$numclasses,$tipo,$cori,$corf,$tmpurl,$sigma="",$limitepontos="TRUE") 131 function analiseDistriPt($locaplic,$dir_tmp,$R_path,$numclasses,$tipo,$cori,$corf,$tmpurl,$sigma="",$limitepontos="TRUE")
132 { 132 {
  133 + $prjMapa = $this->mapa->getProjection();
  134 + $prjTema = $this->layer->getProjection();
133 $layerPt = $this->layer; 135 $layerPt = $this->layer;
134 $layerPt->set("tolerance",0); 136 $layerPt->set("tolerance",0);
135 $layerPt->set("template","none.htm"); 137 $layerPt->set("template","none.htm");
@@ -146,6 +148,8 @@ Include: @@ -146,6 +148,8 @@ Include:
146 $pontos = array(); 148 $pontos = array();
147 //pega um shape especifico 149 //pega um shape especifico
148 $layerPt->open(); 150 $layerPt->open();
  151 + $projInObj = ms_newprojectionobj($prjTema);
  152 + $projOutObj = ms_newprojectionobj($prjMapa);
149 for ($i = 0; $i < $res_count; $i++) 153 for ($i = 0; $i < $res_count; $i++)
150 { 154 {
151 $result = $layerPt->getResult($i); 155 $result = $layerPt->getResult($i);
@@ -153,6 +157,10 @@ Include: @@ -153,6 +157,10 @@ Include:
153 $shape = $layerPt->getshape(-1, $shp_index); 157 $shape = $layerPt->getshape(-1, $shp_index);
154 $lineo = $shape->line(0); 158 $lineo = $shape->line(0);
155 $pt = $lineo->point(0); 159 $pt = $lineo->point(0);
  160 + if (($prjTema != "") && ($prjMapa != $prjTema))
  161 + {
  162 + $pt->project($projInObj, $projOutObj);
  163 + }
156 $pontos[] = $pt->x." ".$pt->y."\n"; 164 $pontos[] = $pt->x." ".$pt->y."\n";
157 $pontosx[] = $pt->x; 165 $pontosx[] = $pt->x;
158 $pontosy[] = $pt->y; 166 $pontosy[] = $pt->y;