[Mapserver-users] error in open() with php/mapscript

Stephan Holl sholl at gmx.net
Tue May 6 22:28:52 PDT 2003


--=.7ihRQ)zskL3ZbP
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Dear mapserver-gurus,
I cannot make the singel-point-query with php/mapscript working in
gmap-demo and in my app.
The following error results:
Warning: Wrong parameter count for open() in /var/www/php/function.inc
on line 325
Fatal error: MapServer Error in msLayerGetShape(): Shapefile layer has
not been opened. in /var/www/php/function.inc on line 356

The query-code:
<code>
// Open layer's table... take the list of fields to display from 
// the "HEADERRESULT_FIELDS" metadata in the layer object.
$oLayer->open($map->shapepath);  // line 325


$selFields = explode(" ", $oLayer->getMetaData("RESULT_FIELDS"));

printf("<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH=100%%>\n");
printf("<TR>\n");
printf("<TD COLSPAN=%d BGCOLOR=#C1D8E3>", sizeof($selFields));
printf("<CENTER> %s </CENTER>", $oLayer->getMetaData("DESCRIPTION"));
printf("</TR>\n");

//
// Table header: attribute names...
//
printf("<TR>\n");	
for ($iField=0; $iField < sizeof($selFields); $iField++)
{
    printf("<TD BGCOLOR=#E2EFF5>");
    printf("%s",$selFields[$iField]);
    printf("</TD>");
}
printf("</TR>\n");	

//
// One row in table for each selected record
//

for ($iRes=0; $iRes < $numResults; $iRes++)
{
    $oRes = $oLayer->getResult($iRes);

    $oShape = $oLayer->getShape($oRes->tileindex,$oRes->shapeindex);  //
line 356

    printf("<TR>\n");	
</code>

Perhaps anybody could give me a hint how to solve this problem.
My system:
MapServer version 3.7 (development) OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=PDF SUPPORTS=PROJ SUPPORTS=TTF SUPPORTS=WMS_SERVER
SUPPORTS=WFS_SERVER SUPPORTS=GD2_RGB INPUT=EPPL7 INPUT=JPEG
INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

PHP MapScript Version
($Revision: 1.149 $ $Date: 2003/03/14 13:43:03 $)

php4.3.1

Thanks for your help
 Stephan Holl

-- 
Stephan Holl

GnuPG Key-ID: 11946A09 

--=.7ihRQ)zskL3ZbP
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+uJmWEg9SKhGUagkRAlDcAJ942HVkOdoBgn9AWYPgjFRhKGtOxwCeIACB
jSVVi17B2fKJcZSa1RSe4cM=
=g1Ev
-----END PGP SIGNATURE-----

--=.7ihRQ)zskL3ZbP--



More information about the MapServer-users mailing list