Commit 749cfdae1b092e71aaa73f427474de85704e345b

Authored by Edmar Moretti
1 parent 138c467e

Correção no cálculo de áreas da ferramenta area

ferramentas/area/index.js
@@ -196,7 +196,8 @@ i3GEOF.area = @@ -196,7 +196,8 @@ i3GEOF.area =
196 coords = geom.getLinearRing(0).getCoordinates(), 196 coords = geom.getLinearRing(0).getCoordinates(),
197 n = coords.length, 197 n = coords.length,
198 m = i3GEOF.area.openlayers; 198 m = i3GEOF.area.openlayers;
199 - ponto = new ol.geom.Point(coords[n-1]); 199 + ponto = new ol.geom.Point(coords[n-2]);
  200 + //console.info(coords)
200 if(m.numpontos === n-1){ 201 if(m.numpontos === n-1){
201 //clicou 202 //clicou
202 m.numpontos = n; 203 m.numpontos = n;
@@ -212,6 +213,7 @@ i3GEOF.area = @@ -212,6 +213,7 @@ i3GEOF.area =
212 modify : function(point,geom) { 213 modify : function(point,geom) {
213 var temp,sourceProj,coordinates,wgs84Sphere, per, area, n, x1, y1, x2, y2, trecho, direcao, 214 var temp,sourceProj,coordinates,wgs84Sphere, per, area, n, x1, y1, x2, y2, trecho, direcao,
214 coord = point.getCoordinates(); 215 coord = point.getCoordinates();
  216 +
215 n = i3GEOF.area.pontos.ypt.length; 217 n = i3GEOF.area.pontos.ypt.length;
216 if (n > 1) { 218 if (n > 1) {
217 x1 = i3GEOF.area.pontos.xpt[n - 1]; 219 x1 = i3GEOF.area.pontos.xpt[n - 1];
@@ -243,7 +245,9 @@ i3GEOF.area = @@ -243,7 +245,9 @@ i3GEOF.area =
243 x1 = temp[0]; 245 x1 = temp[0];
244 y1 = temp[1]; 246 y1 = temp[1];
245 } 247 }
  248 +
246 per += i3GEO.calculo.distancia(x1, y1, x2, y2); 249 per += i3GEO.calculo.distancia(x1, y1, x2, y2);
  250 +
247 //getGeodesicArea 251 //getGeodesicArea
248 sourceProj = i3geoOL.getView().getProjection(); 252 sourceProj = i3geoOL.getView().getProjection();
249 geom = (geom.clone().transform(sourceProj, 'EPSG:4326')); 253 geom = (geom.clone().transform(sourceProj, 'EPSG:4326'));
ferramentas/distancia/index.js
@@ -248,6 +248,7 @@ i3GEOF.distancia = @@ -248,6 +248,7 @@ i3GEOF.distancia =
248 x2 = temp[2]; 248 x2 = temp[2];
249 y2 = temp[3]; 249 y2 = temp[3];
250 } 250 }
  251 + //console.info(x1+" "+y1+" "+x2+" "+y2)
251 trecho = i3GEO.calculo.distancia(x1, y1, x2, y2); 252 trecho = i3GEO.calculo.distancia(x1, y1, x2, y2);
252 parcial = i3GEOF.distancia.openlayers.somaDist(); 253 parcial = i3GEOF.distancia.openlayers.somaDist();
253 direcao = i3GEO.calculo.direcao(x1, y1, x2, y2); 254 direcao = i3GEO.calculo.direcao(x1, y1, x2, y2);