flex - Calculating the Area of a Polygon When the Polygon's Points are Lat Longs: Which Function is More Accurate? -
I am trying to find a way to calculate the area of polygon using a long long coordinate in a Flex 3 site. I am On Google Maps for the Flash group, Hong Kong 7 was great for posting the following tasks:
PrivatePhase GetPolygonArea (polygon: polygon): number {var nVer: int = polygon.getOuterVertexCount ( ); Var sz: number = 0; Var s: number = 0; Var x: number = 0; Var y0: number = 0; Var y1: number = 0; Var maple color: wave long; If (nVer> = 3) {for (var i: int = 0; i gt; 0) {maplatlng = polygon.getOuterVertex (i-1); Y0 = Maplatlng.lat (); } And {moplantang = polygon.getOuterWorTex (naveer-1); Y0 = Maplatlng.lat (); }; If (I and LT; (nVier-1)) {matlatang = polygon.Tetu.itretex (I + 1); Y1 = Maplatlng.lat (); } Else {Maplatlng = polygon.getOuterVertex (0); Y1 = Maplatlng.lat (); }; S = x * (y0-y1); SZ + = s; }; // 경위도 시 1 도자 곱다 곱한다 (대략 면적 환산) Maplatlng = polygon.getOuterVertex (0); Var Iplatang 1: Latlang = New com.google.maps.LatLng (Maplatlng.lat () + 1, Maplatlng.lng () + 1); Var tempDISTANCE: number = Maplatlng.distanceFrom (Maplatlng1) / Math.sqrt (2); Return Mathematics. BAS ((sz / 2.0) * Math.pp (TapeDestence, 2)); }; Return 0.0; }
I was also playing around with the area calculator.
These functions present slightly different results. I am trying to figure out which is more accurate, it seems that the function of the Hong 007 produces results, which is slightly more than the function of freemtotals. However, I do not know who is more accurate any advice?
I added some strings in this algorithm. I got this number for experimental Google Maps:
area = (area * 0.2187);
And it works for me for maximum (scale = 5 meters) and minimum (500 km) zoom levels.
Comments
Post a Comment