[OpenLayers-Users] Square miles from Square degrees?

Josh Livni mailing_lists at umbrellaconsulting.com
Sun Dec 16 13:53:24 EST 2007


I've not played with the getArea function, but since area calculations 
in the base coordinate system (geographic/dec. degrees, or however it's 
best described) make no sense, I think the only way you can do this with 
the current codebase would be to use the forwardMercator equations found 
in OpenLayers.Layer.SphericalMercator.

After reprojecting your geometry to spherical-mercator, an area 
calculation would make more sense, and be in meters (though still be off 
by I'm guessing a few percent, depending on the size of your geometry 
and it's location).

I think the trunk and next version of OL may include additional methods 
of getting to use SphericalMercator, and perhaps even other projections, 
but I'm not too clued in on the details.

-Josh


cmose wrote:
> Hopefully I'm not making a fool of myself but my assumption is that the
> getArea function on Geometry/subclasses returns square degrees (that seems
> to be the case to my eye). How exactly would I go about calculating square
> miles from this or is that even possible? If not, how do I go about
> calculating the square miles contained in a shape drawn on the map?
>
> Thanks!
>   



More information about the Users mailing list