<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Jacob &amp; Nicol,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>thanks for your feedback.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>But I am still struggling. Just to clarify: I wonna reproject not individual layers, but my whole map.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Jacob, does "<SPAN class="010195305-24082006"><FONT class="Apple-style-span" color="#0000FF" face="Arial" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">For this, it is required that your layer has a projection object with the native projection of that layer.</SPAN></FONT>" that mean that for each single layer I have to specify the original projection? (Geographic in my case)</SPAN></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>As Nicol stated I need to "recalculate" the extent, at least when using different units (going from DD to Meters). </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>But then, I found that piece of code (slightly changed):</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>$newproj=ms_newprojectionObj("proj=robin,lon_0=0,x_0=0,y_0=0");</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>$latlon=ms_newprojectionObj("proj=longlat,ellps=WGS84,datum=WGS84,no_defs");</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>$oldext=ms_newRectObj();</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>$oldext-&gt;setextent(-180,-90,180,90);  //this is the extent of my map in geographic</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>$oldext-&gt;project($latlon,$newproj);  //reproject to Robinson</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>$map-&gt;setextent($oldext-&gt;minx,$oldext-&gt;miny,$oldext-&gt;maxx,$oldext-&gt;maxy);  //set the new map extent</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>And another one going like this:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>$projInObj = ms_newProjectionObj( "+proj=tmerc ".</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>  "+lat_0=49 ".</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>  "+lon_0=-2 ".</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>  "+k=0.999601 ".</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>  "+x_0=400000 ".</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>  "+y_0=-100000 ".</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>  "+ellps=airy ".</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>  "+towgs84=375,-111,431,0,0,0,0");</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>with this info in the mapscript documentation...</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(229, 229, 229); "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 9.9px;"><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN> </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 9.9px;">int setProjection(string proj_params, boolean bSetUnitsAndExtents)</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(229, 229, 229); "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 9.9px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 9.9px;">Set map projection and coordinate system.</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 9.9px;">  </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 9.9px;">Parameters are given as</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 9.9px;"> </SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(229, 229, 229); "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 9.9px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 9.9px;">a single string of comma-delimited PROJ.4 parameters.</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(229, 229, 229); "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 9.9px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 9.9px;">The argument : bSetUnitsAndExtents is used to automatically update</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(229, 229, 229); "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 9.9px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 9.9px;">the map units and extents based on the new projection. Possible</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 9.9px;"> </SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(229, 229, 229); "><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 9.9px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 9.9px;">values are MS_TRUE and MS_FALSE. By defualt it is set at MS_FALSE</SPAN></FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>So, what should I use? And where is coming the <SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>$map -&gt; setProjection</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>into play?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks for any clarification.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Stefan</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR><DIV><DIV>On Aug 24, 2006, at 7:59 AM, Delfos, Jacob wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">  <DIV dir="ltr" align="left"><SPAN class="010195305-24082006"><FONT face="Arial" color="#0000ff" size="2">Stefan,</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="010195305-24082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="010195305-24082006"><FONT face="Arial" color="#0000ff" size="2">Your question is not entirely clear. You can not re-project an individual layer on-the-fly, because php_mapscript does not re-write the dataset (hence its projection will always be the same); you CAN however change the projection of the map (using setProjection, as you did), which means all layers in the map get re-projected (the dataset remains unchanged, though). For this, it is required that your layer has a projection object with the native projection of that layer. This will cause the layer to be reprojected along with the map. Is this what you are trying to do? </FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="010195305-24082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="010195305-24082006"><FONT face="Arial" color="#0000ff" size="2">You *may* have to save your mapfile, or your session, in order for it to take effect, depending on your setup.</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="010195305-24082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="010195305-24082006"><FONT face="Arial" color="#0000ff" size="2">regards,</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="010195305-24082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="010195305-24082006"><FONT face="Arial" color="#0000ff" size="2">Jacob</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="010195305-24082006"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV><BR> <BLOCKQUOTE dir="ltr" style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">  <DIV class="OutlookMessageHeader" lang="en-us" dir="ltr" align="left">  <HR tabindex="-1">  <FONT face="Tahoma" size="2"><B>From:</B> UMN MapServer Users List   [<A href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU">mailto:MAPSERVER-USERS@LISTS.UMN.EDU</A>] <B>On Behalf Of </B>Stefan   Schwarzer<BR><B>Sent:</B> 24 August 2006 13:45<BR><B>To:</B>   <A href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU">MAPSERVER-USERS@LISTS.UMN.EDU</A><BR><B>Subject:</B> Re: [UMN_MAPSERVER-USERS]   Mapscript Re-Projection on-the-fly<BR></FONT><BR></DIV>  <DIV></DIV>Hey,  <DIV><BR class="khtml-block-placeholder"></DIV>  <DIV>I can't imagine that such a question stays unanswered in the mapserver   community...</DIV>  <DIV><BR class="khtml-block-placeholder"></DIV>  <DIV>I meanwhile added a:</DIV>  <DIV><BR class="khtml-block-placeholder"></DIV>  <DIV><SPAN class="Apple-tab-span" style="WHITE-SPACE: pre"></SPAN>$map -&gt;   setProjection("init=epsg:26711");</DIV>  <DIV><BR class="khtml-block-placeholder"></DIV>  <DIV>to my code, but nothing happens - meaning: no error message but no   reprojection either.</DIV>  <DIV><BR class="khtml-block-placeholder"></DIV>  <DIV>Can anyone help me out?</DIV>  <DIV><BR class="khtml-block-placeholder"></DIV>  <DIV>Thanks in advance.</DIV>  <DIV><BR class="khtml-block-placeholder"></DIV>  <DIV>Stefan</DIV>  <DIV><BR class="khtml-block-placeholder"></DIV>  <DIV><BR>  <DIV>  <DIV>On Aug 22, 2006, at 10:47 AM, Stefan Schwarzer wrote:</DIV><BR class="Apple-interchange-newline">  <BLOCKQUOTE type="cite"><FONT class="Apple-style-span" face="Arial">Gush,</FONT>    <DIV><FONT class="Apple-style-span" face="Arial"><BR class="khtml-block-placeholder"></FONT></DIV>    <DIV><FONT class="Apple-style-span" face="Arial">I couldn't find any precise     information about how to re-project layers on-the-fly via PHP Mapscript.     Here and there (via MailingList and Google) bits and pieces, but altogether     it didn't help me a lot. Though I would have said that this is a basic     question. But perhaps too basic, so everbody finds out by     himself?</FONT></DIV>    <DIV><FONT class="Apple-style-span" face="Arial"><BR class="khtml-block-placeholder"></FONT></DIV>    <DIV><FONT class="Apple-style-span" face="Arial">So, can anyone let me know -     giving a coding example - how to re-project a mapfile on-the-fly from for     example Lat/Long (global view) to Lambert or Robin? </FONT></DIV>    <DIV><FONT class="Apple-style-span" face="Arial"><BR class="khtml-block-placeholder"></FONT></DIV>    <DIV><FONT class="Apple-style-span" face="Arial">Thanks a lot for your     help!</FONT></DIV>    <DIV><FONT class="Apple-style-span" face="Arial"><BR class="khtml-block-placeholder"></FONT></DIV>    <DIV><BR class="khtml-block-placeholder"></DIV></BLOCKQUOTE></DIV><BR></DIV></BLOCKQUOTE></BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>