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! Josh Livni-4 wrote: > > > 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! >> > _______________________________________________ > Users mailing list > [email protected] > http://openlayers.org/mailman/listinfo/users > > -- View this message in context: http://www.nabble.com/Square-miles-from-Square-degrees--tp14357316p14373973.html Sent from the OpenLayers Users mailing list archive at Nabble.com. _______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
