calculate polygon area
Mateusz Loskot
mateusz at LOSKOT.NET
Tue Jul 18 13:30:51 PDT 2006
Ed McNierney wrote:
> Mateusz -
>
> That is some very suspicious-looking code. It says:
>
> "Returns the area of a spherical polygon in spherical degrees"
The function SphericalPolyArea does this job correctly.
> and then displays the area in "Square Miles" by using these
> constants:
>
> double SqMi= 273218.4, /* Square mi per spherical degree. */ SqKm=
> 707632.4; /* Square km per spherical degree. */
>
> and multiplies the area in "spherical degrees" by 273218.4!!!
This part is another story and I agree in this matter with you.
> I cannot figure out what the constant 273218.4 is supposed to
> represent. Over there in Warsaw one degree of latitude is 69.14
> statute miles, and one degree of longitude is 42.53 statute miles, so
> there are 2940.52 square miles in that "square degree". At my house
> there are 3519.33 square miles in a "square degree", and down in
> Quito there are 4752.54 square miles in that same "square degree".
>
> Even overlooking the minor error introduced with a sphere rather than
> an ellipsoid, I am skeptical that this code will actually do anything
> useful.
Julien did said nothing about projection and that he want's to get
usable values for particular area.
I understood he is looking for some simple/general solution
And calculation of spherical polygon area is such general solution,
but I agree it does no provide good quality results regarding our
Mother Earth.
BTW, this procedure comes to book for game programmers, so
it assume the Earth is spherical.
Julien, if you want to get correct results I'd suggest you
to use equal-area projection for the are of your interest.
Best regards
--
Mateusz Loskot
http://mateusz.loskot.net
More information about the MapServer-users
mailing list