Hi hong007,

Thank you very much for the function!!! It's exactly what I'm looking
for.

I was playing around with http://www.freemaptools.com/area-calculator.htm
and I get slightly different calculations for a given area. Your
function produces numbers that are roughly 2-3% larger than
freemaptools' numbers. It's very likely that freemaptools is
incorrect.

Is your function more accurate or is freemaptools' function more
accurate?

Again, thank you very much for your help. I really appreciate it.

-Laxmidi

On Jul 28, 1:28 am, hong007 <[email protected]> wrote:
> It is a calculation of the outline.
> It is not a correct calculation, and there is an error.
> you confirm it, and please use it.....
>
>    private function 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 Maplatlng:LatLng;
>
>             if (nVer>=3){
>                for (var i:int=0; i<nVer; i++){
>                    Maplatlng = polygon.getOuterVertex(i);
>                    x = Maplatlng.lng();
>                    if (i>0){
>                       Maplatlng = polygon.getOuterVertex(i-1);
>                       y0 = Maplatlng.lat();
>                    }
>                    else{
>                       Maplatlng = polygon.getOuterVertex(nVer-1);
>                       y0 = Maplatlng.lat();
>                    };
>                    if (i<(nVer-1)){
>                       Maplatlng = polygon.getOuterVertex(i+1);
>                       y1 = Maplatlng.lat();
>                    }
>                    else{
>                       Maplatlng = polygon.getOuterVertex(0);
>                       y1 = Maplatlng.lat();
>                    };
>                    s = x * (y0-y1);
>                    sz+=s;
>                };
>                //경위도시 1도의 m값을 곱한다(대략 면적 환산)
>                Maplatlng = polygon.getOuterVertex(0);
>                var Maplatlng1:LatLng = new
> com.google.maps.LatLng(Maplatlng.lat()+1, Maplatlng.lng()+1);
>                var TempDISTANCE:Number =
> Maplatlng.distanceFrom(Maplatlng1) / Math.sqrt(2);
>                return Math.abs((sz/2.0) * Math.pow(TempDISTANCE, 2));
>             };
>             return 0.0;
>         }
>
> exc.http://groups.google.com/group/google-maps-api-for-flash/web/example-...http://cafe.naver.com/gisapplication/21
>
> On 7월28일, 오전8시48분, laxmidi1994 <[email protected]> wrote:
>
>
>
> > Hi,
>
> > How do I calculate the area of my irregularly shaped overlay?
>
> > I've got a upon which map that I put an overlay. I'd like to be able
> > to tell the user that overlay A is  X sq. meters.
>
> > Any suggestions?
>
> > Thank you.
>
> > -Laxmidi

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API For Flash" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api-for-flash?hl=en.

Reply via email to