<div> <br>
<font face="Arial, Helvetica, sans-serif">Glad this works for you. Don't hesitate to ask for the more complicated formula if you need greater accuracy — the calculation you have will be off by a percent or two because it assumes a spherical earth.<br>
<br>
Regards,<br>
-- daan Strebe<br>
</font></div>
<div> <br>
</div>
<div> <br>
</div>
-----Original Message-----<br>
From: Shannon Scott <sscott@locationinc.com><br>
To: PROJ.4 and general Projections Discussions <proj@lists.maptools.org><br>
Sent: Thu, 10 Jul 2008 4:02 am<br>
Subject: Re: [Proj] Re: Distance measured in Mercator projection<br>
<br>
<div id="AOLMsgPart_0_279ffca0-8182-49ee-87a7-daf246d8edfa" style="margin: 0px; font-family: Tahoma,Verdana,Arial,Sans-Serif; font-size: 12px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Thank you all for your comments. <br>
1m / cos (phi) was the formula I was looking for. <br>
<br>
We have an application that maps data based on a search radius ( ie 5
miles around Chicago ). <br>
The maps show the search radius. We had been using UTM for the maps, so
I was able to plot the search radius with this piece of code: <br>
<snip> <br>
// convert miles to meters <br>
bufdist = (miles * 1609.344); <br>
<br>
// create circle <br>
for (double i=0;i<360;i+=5) { <br>
deltax = (Math.cos(i) * bufdist); <br>
deltay = (Math.sin(i) * bufdist); <br>
pntx = (centerPntx + deltax); <br>
pnty = (centerPnty + deltay); < br>
// plot point <br>
} <br>
</snip> <br>
<br>
The maps have been converted to work as a google map overlay, so we need
to use the Mercator projection. <br>
I have modified the way the search radius is calculated: <br>
<snip> <br>
// convert miles to meters <br>
bufdist = (miles * (Math.abs(1609.344 * (1/Math.cos(latrad))))); <br>
</snip> <br>
<br>
and everything looks good. <br>
Thanks again. <br>
Shannon <br>
<br>
Ed McNierney wrote: <br>
> Shannon - <br>
> <br>
> First, let me apologize for trying to respond (twice) when I was too
> rushed to do so properly. <br>
> <br>
> Since you say you’re not very familiar with map projections, it might
> be helpful for you to describe a little bit more about what you’re
> trying to do. Daan’s and Chris’s comments are both correct but could
> be confusing to a novice; the scale factor at a single point is the
> same in all directions for a Mercator projection, but strictly
> speaking only at that point. If you have another point in a different
> place, the scale factor at that point will be different from the first
> unless they’re at exactly the same latitude. So if you’re measuring
> the distance between two points at a non-trivial distance apart, a
> 500-mile line will, for example, change length on a Mercator map
> depending on=2
0its angle with the Equator. What I was trying to say in
> my first, poorly-worded reply, is that the set of points that are all
> 500 miles from a center point on a Mercator map will NOT form a circle
> on that map. <br>
> <br>
> If your question really is, “How can I measure the great circle
> distance between two points given their Mercator coordinates” then
> that’s rather tricky. And it will depend on how far apart those two
> points are, and how accurate you need your answer to be. <br>
> <br>
> You will find incredibly talented professional expertise on this list,
> but it’s hard for people to answer the question you didn’t ask. If you
> can describe – in general terms, rather than specific ones – what
> you’re trying to do and what questions you’re trying to answer, that
> will make it easier. If there are constraints on your solution (e.g.
> “I have to use Mercator so please don’t suggest an alternative
> projection that would make the math easier”) let us know as well. Thanks. <br>
> <br>
> - Ed <br>
> <br>
> Ed McNierney <br>
> 205 Indian Hill Road <br>
> Groton, MA 01450 <br>
> <a href="mailto:ed@mcnierney.com">ed@mcnierney.com</a> <br>
> +1 (978) 761-0049 <br>
> ------------------------------------------------------------------------ <br>
> <br>
>=2
0_______________________________________________ <br>
> Proj mailing list <br>
> <a href="mailto:Proj@lists.maptools.org">Proj@lists.maptools.org</a> <br>
> <a href="http://lists.maptools.org/mailman/listinfo/proj" target="_blank">http://lists.maptools.org/mailman/listinfo/proj</a> <br>
<br>
_______________________________________________ <br>
Proj mailing list <br>
<a href="mailto:Proj@lists.maptools.org">Proj@lists.maptools.org</a> <br>
<a href="http://lists.maptools.org/mailman/listinfo/proj" target="_blank">http://lists.maptools.org/mailman/listinfo/proj</a> <br>
</div>
<!-- end of AOLMsgPart_0_279ffca0-8182-49ee-87a7-daf246d8edfa -->
<div id='u8CAB0DA3FA9FA61-4D4-2306' class='aol_ad_footer'><FONT style="color: black; font: normal 10pt ARIAL, SAN-SERIF;"><HR style="MARGIN-TOP: 10px">The Famous, the Infamous, the Lame - in your browser. <A title="http://toolbar.aol.com/tmz/download.html?NCID=aolcmp00050000000014" href="http://toolbar.aol.com/tmz/download.html?NCID=aolcmp00050000000014" target="_blank">Get the TMZ Toolbar Now</A>!</FONT> </div>