PHP mapscript

Daniel Morissette dmorissette at MAPGEARS.COM
Tue Jul 31 12:59:48 EDT 2007


Milo van der Linden wrote:
> Ok, let me format it differently;
> the next string fails to construct the projection that I need. Probably
> because towgs84= contains to much , seperators for the projection object
> to process. Please tell me what I can do to make this work!
> 
> $projRDpma =
> ms_newprojectionobj("proj=sterea,lat_0=52.15616055555555,lon_0=5.38763888888889,k=0.999908,x_0=155000,y_0=463000,ellps=bessel,units=m,towgs84=565.2369,50.0087,465.658,-0.406857330322398,0.350732676542563,-1.87
> 03473836068,4.0812,no_defs");
> 

The proj definition above gives me the following error:

msProcessProjection(): unknown projection id

After a quick check, I suspect you probably need to use proj=stere 
instead of proj=sterea as the projection name ... and then the "+" form 
of projection definition works (the comma-delimited version screws up 
the towgs params as you had expected).

<?php

$proj_string = "+proj=stere +lat_0=52.15616055555555 
+lon_0=5.38763888888889 +k=0.999908 +x_0=155000 +y_0=463000 
+ellps=bessel +units=m 
+towgs84=565.2369,50.0087,465.658,-0.406857330322398,0.350732676542563,-1.8703473836068,4.0812 
+no_defs";

// Use mapObj.getProjection() to verify that the projection is parsed 
properly
$map = ms_newmapobj("");
$map->setProjection($proj_string);
echo $map->getProjection();

?>

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/



More information about the mapserver-users mailing list