[Mapserver-users] Mapscript problem with MS401
Valerio Noti
noti at ciaoweb.it
Wed Nov 12 02:46:17 PST 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 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> </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> CLASS<BR> COLOR 110 50=20
100<BR> OUTLINECOLOR 200 200 =
200<BR> 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> </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> </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> </DIV>
<DIV><FONT face=3DArial size=3D2>Thank you very much</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Valerio Noti</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> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>----- Original Message ----- </FONT>
<DIV><FONT face=3DArial size=3D2>From: "Daniel Morissette" <</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>></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>To: "Valerio Noti" <</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>></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Cc: <</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>></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>> One difference between V3.6 and 4.0 is the way relative =
paths are=20
<BR>> handled. Is the CAT_VETT.shp in the same directory as the =
mapfile? <BR>> Perhaps try using an absolute path in the call to=20
ms_newShapefileObj() <BR>> and see if that makes a =
difference.<BR>>=20
<BR>> Daniel<BR>> <BR>> Valerio Noti wrote:<BR>> > =
Hello,<BR>>=20
> <BR>> > I've upgraded mapscript version from 366 to 401 =
downloaded from DMsolutions.<BR>> > My old application seems to =
work well=20
without applying changes to <BR>> > mapfile or code.<BR>> > =
However=20
I got an error when I try to get the feature extent of a <BR>> > =
selected=20
object.<BR>> > <BR>> > Code of bound.php:<BR>> =
> =20
<BR>> > ....<BR>> > $map =3D =
ms_newMapObj("mapfile.map");<BR>> >=20
$image=3D$map->draw();<BR>> > $shapefile =3D=20
ms_newShapefileObj($HTTP_GET_VARS["layer"],-1);<BR>> > $shape =3D=20
$shapefile->getShape($HTTP_GET_VARS["ShapeIndex"]);<BR>> =
> =20
<BR>> > //feature extension<BR>> > $ShapeIndex =3D=20
$HTTP_GET_VARS["ShapeIndex"];<BR>> > $shapeExt =3D=20
$shapefile->getExtent($ShapeIndex);<BR>> > $minx =3D=20
$shapeExt->minx;<BR>> > $miny =3D $shapeExt->miny;<BR>> =
> $maxx=20
=3D $shapeExt->maxx;<BR>> > $maxy =3D =
$shapeExt->maxy;<BR>> >=20
....<BR>> > <BR>> > I passed layer and shapeindex by a =
form=20
and retrieved them with <BR>> > HTTP_GET_VARS.<BR>> > I =
located=20
shapefile in "shape" folder (as saved in mapfile.map) but I <BR>> =
> also=20
tried<BR>> > copying shapefile in the same directory of =
bound.php.<BR>>=20
> <BR>> > The error is:<BR>> >=20
*****************************<BR>> > Warning: [MapServer Error]:=20
msSHPOpenFile(): (CAT_VETT) in <BR>> > =
c:\inetpub\wwwroot\gall\bound.php=20
on line 16<BR>> > <BR>> > Fatal error: Failed to open=20
shapefile CAT_VETT in <BR>> > c:\inetpub\wwwroot\gall\bound.php on =
line=20
16<BR>> > *****************************<BR>> > CAT_VETT is =
the right=20
name of shapefile, line 16 is:<BR>> > <BR>> > =
$shapefile =3D=20
ms_newShapefileObj($HTTP_GET_VARS["layer"],-1);<BR>> > =
<BR>> >=20
All this works fine changing reference to PHP_MAPSCRIPT_36.dll instead =
<BR>>=20
> of PHP_MAPSCRIPT_4.0.1.dll.<BR>> > <BR>> > Any =
help=20
appreciated<BR>> > Thanks<BR>> > <BR>> > Valerio =
Noti<BR>> <BR>> <BR>> </FONT></BODY></HTML>
------=_NextPart_000_0063_01C3A912.95483A30--
More information about the MapServer-users
mailing list