<div class="gmail_extra">Dear Daniel,<br><br>Thank you for your answer Daniel. I already know that the coordinate I put was out of bounds for this limit. The issue is that I am trying to find the best option to manage this change from one global CRS to a local one, as it is necessary in my application. In version 4.10 it returned values for local CRS and allowed to go back again to global ones. So it worked. However, in version 5.6 it doesn&#39;t work at all. That is why I tried to understand the way the function project works in the different versions.<br>
<br>After testing and your feedback, obviously I prefer the behaviour of the 5.6 that at least allows you to detect whenever a coordinate is out of the bounds without having to check for each CRS bounds. In version 5.6 project function returns the same coordinates when asking for transforming a coordinate out of bounds for the output CRS. Checking if the function returns the same coordinates helps you detecting this case and it is easier to control it. I don&#39;t know if any other user in the list has deal with this problem and used another way to implement it.<br>
<br>Best regards,<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Message: 1<br>
Date: Mon, 23 Apr 2012 14:03:20 -0400<br>
From: Daniel Morissette &lt;<a href="mailto:dmorissette@mapgears.com">dmorissette@mapgears.com</a>&gt;<br>
Subject: Re: [mapserver-users] pointObj-&gt;project behaviour differences<br>
        from    4.10 to 5.6 versions<br>
To: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
Message-ID: &lt;<a href="mailto:4F959968.3040204@mapgears.com">4F959968.3040204@mapgears.com</a>&gt;<br>
Content-Type: text/plain; charset=windows-1252; format=flowed<br>
<br>
EPSG:32630 is UTM Zone 30N ...<br>
<br>
<a href="http://spatialreference.org/ref/epsg/32630/" target="_blank">http://spatialreference.org/ref/epsg/32630/</a><br>
<br>
A UTM coordinate system is defined for a limited area, a UTM zone has a<br>
width of 6 degrees of longitude, in this case<br>
<br>
   EPSG:32630<br>
   WGS 84 / UTM zone 30N<br>
   WGS84 Bounds: -6.0000, 0.0000, 0.0000, 84.0000<br>
<br>
It is very likely that you are getting random values from various PROJ<br>
versions because your -116, -15 test coordinate is outside of the area<br>
of validity of the EPSG:32630 coordinate system.<br>
<br>
Daniel<br>
<br>
<br>
On 12-04-23 9:39 AM, Juanma M. R. wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I have been doing more tests to try to identify exactly the problem and<br>
&gt; I ahve realized that, according to <a href="http://twcc.free.fr/" target="_blank">http://twcc.free.fr/</a>, the coordinates<br>
&gt; returned when working with php_mapscript from version 4.10 are not<br>
&gt; correct. I am trying to get where is the problem, so that I can decide<br>
&gt; wether sorting out a The issue is that the function project returns<br>
&gt; different things depending on the server configuration:<br>
&gt;<br>
&gt; Input coordinates in Google Spherical Mercator:<br>
&gt; (-20500513.477395,-3641436.<br>
&gt; 715144)<br>
&gt;<br>
&gt; Server 1: proj 4.1.5 and MapServer 4.10 returns<br>
&gt; (-90270074.105905,-216622133.8792)<br>
&gt; Server 2: proj 4.1.7 and MapServer 5.6 returns<br>
&gt; (-20500513.477395,-3641436.715144)<br>
&gt; The World Coordinate Converter automatically transform the output CRS to<br>
&gt; UTM 60S, so I can&#39;t not validate the transformation with it.<br>
&gt;<br>
&gt; The issue is that I would like to understand the expected behaviour from<br>
&gt; this function, so that I can go on checking it and defining the best way<br>
&gt; to support the functionality or detecting a problem in servers<br>
&gt; configuration.<br>
&gt;<br>
&gt; The code is as follows:<br>
&gt;<br>
&gt; function project($x, $y, $srsIn, $srsOut)<br>
&gt;          {<br>
&gt;                  $pointObj=ms_newPointObj();<br>
&gt;<br>
&gt;                  $pointObj-&gt;setXY($x,$y);<br>
&gt;<br>
&gt;<br>
&gt; $pointObj-&gt;project(ms_newProjectionObj(&quot;init=&quot;.strtolower($srsIn)),<br>
&gt; ms_newProjectionObj(&quot;init=&quot;.strtolower($srsOut)));<br>
&gt;<br>
&gt;                  $xout=$pointObj-&gt;x;<br>
&gt;                  $yout=$pointObj-&gt;y;<br>
&gt;<br>
&gt;                  $pointObj-&gt;free();<br>
&gt;<br>
&gt;                  return $xout.&quot;,&quot;.$yout;<br>
&gt;          }<br>
&gt; ?&gt;<br>
&gt;<br>
&gt;<br>
&gt; 2012/4/16 Lime, Steve D (DNR) &lt;<a href="mailto:Steve.Lime@state.mn.us">Steve.Lime@state.mn.us</a><br>
&gt; &lt;mailto:<a href="mailto:Steve.Lime@state.mn.us">Steve.Lime@state.mn.us</a>&gt;&gt;<br>
&gt;<br>
&gt;     The transformation is done in place, I’ve not had problems with it.<br>
&gt;     What language? Can you post a code snippet?____<br>
&gt;<br>
&gt;     __ __<br>
&gt;<br>
&gt;     *From:*<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a><br>
&gt;     &lt;mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a>&gt;<br>
&gt;     [mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a><br>
&gt;     &lt;mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a>&gt;] *On Behalf Of<br>
&gt;     *Juanma M. R.<br>
&gt;     *Sent:* Thursday, April 12, 2012 4:13 AM<br>
&gt;     *To:* <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
&gt;     &lt;mailto:<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>&gt;<br>
&gt;     *Subject:* [mapserver-users] pointObj-&gt;project behaviour differences<br>
&gt;     from 4.10 to 5.6 versions____<br>
&gt;<br>
&gt;     __ __<br>
&gt;<br>
&gt;     Dear list,<br>
&gt;<br>
&gt;     I have a webgis application working with different CRS all over the<br>
&gt;     world. I have realized that the behaviour from version 4.10 of the<br>
&gt;     function pointObj-&gt;project differs from the one of version 5.6 from<br>
&gt;     Mapserver. For example, I try to convert (-116,-15) in 4326 and in<br>
&gt;     mapscript from version 4.10 it returns<br>
&gt;     (-26158630.407638,-25040425.679281) when passing to 32630. On the<br>
&gt;     other hand, in version 5.6 of mapscript it returns the original<br>
&gt;     coordinates without transforming them.<br>
&gt;<br>
&gt;     Is this intended or am I doing something wrong? Which is the<br>
&gt;     intended behaviour of project function in MapServer 5.6?<br>
&gt;<br>
&gt;     Best regards,<br>
&gt;     --<br>
&gt;     Juan Manuel Moreno Rivera.<br>
&gt;     University of Castilla-La Mancha<br>
&gt;     Albacete, Spain____<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Juan Manuel Moreno Rivera.<br>
&gt; University of Castilla-La Mancha<br>
&gt; Albacete, Spain<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; mapserver-users mailing list<br>
&gt; <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
&gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br>
<br>
--<br>
Daniel Morissette<br>
<a href="http://www.mapgears.com/" target="_blank">http://www.mapgears.com/</a><br>
Provider of Professional MapServer Support since 2000<br>
<br>
<br clear="all"></blockquote></div><br>-- <br>Juan Manuel Moreno Rivera.<br>
University of Castilla-La Mancha<br>
Albacete, Spain<br>
</div>