[Mapserver-users] ms_newprojectionObj - change from v3.6 to v4.0??

Daniel Morissette morissette at dmsolutions.ca
Tue Dec 16 17:05:28 EST 2003


Debbie Pagurek wrote:
> *  *Hi all,
> I am trying to get some code that worked with php_mapscript_36.so to 
> work with php_mapscript_40.so but am having problems.
>  
> This worked before:
>   $newproj=ms_newprojectionObj("proj=robin,lon_0=0,x_0=0,y_0=0");
>   $latlon =  
> ms_newprojectionObj("proj=longlat,ellps=GRS80,datum=NAD83,no_defs");
> 
>   $oldext= ms_newRectObj();
>   $oldext->setextent($bounds[0],$bounds[1],$bounds[2],$bounds[3]);  
> //the extent in latlong
> 
>   $newextproj = ms_newRectObj();
>   $newextproj = $oldext->project($latlon,$newproj);  //the extent in 
> Robinson
> 

The project() method has changed for all object types in version 4.0. 
It operates directly on the object and returns MS_SUCCESS/MS_FAILURE.

<long_story>
This had to be changed because of a bug in the old project() method: it 
used to modify the original object internally without updating the PHP 
wrappers, plus the returned object used to invalidate the original 
object so you could end up with crashes if the PHP variable referring to 
the original object was deleted or modified.
</long_story>

Daniel
-- 
------------------------------------------------------------
  Daniel Morissette               morissette at dmsolutions.ca
  DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------




More information about the mapserver-users mailing list