[Mapserver-users] Mapscript problem with MS401
Daniel Morissette
morissette at dmsolutions.ca
Tue Nov 11 11:00:57 PST 2003
One difference between V3.6 and 4.0 is the way relative paths are
handled. Is the CAT_VETT.shp in the same directory as the mapfile?
Perhaps try using an absolute path in the call to ms_newShapefileObj()
and see if that makes a difference.
Daniel
Valerio Noti wrote:
> 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 = ms_newMapObj("mapfile.map");
> $image=$map->draw();
> $shapefile = ms_newShapefileObj($HTTP_GET_VARS["layer"],-1);
> $shape = $shapefile->getShape($HTTP_GET_VARS["ShapeIndex"]);
>
> //feature extension
> $ShapeIndex = $HTTP_GET_VARS["ShapeIndex"];
> $shapeExt = $shapefile->getExtent($ShapeIndex);
> $minx = $shapeExt->minx;
> $miny = $shapeExt->miny;
> $maxx = $shapeExt->maxx;
> $maxy = $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 = 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
More information about the MapServer-users
mailing list