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

Paul Spencer spencer at dmsolutions.ca
Tue Dec 16 22:34:04 EST 2003


Debbie, from the php mapscript class reference, it looks like it returns 
a result code instead of a new rectobj, and the projection is applied to 
the actual rectobj rather than a copy.  So your code should read:

$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" );

$oRect= ms_newRectObj();
$oRect->setextent( $bounds[0], $bounds[1],
                    $bounds[2], $bounds[3] );
$oRect->project( $latlon,$newproj);  //the extent in
$map->setextent( $oRect->minx, $oRect->miny,
                  $oRect->maxx, $oRect->maxy );

Cheers,

Paul

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
> 
>   
> $map->setextent($newextproj->minx,$newextproj->miny,$newextproj->maxx,$newextproj->maxy);
> But now when I try to see the new map extents e.g.
> echo "new ext minx = ".$newextproj->minx;
> I'm getting nothing.
>  
> Has something else changed with Mapserver4 / php_mapscript_40.so?
> Can anyone give me any pointers?
>  
> Thanks in advance.
> D. Pagurek
>  

-- 
  -----------------------------------------------------------------
|Paul Spencer                           spencer at dmsolutions.ca    |
|-----------------------------------------------------------------|
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
  -----------------------------------------------------------------




More information about the mapserver-users mailing list