[OpenLayers-Users] Square miles from Square degrees?

mpriour mpriour at kestrelcomputer.com
Mon Dec 17 17:47:00 EST 2007


It just occured to me as re-read that you are projecting to Spherical
Mercator,
The spherical mercator projection doesn't preserve area. It makes the
intersection of all lat/lon lines into 90 degree intersections. While this
is not terrible at the equator, the higher latitude you get the worse than
warping effect is going to be.
You could do some calculations & figure out the miles per unit degree
latitude & longitude (they will be different) in your area of interest.
You can also look up that information, though I can't remember where. I used
a look up for numerous conversions of square degrees to acres in central
Texas and it was only off by 1-2%, which was good enough for our
calculations.


cmose wrote:
> 
> Hmmn well the formula seems to match what I turned up online for
> calculating the area of an irregular polygon...
> 
> The units thing makes sense and since I'm using a degree based map a
> result in square degrees also makes sense. What doesn't make sense to me
> though is that I manually converted the points in my Polygon to Spherical
> Mercator values which should be based on meters so I would expect the
> getArea result to be somewhat meaningful as a meters/km but it's still way
> way too high...
> 
> Thanks a bunch for the input!
> 
> 
> mpriour wrote:
>> 
>> 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--tp14357316p14375799.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list