<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 14 (filtered medium)"><style><!--
/* Font Definitions */
@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:Consolas;
        panose-1:2 11 6 9 2 2 4 3 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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        mso-fareast-language:EN-GB;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-GB;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@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-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I’m surprised that OpenLayers cannot do this.  Granted, the WorldWind applet is a thicker client, but the rather more primative ModestMaps seems perfectly capable of using our WMS and displaying OS maps with square grids at high latitudes.  Are you sure we are not just missing a trick here?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><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"'> Richard Greenwood [mailto:richard.greenwood@gmail.com] <br><b>Sent:</b> 30 May 2013 22:00<br><b>To:</b> Smart, Gary<br><b>Cc:</b> OpenLayers<br><b>Subject:</b> [External] Re: [OpenLayers-Users] EPSG:4326 WMS map aspect ratio<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Thu, May 30, 2013 at 9:52 AM, Smart, Gary <<a href="mailto:Gary.Smart@utas.utc.com" target="_blank">Gary.Smart@utas.utc.com</a>> wrote:<o:p></o:p></p><div><div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks for the response.  However, I am not in control of the WMS maps supplied.  </span><o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Have you issued a getcapabilities request against the server and verified that only epsg:4326 is available? A request would look something like:<o:p></o:p></p></div><div><p class=MsoNormal><a href="http://maps.greenwoodmap.com/cgi-bin/mapserv?map=MAP_22_MAIN6&service=WMS&version=1.3.0&request=GetCapabilities">http://www.youserver.com/wms?service=WMS&version=1.3.0&request=GetCapabilities</a><o:p></o:p></p></div><p class=MsoNormal>and would return an xml document. Available coordinate systems would appear between <CRS> </CRS> tags.<o:p></o:p></p><div><p class=MsoNormal> <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I certainly cannot insist that the customer re-projects his entire WMS contents.</span><o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal>The customer is always right, but we can try to educate them.<o:p></o:p></p></div><div><p class=MsoNormal> <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I am looking for a way to make the client (openLayers) adjust the projection (to its native spherical Mercator) prior to display? </span><o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>You are asking OpenLayers to reproject raster data and that's not something that OpenLayers can do. Maybe someone else knows of a kluge that would make it look better.<o:p></o:p></p></div><div><p class=MsoNormal> <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Incidentally, WorldWind has no problem displaying maps from the very same WMS and displaying a square OS grid.</span><o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal>I am not familiar with WorldWind but I have seen other desktop GIS software that will do some undefined projection of lat/long data to make it look nicer on screen. And that sounds like what you're looking for. Still, in my mind, the "right" way to do it is to use an appropriate local coordinate system. That's what they are there for.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Good luck,<o:p></o:p></p></div><div><p class=MsoNormal>Rich<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><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"'> Richard Greenwood [mailto:<a href="mailto:richard.greenwood@gmail.com" target="_blank">richard.greenwood@gmail.com</a>] </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Sent:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> 25 May 2013 16:03<br><b>To:</b> Smart, Gary<br><b>Cc:</b> OpenLayers<br><b>Subject:</b> [External] Re: [OpenLayers-Users] EPSG:4326 WMS map aspect ratio</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'>I would suggest that you use an appropriate map projection for your area of interest. That's what projections are for. Ideally you project all your data and save it in that projection, although it is possible to reproject on the server, or on the client.<o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Rich<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'> <o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>On Wed, May 22, 2013 at 7:59 AM, Smart, Gary <<a href="mailto:Gary.Smart@utas.utc.com" target="_blank">Gary.Smart@utas.utc.com</a>> wrote:<o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I really would like to display the contents of my local WMS in a form which the users are used to (i.e. square OS grids, rather than the ‘squashed’ appearance which comes from mapping the EPSG:4326 onto a flat-Earth projection in high latitudes).  I have found numerous examples of’ how to resolve this problem’, but none seem to have any effect on the distortion OR they result in no map being displayed at all.  I cannot connect directly to map servers on the web (spherical Mercator), because my system is an isolated network and the maps are supplied by the customer.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Salient extracts from the js code follow:<o:p></o:p></p><pre style='background:white'><span style='background:#F0F0F0'>        var map, options = { </span><o:p></o:p></pre><pre style='background:white'><span style='background:#F0F0F0'>                             projection: new OpenLayers.Projection('EPSG:4326'), </span><o:p></o:p></pre><pre style='background:white'><o:p> </o:p></pre><pre style='background:white'><span style='background:#F0F0F0'>                             //displayProjection: new OpenLayers.Projection(‘EPSG:3574’),</span><o:p></o:p></pre><pre style='background:white'><span style='background:#F0F0F0'>                             //units: ‘m’,</span><o:p></o:p></pre><pre style='background:white'><span style='background:#F0F0F0'>                             //maxResolution: 156543.0339,</span><o:p></o:p></pre><pre style='background:white'><span style='background:#F0F0F0'>                             //maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 20037508, 20037508)</span><o:p></o:p></pre><pre style='background:white'><span style='background:#F0F0F0'>                             zoom: 14</span><o:p></o:p></pre><pre style='background:white'><span style='background:#F0F0F0'>                           };</span><o:p></o:p></pre><pre style='background:white'><span style='background:#F0F0F0'>        map = new OpenLayers.Map('map', options);</span><o:p></o:p></pre><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:white'><span style='font-size:10.0pt;font-family:"Courier New";background:#F0F0F0'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:white'><span style='font-size:10.0pt;font-family:"Courier New";background:#F0F0F0'>        <span style='color:blue'>var</span> my50kLayer = <span style='color:blue'>new</span> OpenLayers.Layer.WMS( <span style='color:maroon'>"OpenLayers WMS"</span>, </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:white'><span style='font-size:10.0pt;font-family:"Courier New";background:#F0F0F0'>                                                   <span style='color:maroon'>"<a href="http://expdev2/cgi-bin/wms?" target="_blank">http://expdev2/cgi-bin/wms?</a>"</span>, </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:white'><span style='font-size:10.0pt;font-family:"Courier New";background:#F0F0F0'>                                                   {</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:white'><span style='font-size:10.0pt;font-family:"Courier New";background:#F0F0F0'>                                                     layers: <span style='color:maroon'>'UK_ASRP_1to50000'</span>,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:white'><span style='font-size:10.0pt;font-family:"Courier New";background:#F0F0F0'>                                                     format: <span style='color:maroon'>'image/png'</span>,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:white'><span style='font-size:10.0pt;font-family:"Courier New";background:#F0F0F0'>                                                     <span style='color:green'>//transparent: 'true',</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:white'><span style='font-size:10.0pt;font-family:"Courier New";background:#F0F0F0'>                                                    continuousWorld: true,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:white'><span style='font-size:10.0pt;font-family:"Courier New";background:#F0F0F0'>                                                     attribution: <span style='color:maroon'>"OS 1:50K"</span>,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;background:white'><span style='font-size:10.0pt;font-family:"Courier New";background:#F0F0F0'>                                                   }); </span><o:p></o:p></p><pre style='background:white'><o:p> </o:p></pre><pre style='background:white'><span style='background:#F0F0F0'>        map.addLayers([my50kLayer]);</span><o:p></o:p></pre><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>As the code exists above, the displayed map works fine (apart from the squished grid rectangles).  Having adapted the ‘measure example’ from the OpenLayers examples page, I can measure from the map, and if the geodesic selection is made, the measurements are clearly correct (1Km across both dimensions of the OS grid).  With geodesic selection not clicked, the measurement across the map is approximately 1.5Km.  So the transforms and projections are clearly in sync.  But how do I stretch the maps in the ‘y’ direction so they appear equant (not squished vertically)?<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Adding the displayProjection seems to do nothing.  Using any of the other options with my WMS, results in a blank map.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I have also plagiarised the polar-projections example from the OpenLayers example site, and replace the buttons with the following projections:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>var projectionOptions = </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>    {</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>        'EPSG:4326':</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>        {</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>            projection: new OpenLayers.Projection('EPSG:4326')</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>        },</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>        'EPSG:3857':</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>        {</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>            projection: new OpenLayers.Projection('EPSG:3857'),</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>            maxExtent: new OpenLayers.Bounds(-5505054, -5505054, 5505054, 5505054),</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>            maxResolution: 5505054 / 128,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>            numZoomLevels: 18</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>        }</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>    }; // end projectionOptions array</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>And I have applied the projections as per the example code (i.e. setProjection function was copied and is being called).  However, pressing EPSG:3857 button results in a blank map, and pressing EPSG:4326 after that, also results in a blank map (albeit with a white pair of tiles in the middle)!</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>Can anyone tell me whether it is possible to display a square grid for OS maps coming from an EPSG:4326 WMS?</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-family:"Courier New"'>Thank you.</span><o:p></o:p></p></div></div></div></div></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><o:p></o:p></p></blockquote></div><p class=MsoNormal><br><br clear=all><o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>-- <br>Richard Greenwood<br><a href="mailto:richard.greenwood@gmail.com">richard.greenwood@gmail.com</a><br><a href="http://www.greenwoodmap.com">www.greenwoodmap.com</a> <o:p></o:p></p></div></div></div></body></html>