<html><body name="Mail Message Editor"><div><br></div><div>Shannon,</div><div><br></div><div>The scale factor in any direction at a given point on the ellipsoidal equatorial Mercator is:</div><div><br></div><div>h = √(1 - e^2 x sin^2 (phi)) / cos (phi)</div><div><br></div><div>where √ is the square root of the expression; e is the eccentricity of the ellipsoid (0.0 for WGS84); ^2 means the square of the expression; and other symbols and semantics as given before.<br></div><div><br></div><div>Therefore you would multiply 1m x h to find the map distance of one meter at full scale. As you can see, this is the same as the original expression but just multiplied by the factor that adjusts for the eccentricity.</div><div><br></div><div>Don't hesitate to ask for clarification if you need it. Good luck.</div><div><br></div><div>Regards,</div><div>-- daan Strebe</div><div><br></div><br>On Jul 16, 2008, at 3:53:25 AM, "Shannon Scott" <sscott@locationinc.com> wrote:<br><blockquote style="padding-left: 5px; margin-left: 5px; border-left-width: 2px; border-left-style: solid; border-left-color: blue; color: blue; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="width: 100%; "><div id="felix-mail-header-block" style="color: black; background-color: white; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: silver; padding-bottom: 1em; margin-bottom: 1em; width: 100%; "><table border="0" cellpadding="1" cellspacing="1" width="100%"><tbody><tr><td width="70px" style="font-family: 'Lucida Grande'; font-size: 8pt; color: gray; text-align: right; vertical-align: top; font-weight: bold; "><span>From:</span></td><td style="font-family: 'Lucida Grande'; font-size: 8pt; color: black; text-align: left; vertical-align: top; padding-left: 5px; "><span title=""Shannon Scott" <sscott@locationinc.com>">"Shannon Scott" <sscott@locationinc.com></span></td></tr><tr><td width="70px" style="font-family: 'Lucida Grande'; font-size: 8pt; color: gray; text-align: right; vertical-align: top; font-weight: bold; "><span>Subject:</span></td><td style="font-family: 'Lucida Grande'; font-size: 8pt; color: black; text-align: left; vertical-align: top; padding-left: 5px; "><span style="font-weight: bold; ">[Proj] Re: Distance measured in Mercator projection</span></td></tr><tr><td width="70px" style="font-family: 'Lucida Grande'; font-size: 8pt; color: gray; text-align: right; vertical-align: top; font-weight: bold; "><span>Date:</span></td><td style="font-family: 'Lucida Grande'; font-size: 8pt; color: black; text-align: left; vertical-align: top; padding-left: 5px; "><span>July 16, 2008 3:53:25 AM PDT</span></td></tr><tr><td width="70px" style="font-family: 'Lucida Grande'; font-size: 8pt; color: gray; text-align: right; vertical-align: top; font-weight: bold; "><span>To:</span></td><td style="font-family: 'Lucida Grande'; font-size: 8pt; color: black; text-align: left; vertical-align: top; padding-left: 5px; "><span title=""PROJ.4 and general Projections Discussions" <proj@lists.maptools.org>">"PROJ.4 and general Projections Discussions" <proj@lists.maptools.org></span></td></tr></tbody></table></div><div id="felix-mail-content-block" style="color: black; background-color: white; width: 100%; "><div style="font-family: monospace; color: black; background-color: white; font-size: 8pt; ">Daan,<br>What I have now seems to be working, but I would like to see the more<span class="Apple-converted-space"> </span><br>complicated formula.<span class="Apple-converted-space"> </span><br>I will use it if I can get it into the code I have.<br>Thank you.<br>Shannon<br><br>strebe@aol.com wrote:<br>><br>> Glad this works for you. Don't hesitate to ask for the more<span class="Apple-converted-space"> </span><br>> complicated formula if you need greater accuracy — the calculation you<span class="Apple-converted-space"> </span><br>> have will be off by a percent or two because it assumes a spherical earth.<br>><br>> Regards,<br>> -- daan Strebe<br>><br>><br>> -----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>> Thank you all for your comments.<span class="Apple-converted-space"> </span><br>> 1m / cos (phi) was the formula I was looking for.<span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> We have an application that maps data based on a search radius ( ie 5<span class="Apple-converted-space"> </span><br>> miles around Chicago ).<span class="Apple-converted-space"> </span><br>> The maps show the search radius. We had been using UTM for the maps,<span class="Apple-converted-space"> </span><br>> so I was able to plot the search radius with this piece of code:<span class="Apple-converted-space"> </span><br>> <snip><span class="Apple-converted-space"> </span><br>> // convert miles to meters<span class="Apple-converted-space"> </span><br>> bufdist = (miles * 1609.344);<span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> // create circle<span class="Apple-converted-space"> </span><br>> for (double i=0;i<360;i+=5) {<span class="Apple-converted-space"> </span><br>> deltax = (Math.cos(i) * bufdist);<span class="Apple-converted-space"> </span><br>> deltay = (Math.sin(i) * bufdist);<span class="Apple-converted-space"> </span><br>> pntx = (centerPntx + deltax);<span class="Apple-converted-space"> </span><br>> pnty = (centerPnty + deltay); < br> // plot point<span class="Apple-converted-space"> </span><br>> }<span class="Apple-converted-space"> </span><br>> </snip><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> The maps have been converted to work as a google map overlay, so we<span class="Apple-converted-space"> </span><br>> need to use the Mercator projection.<span class="Apple-converted-space"> </span><br>> I have modified the way the search radius is calculated:<span class="Apple-converted-space"> </span><br>> <snip><span class="Apple-converted-space"> </span><br>> // convert miles to meters<span class="Apple-converted-space"> </span><br>> bufdist = (miles * (Math.abs(1609.344 * (1/Math.cos(latrad)))));<span class="Apple-converted-space"> </span><br>> </snip><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> and everything looks good.<span class="Apple-converted-space"> </span><br>> Thanks again.<span class="Apple-converted-space"> </span><br>> Shannon<span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> Ed McNierney wrote:<span class="Apple-converted-space"> </span><br>> > Shannon -<span class="Apple-converted-space"> </span><br>> ><span class="Apple-converted-space"> </span><br>> > First, let me apologize for trying to respond (twice) when I was too<span class="Apple-converted-space"> </span><br>> > rushed to do so properly.<span class="Apple-converted-space"> </span><br>> ><span class="Apple-converted-space"> </span><br>> > Since you say you’re not very familiar with map projections, it<span class="Apple-converted-space"> </span><br>> might > be helpful for you to describe a little bit more about what<span class="Apple-converted-space"> </span><br>> you’re > trying to do. Daan’s and Chris’s comments are both correct<span class="Apple-converted-space"> </span><br>> but could > be confusing to a novice; the scale factor at a single<span class="Apple-converted-space"> </span><br>> point is the > same in all directions for a Mercator projection, but<span class="Apple-converted-space"> </span><br>> strictly > speaking only at that point. If you have another point in a<span class="Apple-converted-space"> </span><br>> different > place, the scale factor at that point will be different<span class="Apple-converted-space"> </span><br>> from the first > unless they’re at exactly the same latitude. So if<span class="Apple-converted-space"> </span><br>> you’re measuring > the distance between two points at a non-trivial<span class="Apple-converted-space"> </span><br>> distance apart, a > 500-mile line will, for example, change length on<span class="Apple-converted-space"> </span><br>> a Mercator map > depending on=2 0its angle with the Equator. What I<span class="Apple-converted-space"> </span><br>> was trying to say in > my first, poorly-worded reply, is that the set<span class="Apple-converted-space"> </span><br>> of points that are all > 500 miles from a center point on a Mercator<span class="Apple-converted-space"> </span><br>> map will NOT form a circle > on that map.<span class="Apple-converted-space"> </span><br>> ><span class="Apple-converted-space"> </span><br>> > If your question really is, “How can I measure the great circle ><span class="Apple-converted-space"> </span><br>> distance between two points given their Mercator coordinates” then ><span class="Apple-converted-space"> </span><br>> that’s rather tricky. And it will depend on how far apart those two ><span class="Apple-converted-space"> </span><br>> points are, and how accurate you need your answer to be.<span class="Apple-converted-space"> </span><br>> ><span class="Apple-converted-space"> </span><br>> > You will find incredibly talented professional expertise on this<span class="Apple-converted-space"> </span><br>> list, > but it’s hard for people to answer the question you didn’t<span class="Apple-converted-space"> </span><br>> ask. If you > can describe – in general terms, rather than specific<span class="Apple-converted-space"> </span><br>> ones – what > you’re trying to do and what questions you’re trying to<span class="Apple-converted-space"> </span><br>> answer, that > will make it easier. If there are constraints on your<span class="Apple-converted-space"> </span><br>> solution (e.g. > “I have to use Mercator so please don’t suggest an<span class="Apple-converted-space"> </span><br>> alternative > projection that would make the math easier”) let us know<span class="Apple-converted-space"> </span><br>> as well. Thanks.<span class="Apple-converted-space"> </span><br>> ><span class="Apple-converted-space"> </span><br>> > - Ed<span class="Apple-converted-space"> </span><br>> ><span class="Apple-converted-space"> </span><br>> > Ed McNierney<span class="Apple-converted-space"> </span><br>> > 205 Indian Hill Road<span class="Apple-converted-space"> </span><br>> > Groton, MA 01450<span class="Apple-converted-space"> </span><br>> > ed@mcnierney.com <mailto:ed@mcnierney.com><span class="Apple-converted-space"> </span><br>> > +1 (978) 761-0049<span class="Apple-converted-space"> </span><br>> ><span class="Apple-converted-space"> </span><br>> ------------------------------------------------------------------------<span class="Apple-converted-space"> </span><br>> ><span class="Apple-converted-space"> </span><br>> >=2 0_______________________________________________<span class="Apple-converted-space"> </span><br>> > Proj mailing list<span class="Apple-converted-space"> </span><br>> > Proj@lists.maptools.org <mailto:Proj@lists.maptools.org><span class="Apple-converted-space"> </span><br>> > http://lists.maptools.org/mailman/listinfo/proj<span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> _______________________________________________<span class="Apple-converted-space"> </span><br>> Proj mailing list<span class="Apple-converted-space"> </span><br>> Proj@lists.maptools.org <mailto:Proj@lists.maptools.org><span class="Apple-converted-space"> </span><br>> http://lists.maptools.org/mailman/listinfo/proj<span class="Apple-converted-space"> </span><br>> ------------------------------------------------------------------------<br>> The Famous, the Infamous, the Lame - in your browser. Get the TMZ<span class="Apple-converted-space"> </span><br>> Toolbar Now<span class="Apple-converted-space"> </span><br>> <http://toolbar.aol.com/tmz/download.html?NCID=aolcmp00050000000014>!<br>> ------------------------------------------------------------------------<br>><br>> _______________________________________________<br>> Proj mailing list<br>> Proj@lists.maptools.org<br>> http://lists.maptools.org/mailman/listinfo/proj<br><br>_______________________________________________<br>Proj mailing list<br>Proj@lists.maptools.org<br>http://lists.maptools.org/mailman/listinfo/proj<br><br></div></div></div></span></blockquote><br><div><br></div><div class="aol_ad_footer" id="u6B8A16ED65BF45F3A880FE1C6EFAB4F1"><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></body></html>