<div>I have had a few issues with the Mercator functions.&nbsp; I had to use parseFloat on the values I passed into it.</div>
<div>&nbsp;</div>
<div>Linda Rawson<br><br></div>
<div class="gmail_quote">On Dec 17, 2007 11:31 AM, cmose &lt;<a href="mailto:cjmose@gmail.com">cjmose@gmail.com</a>&gt; 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&#39;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>&gt;<br>&gt;<br>&gt; I&#39;ve not played with the getArea function, but since area calculations<br>&gt; in the base coordinate system (geographic/dec. degrees, or however it&#39;s
<br>&gt; best described) make no sense, I think the only way you can do this with<br>&gt; the current codebase would be to use the forwardMercator equations found<br>&gt; in OpenLayers.Layer.SphericalMercator.<br>&gt;<br>
&gt; After reprojecting your geometry to spherical-mercator, an area<br>&gt; calculation would make more sense, and be in meters (though still be off<br>&gt; by I&#39;m guessing a few percent, depending on the size of your geometry
<br>&gt; and it&#39;s location).<br>&gt;<br>&gt; I think the trunk and next version of OL may include additional methods<br>&gt; of getting to use SphericalMercator, and perhaps even other projections,<br>&gt; but I&#39;m not too clued in on the details.
<br>&gt;<br>&gt; -Josh<br>&gt;<br>&gt;<br>&gt; cmose wrote:<br>&gt;&gt; Hopefully I&#39;m not making a fool of myself but my assumption is that the<br>&gt;&gt; getArea function on Geometry/subclasses returns square degrees (that
<br>&gt;&gt; seems<br>&gt;&gt; to be the case to my eye). How exactly would I go about calculating<br>&gt;&gt; square<br>&gt;&gt; miles from this or is that even possible? If not, how do I go about<br>&gt;&gt; calculating the square miles contained in a shape drawn on the map?
<br>&gt;&gt;<br>&gt;&gt; Thanks!<br>&gt;&gt;<br>&gt; _______________________________________________<br>&gt; Users mailing list<br>&gt; <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>&gt; <a href="http://openlayers.org/mailman/listinfo/users" target="_blank">
http://openlayers.org/mailman/listinfo/users</a><br>&gt;<br>&gt;<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>