<div>I have had a few issues with the Mercator functions. I had to use parseFloat on the values I passed into it.</div>
<div> </div>
<div>Linda Rawson<br><br></div>
<div class="gmail_quote">On Dec 17, 2007 11:31 AM, cmose <<a href="mailto:cjmose@gmail.com">cjmose@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Hmnn after giving this a go I seem to be getting wildly inaccurate results,<br>at least I believe I am. For instance, I used a polygon over an area I know
<br>to be roughly 400k square kilometers. Using the getArea on the polygon<br>(after converting points to sphericalmercator) I'm getting a result of<br>748,912,714 sq. km...<br><br>Anyone have any pointers or ideas of where I might be going wrong here?
<br>Thanks!<br>
<div>
<div></div>
<div class="Wj3C7c"><br>Josh Livni-4 wrote:<br>><br>><br>> I've not played with the getArea function, but since area calculations<br>> in the base coordinate system (geographic/dec. degrees, or however it's
<br>> best described) make no sense, I think the only way you can do this with<br>> the current codebase would be to use the forwardMercator equations found<br>> in OpenLayers.Layer.SphericalMercator.<br>><br>
> After reprojecting your geometry to spherical-mercator, an area<br>> calculation would make more sense, and be in meters (though still be off<br>> by I'm guessing a few percent, depending on the size of your geometry
<br>> and it's location).<br>><br>> I think the trunk and next version of OL may include additional methods<br>> of getting to use SphericalMercator, and perhaps even other projections,<br>> but I'm not too clued in on the details.
<br>><br>> -Josh<br>><br>><br>> cmose wrote:<br>>> Hopefully I'm not making a fool of myself but my assumption is that the<br>>> getArea function on Geometry/subclasses returns square degrees (that
<br>>> seems<br>>> to be the case to my eye). How exactly would I go about calculating<br>>> square<br>>> miles from this or is that even possible? If not, how do I go about<br>>> calculating the square miles contained in a shape drawn on the map?
<br>>><br>>> Thanks!<br>>><br>> _______________________________________________<br>> Users mailing list<br>> <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>> <a href="http://openlayers.org/mailman/listinfo/users" target="_blank">
http://openlayers.org/mailman/listinfo/users</a><br>><br>><br><br></div></div><font color="#888888">--<br>View this message in context: <a href="http://www.nabble.com/Square-miles-from-Square-degrees--tp14357316p14373973.html" target="_blank">
http://www.nabble.com/Square-miles-from-Square-degrees--tp14357316p14373973.html</a><br></font>
<div class="Ih2E3d">Sent from the OpenLayers Users mailing list archive at <a href="http://nabble.com/" target="_blank">Nabble.com</a>.<br><br>_______________________________________________<br></div>
<div>
<div></div>
<div class="Wj3C7c">Users mailing list<br><a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br><a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users
</a><br></div></div></blockquote></div><br>