[mapserver-users] projection error

Shaik Anwar Hussain shussain at atsincorp.com
Wed Jan 9 10:01:58 PST 2002


Hi All,

         I am doing Point Projection. I am getting the following error.
Does any one know how to correct this error.

Fatal error: MapServer Error in msProcessProjection(): major axis or radius
= 0 or not given in c:\program files\apache
group\apache\htdocs\php406\scripts\projpoint.php on line 11

I am using mapserver 3.5 and php 4.0.6. Webserver is Apache, Operating
system is Windows 2000.  

The code i written for projection is

<?php

dl("php_mapscript.dll");
dl("php_dbase.dll");
dl("php_proj.dll");

$shpFname = 'C:\Program Files\Apache
Group\Apache\htdocs\php406\data\pointproj';
$shpFile = ms_newShapeFileObj( $shpFname, MS_SHP_POINT);
$dbfFile = dbase_create($shpFname.".dbf",
array(array("PROG_ID","N",5,0),array("PROJ_NAME","C",10)));
 
$projinobj  = ms_newprojectionObj("proj=latlong");
$projoutobj =
ms_newprojectionObj("proj=lcc,ellps=GRS80,lat_0=49,lon_0=-95,lat_1=49,lat_1=
77");

$oShp = ms_newShapeObj(MS_SHAPE_POINT);
$oLine = ms_newLineObj();

  
$opoint = ms_newPointObj();
$opoint->setXY(-92.0,62.0);
$opoint=$opoint->project($projinobj, $projoutobj);
$oLine->add($opoint);

$programid=100;
$pname="ATS";

$oShp->add( $oLine );
$shpFile->addShape($oShp);  
dbase_add_record($dbfFile, array($programId, $pname));


echo "Shapes Created.<BR>";

$shpFile->free();
echo "Shape File ($shpFname) closed.<BR>";

dbase_close($dbfFile);
echo "Dbase file closed. <br>";
 
?>



Thanks for ur Time,
Anwar
www.atsincorp.com




More information about the MapServer-users mailing list