<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 10 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* 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;}
span.EmailStyle18
        {font-family:Arial;
        color:navy;}
@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 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I sent this out yesterday and went to view
the text on line to see if anyone had responded and the message was “scrubbed”.
I’m trying to send this again to see if it goes through properly.</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Sorry for any inconvenience,</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>jtm </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Tahoma><span
lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>-----Original
Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> McGraw, Joanne <br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, August 16, 2005
3:00 PM<br>
<b><span style='font-weight:bold'>To:</span></b> 'chameleon@lists.maptools.org'<br>
<b><span style='font-weight:bold'>Subject:</span></b> Locate widget - unknown
projection id</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>I’m just passing along some
findings in the hopes that if anyone is aware that my workaround will cause
other problems they’ll let me know.</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><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 style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>where $szTmpMapProj was returned by
$oMap->getProjection (); returns an error when the projection returned from
$oMap is a custom projection.</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>My application’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 “</span></font>msProcessProjection():
unknown projection id”.<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’s getProjection() could not be used as input to
instantiate a new projection object with ms_newprojectionobj().</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>In my application, after:</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>$szTmpMapProj =
$oMap->getProjection ();</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>$szTmpMapProj holds the string
“proj=lcc +lat_0=0 +lat_1=49 +lat_2=77 +lon_0=-91.8666
+datum=NAD83”</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><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 style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>
$szTmpMapProj = $oMap->getProjection ();</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>
$szTmpMapProj = str_replace(" ", ",", $szTmpMapProj);</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>
:</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>
$projOutObj = ms_newprojectionobj ($szTmpMapProj);</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>And it worked. This won’t
affect any returned epsg projections, but will if affect some other type of
returned projection? </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>I’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’s Locate widget if the map has a custom projection.</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Cheers,</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>jtm</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Joanne T. McGraw<br>
Spatial Data Visualization Specialist / Spécialiste en visualisation des
données spatiales<br>
Agriculture and Agri-Food Canada / Agriculture et Agroalimentaire Canada<br>
Telephone/Téléphone: (613) 759-6103<br>
Facsimile/Télécopieur: (613) 759-1937<br>
960 Carling Ave, #1136<br>
Ottawa, Ontario<br>
K1A 0C6</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><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 style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><img border=0 width=278 height=24
src="cid:image001.jpg@01C5A332.F8FD4F90"
alt="Agriculture and Agri-Food Canada - Agriculture et Agroalimentaire Canada"></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
</div>
</body>
</html>