<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-AU link=blue vlink=purple>

<div class=WordSection1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I&#8217;ve seen this problem on some Spherical Mercator maps,
but generally they should line up. I notice that in Singapore, Google Satellite
and Bing street are out by a large amount that looks like a failure to apply
the WGS84 datum when calculating degrees lat lon.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>If the problem is a datum shift, it might be possible to correct
it by converting the coordinates from Spherical degrees to WGS84 degrees. I do this
in a static map generator, where the formulae I was using gave spherical degrees
instead of real WGS degrees. I converted the spherical degrees back to metres (i.e.
900913 projection), using the reverseMercator formulae from the OL
SphericalMercator source file. Then I converted the metres to proper WGS84,
using the Proj4 library. This might be kludgy, but it works. (If anyone knows a
more elegant way of doing it, I&#8217;d be grateful.)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>&nbsp;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>However, just one thing &#8211; you have the units defined as &#8216;ft&#8217;
in your map global options. I think this should be &#8216;m&#8217;.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><b><span style='font-family:"Verdana","sans-serif";
color:gray'>Rohan Parkes</span></b><span style='color:#1F497D'> <br>
<br>
</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p></o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> users-bounces@openlayers.org
[mailto:users-bounces@openlayers.org] <b>On Behalf Of </b>B. Heath Robinson<br>
<b>Sent:</b> Sunday, 15 August 2010 06:38<br>
<b>To:</b> users@openlayers.org<br>
<b>Subject:</b> [OpenLayers-Users] Spherical Mercator 4326 Layers do not line
up<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span class=apple-style-span><span style='font-size:13.5pt;
font-family:"Helvetica","sans-serif"'>I am having a problem with a WMS layer
lining up on top of a Google map. &nbsp;It appears to be about 15mi south of
were it needs to be. &nbsp;I am assuming this is because of the fact that
spherical mercator ignores the fact the earth is an ellipse. &nbsp;Anyway, I
have included my openlayers code and my mapfile as after spending hours search
seems to be helpful.</span></span><span style='font-size:13.5pt;font-family:
"Helvetica","sans-serif"'><br>
<br>
<span class=apple-style-span>I get the same results using either a shapfile or
postgis data each with a different projection.</span><br>
<br>
<span class=apple-style-span>I am using what I believe to be the best method.
&nbsp;If I use &quot;reproject:true&quot; the map does line up, but that causes
other known problems and is deprecated. &nbsp;Any help would be greatly
appreciated.</span><br>
<span class=apple-style-span>---------Open Layers---------</span><br>
<span class=apple-style-span>function init(){</span><br>
<span class=apple-style-span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var
options = {</span><br>
<span class=apple-style-span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;projection:
&quot;EPSG:900913&quot;,</span><br>
<span class=apple-style-span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;units:
&quot;ft&quot;,</span><br>
<span class=apple-style-span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;maxResolution:
156543.0339,</span><br>
<span class=apple-style-span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;maxExtent:
new OpenLayers.Bounds(-20037508, -20037508,</span><br>
<span class=apple-style-span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;20037508,
20037508)</span><br>
<span class=apple-style-span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</span><br>
<span class=apple-style-span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;map
= new OpenLayers.Map('map', options);</span><br>
<br>
<span class=apple-style-span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var
gmap = new OpenLayers.Layer.Google(</span><br>
<span class=apple-style-span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Google
Streets&quot;,</span><br>
<span class=apple-style-span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{'sphericalMercator':
true}</span><br>
<span class=apple-style-span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);</span><br>
<br>
<br>
</span><o:p></o:p></p>

</div>

</body>

</html>