jueves, 11 de agosto de 2011

VOLUMENS AND AREAS IN SECONDS WITH GOOGLE MAPS FOR CIVIL ENGINNERING


I developed a small application with Flex and AC3 to determine the volume of an excavation and plant area by usingGoogle Maps.


In seconds, you move where you want, select the points on the ground you want, enter the average depth of excavation and the program determines the area, the volume of the excavation, and the average ground elevation (using Google API & events Elevations).


The program takes the points of the polygon on the ground, determines and interpolates a series of intermediate points, interior and perimeter of the area and get an average groundelevation at that point.


Ideal for in seconds information that might cost us some time if you do not have the tachometer or a program of earthworks.


Web page example;


http://www.mexcel.es/googlemaps/area/


Youtube example;


http://www.youtube.com/watch?v=rTsW7Oc-CuQ/


Deputy routine conversion of longitude and latitude at thereference geoid Google maps. There are easier and fasterroutines. The attachment that I have translated the AC3,belonging to a Brazilian geographer:




private function LongLat_to_UTM(location0:LatLng):Array {
var longitud:Number;
var latitud:Number;
var Uen_radianes:Number;
var Ven_radianes:Number;
var Calculo_huso:Number;
var Meridiano_Huso:Number;
var Delta_lambda:Number;
var DA:Number;
var Xi:Number;
var Eta:Number;
var Ni:Number;
var Dz:Number;
var DA1:Number;
var DA2:Number;
var DJ2:Number;
var DJ4:Number;
var DJ6:Number;
var DAlfa:Number;
var DBeta:Number;
var DGamma:Number;
var DBfi:Number;
var D_UTM_x:Number;
var D_UTM_y:Number;


var Dw:Number;
var Dx:Number;
var Dy:Number;
var Dzz:Number;
 
Dw = 8.18191908426203E-02;
Dx = 8.20944379496945E-02;
Dy = 6.73949674227624E-03;
Dzz = 6399593.62575849;


longitud = location0.lng();
latitud = location0.lat();

Calculo_huso = Math.floor((longitud / 6) + 31);
Uen_radianes = longitud * Math.PI / 180;
Ven_radianes = latitud * Math.PI / 180;
Meridiano_Huso = 6 * Calculo_huso - 183;
Delta_lambda = Uen_radianes - ((Meridiano_Huso * Math.PI) / 180);
DA = Math.cos(Ven_radianes) * Math.sin(Delta_lambda);
Xi = (1 / 2) * Math.log((1 + DA) / (1 - DA));
Eta = Math.atan((Math.tan(Ven_radianes)) / Math.cos(Delta_lambda)) - Ven_radianes;
Ni =  0.9996 * (Dzz / Math.sqrt((1 + Dy * (Math.cos(Ven_radianes )) * (Math.cos(Ven_radianes )))));
Dz = (Dy / 2) * Xi * Xi * (Math.cos(Ven_radianes)) * (Math.cos(Ven_radianes));
DA1 = Math.sin(2 * Ven_radianes);
DA2 = DA1 * (Math.cos(Ven_radianes)) * (Math.cos(Ven_radianes));
DJ2 = Ven_radianes + (DA1 / 2);
DJ4 = ((3 * DJ2) + DA2) / 4;
DJ6 = (5 * DJ4 + DA2 * (Math.cos(Ven_radianes)) * (Math.cos(Ven_radianes))) / 3;
DAlfa = (3 / 4) * Dy;
DBeta = (5 / 3) * DAlfa * DAlfa;
DGamma = (35 / 27) * DAlfa * DAlfa * DAlfa;
DBfi = 0.9996 * Dzz * (Ven_radianes - (DAlfa * DJ2) + (DBeta * DJ4) - (DGamma * DJ6));

D_UTM_x = Xi * Ni * (1 + Dz / 3) + 500000;
     
if (latitud <= 0) {
D_UTM_y = Eta * Ni * (1 + Dz) + DBfi + 10000000;
} else {
D_UTM_y = Eta * Ni * (1 + Dz) + DBfi;
}

return [D_UTM_x, D_UTM_y];
}


I love AC3..... please, see how a function return an Array.


Saludos...........