[mapserver-users] Re: pointObj->project behaviour differences from 4.10 to 5.6 versions

Juanma M. R. juanma.mr at gmail.com
Tue Apr 24 06:00:01 EDT 2012


Dear Daniel,

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't work at all. That is why I tried to
understand the way the function project works in the different versions.

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't know if any other user in the list has deal with
this problem and used another way to implement it.

Best regards,


> Message: 1
> Date: Mon, 23 Apr 2012 14:03:20 -0400
> From: Daniel Morissette <dmorissette at mapgears.com>
> Subject: Re: [mapserver-users] pointObj->project behaviour differences
>        from    4.10 to 5.6 versions
> To: mapserver-users at lists.osgeo.org
> Message-ID: <4F959968.3040204 at mapgears.com>
> Content-Type: text/plain; charset=windows-1252; format=flowed
>
> EPSG:32630 is UTM Zone 30N ...
>
> http://spatialreference.org/ref/epsg/32630/
>
> A UTM coordinate system is defined for a limited area, a UTM zone has a
> width of 6 degrees of longitude, in this case
>
>   EPSG:32630
>   WGS 84 / UTM zone 30N
>   WGS84 Bounds: -6.0000, 0.0000, 0.0000, 84.0000
>
> It is very likely that you are getting random values from various PROJ
> versions because your -116, -15 test coordinate is outside of the area
> of validity of the EPSG:32630 coordinate system.
>
> Daniel
>
>
> On 12-04-23 9:39 AM, Juanma M. R. wrote:
> > Hi,
> >
> > I have been doing more tests to try to identify exactly the problem and
> > I ahve realized that, according to http://twcc.free.fr/, the coordinates
> > returned when working with php_mapscript from version 4.10 are not
> > correct. I am trying to get where is the problem, so that I can decide
> > wether sorting out a The issue is that the function project returns
> > different things depending on the server configuration:
> >
> > Input coordinates in Google Spherical Mercator:
> > (-20500513.477395,-3641436.
> > 715144)
> >
> > Server 1: proj 4.1.5 and MapServer 4.10 returns
> > (-90270074.105905,-216622133.8792)
> > Server 2: proj 4.1.7 and MapServer 5.6 returns
> > (-20500513.477395,-3641436.715144)
> > The World Coordinate Converter automatically transform the output CRS to
> > UTM 60S, so I can't not validate the transformation with it.
> >
> > The issue is that I would like to understand the expected behaviour from
> > this function, so that I can go on checking it and defining the best way
> > to support the functionality or detecting a problem in servers
> > configuration.
> >
> > The code is as follows:
> >
> > function project($x, $y, $srsIn, $srsOut)
> >          {
> >                  $pointObj=ms_newPointObj();
> >
> >                  $pointObj->setXY($x,$y);
> >
> >
> > $pointObj->project(ms_newProjectionObj("init=".strtolower($srsIn)),
> > ms_newProjectionObj("init=".strtolower($srsOut)));
> >
> >                  $xout=$pointObj->x;
> >                  $yout=$pointObj->y;
> >
> >                  $pointObj->free();
> >
> >                  return $xout.",".$yout;
> >          }
> > ?>
> >
> >
> > 2012/4/16 Lime, Steve D (DNR) <Steve.Lime at state.mn.us
> > <mailto:Steve.Lime at state.mn.us>>
> >
> >     The transformation is done in place, I’ve not had problems with it.
> >     What language? Can you post a code snippet?____
> >
> >     __ __
> >
> >     *From:*mapserver-users-bounces at lists.osgeo.org
> >     <mailto:mapserver-users-bounces at lists.osgeo.org>
> >     [mailto:mapserver-users-bounces at lists.osgeo.org
> >     <mailto:mapserver-users-bounces at lists.osgeo.org>] *On Behalf Of
> >     *Juanma M. R.
> >     *Sent:* Thursday, April 12, 2012 4:13 AM
> >     *To:* mapserver-users at lists.osgeo.org
> >     <mailto:mapserver-users at lists.osgeo.org>
> >     *Subject:* [mapserver-users] pointObj->project behaviour differences
> >     from 4.10 to 5.6 versions____
> >
> >     __ __
> >
> >     Dear list,
> >
> >     I have a webgis application working with different CRS all over the
> >     world. I have realized that the behaviour from version 4.10 of the
> >     function pointObj->project differs from the one of version 5.6 from
> >     Mapserver. For example, I try to convert (-116,-15) in 4326 and in
> >     mapscript from version 4.10 it returns
> >     (-26158630.407638,-25040425.679281) when passing to 32630. On the
> >     other hand, in version 5.6 of mapscript it returns the original
> >     coordinates without transforming them.
> >
> >     Is this intended or am I doing something wrong? Which is the
> >     intended behaviour of project function in MapServer 5.6?
> >
> >     Best regards,
> >     --
> >     Juan Manuel Moreno Rivera.
> >     University of Castilla-La Mancha
> >     Albacete, Spain____
> >
> >
> >
> >
> > --
> > Juan Manuel Moreno Rivera.
> > University of Castilla-La Mancha
> > Albacete, Spain
> >
> >
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
> --
> Daniel Morissette
> http://www.mapgears.com/
> Provider of Professional MapServer Support since 2000
>
>
>
-- 
Juan Manuel Moreno Rivera.
University of Castilla-La Mancha
Albacete, Spain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120424/c8742b7d/attachment.html


More information about the mapserver-users mailing list