[Mapserver-users] Mapscript problem with MS401

Valerio Noti noti at ciaoweb.it
Wed Nov 12 05:46:17 EST 2003


This is a multi-part message in MIME format.

------=_NextPart_000_0063_01C3A912.95483A30
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi Daniel,
Nothing to do:
CAT_VETT.shp, mapfile.map and bound.php are in the same directory.
A copy of CAT_VETT.shp is also in "shape" subfolder.

This is the mapfile:
*******************
...
SHAPEPATH "shape"
....
LAYER
NAME CAT_VETT
TYPE POLYGON
STATUS ON
DATA CAT_VETT
 CLASS
  COLOR 110 50 100
  OUTLINECOLOR 200 200 200
 END
END
......
*******************

I tried also:
$path =3D "http://192.168.1.51/gall/CAT_VETT";
$shapefile =3D ms_newShapefileObj($path,-1);

but the error is always the same:
****************************************
Warning: [MapServer Error]: msSHPOpenFile(): (CAT_VETT) in =
c:\inetpub\wwwroot\gall\bound.php on line 19
Fatal error: Failed to open shapefile CAT_VETT in =
c:\inetpub\wwwroot\gall\bound.php on line 19
****************************************

Thank you very much

Valerio Noti




----- Original Message -----=20
From: "Daniel Morissette" <morissette at dmsolutions.ca>
To: "Valerio Noti" <noti at ciaoweb.it>
Cc: <mapserver-users at lists.gis.umn.edu>
Sent: Tuesday, November 11, 2003 8:00 PM
Subject: Re: [Mapserver-users] Mapscript problem with MS401


> One difference between V3.6 and 4.0 is the way relative paths are=20
> handled.  Is the CAT_VETT.shp in the same directory as the mapfile?=20
> Perhaps try using an absolute path in the call to ms_newShapefileObj() =

> and see if that makes a difference.
>=20
> Daniel
>=20
> Valerio Noti wrote:
> > Hello,
> > =20
> > I've upgraded mapscript version from 366 to 401 downloaded from =
DMsolutions.
> > My old application seems to work well without applying changes to=20
> > mapfile or code.
> > However I got an error when I try to get the feature extent of a=20
> > selected object.
> > =20
> > Code of bound.php:
> > =20
> > ....
> > $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"]);
> > =20
> > //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;
> > ....
> > =20
> > I passed layer and shapeindex by a form and retrieved them with=20
> > HTTP_GET_VARS.
> > I located shapefile in "shape" folder (as saved in mapfile.map) but =
I=20
> > also tried
> > copying shapefile in the same directory of bound.php.
> > =20
> > The error is:
> > *****************************
> > Warning: [MapServer Error]: msSHPOpenFile(): (CAT_VETT) in=20
> > c:\inetpub\wwwroot\gall\bound.php on line 16
> > =20
> > Fatal error: Failed to open shapefile CAT_VETT in=20
> > c:\inetpub\wwwroot\gall\bound.php on line 16
> > *****************************
> > CAT_VETT is the right name of shapefile, line 16 is:
> > =20
> > $shapefile =3D ms_newShapefileObj($HTTP_GET_VARS["layer"],-1);
> > =20
> > All this works fine changing reference to PHP_MAPSCRIPT_36.dll =
instead=20
> > of PHP_MAPSCRIPT_4.0.1.dll.
> > =20
> > Any help appreciated
> > Thanks
> > =20
> > Valerio Noti
>=20
>=20
> 
------=_NextPart_000_0063_01C3A912.95483A30
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>
<DIV><FONT face=3DArial size=3D2>Hi Daniel,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Nothing to do:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>CAT_VETT.shp, mapfile.map and =
bound.php&nbsp;are in=20
the same directory.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>A copy of CAT_VETT.shp is also in =
"shape"=20
subfolder.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>This is the mapfile:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>*******************</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>...<BR>SHAPEPATH =
"shape"<BR>....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>LAYER<BR>NAME CAT_VETT<BR>TYPE =
POLYGON<BR>STATUS=20
ON<BR>DATA CAT_VETT<BR>&nbsp;CLASS<BR>&nbsp;&nbsp;COLOR 110 50=20
100<BR>&nbsp;&nbsp;OUTLINECOLOR 200 200 =
200<BR>&nbsp;END<BR>END</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>......</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>*******************</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I tried also:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>$path =3D "</FONT><A=20
href=3D"http://192.168.1.51/gall/CAT_VETT"><FONT face=3DArial=20
size=3D2>http://192.168.1.51/gall/CAT_VETT</FONT></A><FONT face=3DArial=20
size=3D2>";<BR>$shapefile =3D ms_newShapefileObj($path,-1);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>but the error is always the =
same:</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>****************************************</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Warning: [MapServer Error]: =
msSHPOpenFile():=20
(CAT_VETT) in c:\inetpub\wwwroot\gall\bound.php on line 19<BR>Fatal =
error:=20
Failed to open shapefile CAT_VETT in c:\inetpub\wwwroot\gall\bound.php =
on line=20
19</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>****************************************</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thank you very much</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Valerio Noti</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>----- Original Message ----- </FONT>
<DIV><FONT face=3DArial size=3D2>From: "Daniel Morissette" &lt;</FONT><A =

