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

Stepan Kafka stepan.kafka@centrum.cz
Wed, 7 May 2003 12:17:59 +0200


Stephan,
  in version 3.7 the syntax of layer->open() has changed. Now it is called
without any parameters. See mapscript documentation.

Stepan Kafka

> -----Původní zpráva-----
> Od: mapserver-users-admin@lists.gis.umn.edu
> [mailto:mapserver-users-admin@lists.gis.umn.edu]za uživatele Stephan
> Holl
> Odesláno: 7. května 2003 7:29
> Komu: mapserver-users
> Předmět: [Mapserver-users] error in open() with php/mapscript
>
>
> 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
>
---
Odchozí zpráva neobsahuje viry.
Zkontrolováno antivirovým systémem AVG (http://www.grisoft.cz).
Verze: 6.0.474 / Virová báze: 272 - datum vydání: 18.4.2003

_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users