<html>

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 10 (filtered)">

<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:.5in .5in .5in .5in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

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

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I&#8217;m just passing along some findings in the hopes that
if anyone is aware that my workaround will cause other problems they&#8217;ll
let me know.</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>In the Locate widget, the lines that use the following code:
ms_newprojectionobj ($szTmpMapProj);</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>where $szTmpMapProj was returned by $oMap-&gt;getProjection
(); returns an error when the projection returned from $oMap is a custom
projection.</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>My application&#8217;s map has a custom projection. When I
use the Locate widget and try to zoom in, for example, to a selected location I
get an error &#8220;</span></font>msProcessProjection(): unknown projection id&#8221;.<font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> The problem
turned out to be that the string returned by the Map&#8217;s getProjection()
could not be used as input to instantiate a new projection object with ms_newprojectionobj().</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>In my application, after:</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>$szTmpMapProj = $oMap-&gt;getProjection ();</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>$szTmpMapProj holds the string &#8220;proj=lcc +lat_0=0
+lat_1=49 +lat_2=77 +lon_0=-91.8666 +datum=NAD83&#8221;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The ms_newprojectionobj() function expects commas between each
of the projection definition items in the string it is passed. So, to get
around the problem, I inserted a line of code to replace the spaces between all
the parameters with commas, like this:</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>            $szTmpMapProj = $oMap-&gt;getProjection ();</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>            $szTmpMapProj = str_replace(&quot; &quot;,
&quot;,&quot;, $szTmpMapProj);</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>                        :</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>                    $projOutObj = ms_newprojectionobj ($szTmpMapProj);</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>And it worked. This won&#8217;t affect any returned epsg
projections, but will if affect some other type of returned projection? </span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I&#8217;m not certain if this would be considered a MapServer
problem or a Chameleon problem (that the returned string from getProjection()
cannot then be used to create a new projection object). It is certainly
possible (and I have no idea) that the string returned by getProjection() CAN
be used as it is returned for a custom projection when it is passed to some other
function. In that case, fixing the returned string to include the commas would
simply break something else. Certainly this is a problem in Chameleon&#8217;s
Locate widget if the map has a custom projection.</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Cheers,</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>jtm</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Joanne T.&nbsp;McGraw<br>
Spatial Data Visualization Specialist / Spécialiste en visualisation des
données spatiales<br>
Agriculture and </span></font><font size=2 face=Arial><span style='font-size:
  10.0pt;font-family:Arial'>Agri-Food</span></font><font size=2 face=Arial><span
 style='font-size:10.0pt;font-family:Arial'> </span></font><font size=2
  face=Arial><span style='font-size:10.0pt;font-family:Arial'>Canada</span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> /
Agriculture et Agroalimentaire </span></font><font size=2 face=Arial><span
  style='font-size:10.0pt;font-family:Arial'>Canada</span></font><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'><br>
Telephone/Téléphone: (613) 759-6103<br>
Facsimile/Télécopieur: (613) 759-1937<br>
</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
  Arial'>960 Carling Ave, #1136</span></font><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'><br>
</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
  Arial'>Ottawa</span></font><font size=2 face=Arial><span style='font-size:
 10.0pt;font-family:Arial'>, </span></font><font size=2 face=Arial><span
  style='font-size:10.0pt;font-family:Arial'>Ontario</span></font><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'><br>
K1A 0C6</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><a href="mailto:mcgrawj@agr.gc.ca">mcgrawj@agr.gc.ca</a></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><img border=0 width=278 height=24
src="cid:image001.jpg@01C5A273.1CD7A340"
alt="Agriculture and Agri-Food Canada - Agriculture et Agroalimentaire Canada"></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;</span></font></p>

</div>

</body>

</html>