[Mapserver-users] Mapscript problem with MS401

Valerio Noti noti at ciaoweb.it
Tue Nov 11 12:14:57 EST 2003


This is a multi-part message in MIME format.

------=_NextPart_000_002C_01C3A87F.B6AEAE40
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello,

I've upgraded mapscript version from 366 to 401 downloaded from =
DMsolutions.
My old application seems to work well without applying changes to =
mapfile or code.
However I got an error when I try to get the feature extent of a =
selected object.

Code of bound.php:

....
$map =3D ms_newMapObj("mapfile.map");
$image=3D$map->draw();
$shapefile =3D ms_newShapefileObj($HTTP_GET_VARS["layer"],-1);
$shape =3D $shapefile->getShape($HTTP_GET_VARS["ShapeIndex"]);

//feature extension
$ShapeIndex =3D $HTTP_GET_VARS["ShapeIndex"];
$shapeExt =3D $shapefile->getExtent($ShapeIndex);
$minx =3D $shapeExt->minx;
$miny =3D $shapeExt->miny;
$maxx =3D $shapeExt->maxx;
$maxy =3D $shapeExt->maxy;
....

I passed layer and shapeindex by a form and retrieved them with =
HTTP_GET_VARS.
I located shapefile in "shape" folder (as saved in mapfile.map) but I =
also tried
copying shapefile in the same directory of bound.php.

The error is:
*****************************
Warning: [MapServer Error]: msSHPOpenFile(): (CAT_VETT) in =
c:\inetpub\wwwroot\gall\bound.php on line 16

Fatal error: Failed to open shapefile CAT_VETT in =
c:\inetpub\wwwroot\gall\bound.php on line 16
*****************************
CAT_VETT is the right name of shapefile, line 16 is:

$shapefile =3D ms_newShapefileObj($HTTP_GET_VARS["layer"],-1);

All this works fine changing reference to PHP_MAPSCRIPT_36.dll instead =
of PHP_MAPSCRIPT_4.0.1.dll.

Any help appreciated
Thanks

Valerio Noti
------=_NextPart_000_002C_01C3A87F.B6AEAE40
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1226" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I've upgraded mapscript version from =
366 to 401=20
downloaded from DMsolutions.<BR>My old application seems to work well =
without=20
applying changes to mapfile or code.<BR>However I got an error when I =
try to get=20
the feature extent of a selected object.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Code of bound.php:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>....<BR>$map =3D=20
ms_newMapObj("mapfile.map");<BR>$image=3D$map-&gt;draw();<BR>$shapefile =
=3D=20
ms_newShapefileObj($HTTP_GET_VARS["layer"],-1);<BR>$shape =3D=20
$shapefile-&gt;getShape($HTTP_GET_VARS["ShapeIndex"]);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>//feature extension<BR>$ShapeIndex =3D=20
$HTTP_GET_VARS["ShapeIndex"];<BR>$shapeExt =3D=20
$shapefile-&gt;getExtent($ShapeIndex);<BR>$minx =3D =
$shapeExt-&gt;minx;<BR>$miny =3D=20
$shapeExt-&gt;miny;<BR>$maxx =3D $shapeExt-&gt;maxx;<BR>$maxy =3D=20
$shapeExt-&gt;maxy;<BR>....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I passed layer and shapeindex by a form =
and=20
retrieved them with HTTP_GET_VARS.<BR>I located shapefile in "shape" =
folder (as=20
saved in mapfile.map) but I also tried<BR>copying shapefile in the same=20
directory of bound.php.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The error=20
is:<BR>*****************************<BR>Warning: [MapServer Error]:=20
msSHPOpenFile(): (CAT_VETT) in c:\inetpub\wwwroot\gall\bound.php on line =

16</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Fatal error: Failed to open shapefile =
CAT_VETT in=20
c:\inetpub\wwwroot\gall\bound.php on line=20
16<BR>*****************************<BR>CAT_VETT is the right name of =
shapefile,=20
line 16 is:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>$shapefile =3D=20
ms_newShapefileObj($HTTP_GET_VARS["layer"],-1);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>All this works fine changing reference =
to=20
PHP_MAPSCRIPT_36.dll instead of PHP_MAPSCRIPT_4.0.1.dll.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Any help =
appreciated<BR>Thanks</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Valerio Noti</FONT></DIV></BODY></HTML>

------=_NextPart_000_002C_01C3A87F.B6AEAE40--




More information about the mapserver-users mailing list