href=3D"mailto:morissette at dmsolutions.ca"><FONT face=3DArial=20
size=3D2>morissette at dmsolutions.ca</FONT></A><FONT face=3DArial=20
size=3D2>&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>To: "Valerio Noti" &lt;</FONT><A=20
href=3D"mailto:noti at ciaoweb.it"><FONT face=3DArial=20
size=3D2>noti at ciaoweb.it</FONT></A><FONT face=3DArial =
size=3D2>&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Cc: &lt;</FONT><A=20
href=3D"mailto:mapserver-users at lists.gis.umn.edu"><FONT face=3DArial=20
size=3D2>mapserver-users at lists.gis.umn.edu</FONT></A><FONT face=3DArial=20
size=3D2>&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Sent: Tuesday, November 11, 2003 8:00=20
PM</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Subject: Re: [Mapserver-users] =
Mapscript problem=20
with MS401</FONT></DIV></DIV>
<DIV><FONT face=3DArial><BR><FONT size=3D2></FONT></FONT></DIV><FONT =
face=3DArial=20
size=3D2>&gt; One difference between V3.6 and 4.0 is the way relative =
paths are=20
<BR>&gt; handled.&nbsp; Is the CAT_VETT.shp in the same directory as the =

mapfile? <BR>&gt; Perhaps try using an absolute path in the call to=20
ms_newShapefileObj() <BR>&gt; and see if that makes a =
difference.<BR>&gt;=20
<BR>&gt; Daniel<BR>&gt; <BR>&gt; Valerio Noti wrote:<BR>&gt; &gt; =
Hello,<BR>&gt;=20
&gt;&nbsp; <BR>&gt; &gt; I've upgraded mapscript version from 366 to 401 =

downloaded from DMsolutions.<BR>&gt; &gt; My old application seems to =
work well=20
without applying changes to <BR>&gt; &gt; mapfile or code.<BR>&gt; &gt; =
However=20
I got an error when I try to get the feature extent of a <BR>&gt; &gt; =
selected=20
object.<BR>&gt; &gt;&nbsp; <BR>&gt; &gt; Code of bound.php:<BR>&gt; =
&gt;&nbsp;=20
<BR>&gt; &gt; ....<BR>&gt; &gt; $map =3D =
ms_newMapObj("mapfile.map");<BR>&gt; &gt;=20
$image=3D$map-&gt;draw();<BR>&gt; &gt; $shapefile =3D=20
ms_newShapefileObj($HTTP_GET_VARS["layer"],-1);<BR>&gt; &gt; $shape =3D=20
$shapefile-&gt;getShape($HTTP_GET_VARS["ShapeIndex"]);<BR>&gt; =
&gt;&nbsp;=20
<BR>&gt; &gt; //feature extension<BR>&gt; &gt; $ShapeIndex =3D=20
$HTTP_GET_VARS["ShapeIndex"];<BR>&gt; &gt; $shapeExt =3D=20
$shapefile-&gt;getExtent($ShapeIndex);<BR>&gt; &gt; $minx =3D=20
$shapeExt-&gt;minx;<BR>&gt; &gt; $miny =3D $shapeExt-&gt;miny;<BR>&gt; =
&gt; $maxx=20
=3D $shapeExt-&gt;maxx;<BR>&gt; &gt; $maxy =3D =
$shapeExt-&gt;maxy;<BR>&gt; &gt;=20
....<BR>&gt; &gt;&nbsp; <BR>&gt; &gt; I passed layer and shapeindex by a =
form=20
and retrieved them with <BR>&gt; &gt; HTTP_GET_VARS.<BR>&gt; &gt; I =
located=20
shapefile in "shape" folder (as saved in mapfile.map) but I <BR>&gt; =
&gt; also=20
tried<BR>&gt; &gt; copying shapefile in the same directory of =
bound.php.<BR>&gt;=20
&gt;&nbsp; <BR>&gt; &gt; The error is:<BR>&gt; &gt;=20
*****************************<BR>&gt; &gt; Warning: [MapServer Error]:=20
msSHPOpenFile(): (CAT_VETT) in <BR>&gt; &gt; =
c:\inetpub\wwwroot\gall\bound.php=20
on line 16<BR>&gt; &gt;&nbsp; <BR>&gt; &gt; Fatal error: Failed to open=20
shapefile CAT_VETT in <BR>&gt; &gt; c:\inetpub\wwwroot\gall\bound.php on =
line=20
16<BR>&gt; &gt; *****************************<BR>&gt; &gt; CAT_VETT is =
the right=20
name of shapefile, line 16 is:<BR>&gt; &gt;&nbsp; <BR>&gt; &gt; =
$shapefile =3D=20
ms_newShapefileObj($HTTP_GET_VARS["layer"],-1);<BR>&gt; &gt;&nbsp; =
<BR>&gt; &gt;=20
All this works fine changing reference to PHP_MAPSCRIPT_36.dll instead =
<BR>&gt;=20
&gt; of PHP_MAPSCRIPT_4.0.1.dll.<BR>&gt; &gt;&nbsp; <BR>&gt; &gt; Any =
help=20
appreciated<BR>&gt; &gt; Thanks<BR>&gt; &gt;&nbsp; <BR>&gt; &gt; Valerio =

Noti<BR>&gt; <BR>&gt; <BR>&gt; </FONT></BODY></HTML>

------=_NextPart_000_0063_01C3A912.95483A30--




More information about the mapserver-users mailing list