[OpenLayers-Users] Square miles from Square degrees?

mpriour mpriour at kestrelcomputer.com
Mon Dec 17 14:41:51 EST 2007



Looking at the actual source code, I don't think this method works properly
on irregular polygons. It also makes the calculations in map units. So if
you are using feet you get square feet, decimal degrees you get square
degrees, etc..

To perform the getArea calculation it does rectangular area measurements
between the points of the line segments making up the polygon. This works in
a highly predictive manner with any regular polygon, rectangle, or
trapezoid. However, it is very unpredictable on free-form geometries.


cmose wrote:
> 
> Hmnn after giving this a go I seem to be getting wildly inaccurate
> results, at least I believe I am. For instance, I used a polygon over an
> area I know to be roughly 400k square kilometers. Using the getArea on the
> polygon (after converting points to sphericalmercator) I'm getting a
> result of 748,912,714 sq. km...
> 
> Anyone have any pointers or ideas of where I might be going wrong here?
> Thanks!
> 

-- 
View this message in context: http://www.nabble.com/Square-miles-from-Square-degrees--tp14357316p14374010.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list