[Mapserver-users] Read all fields of dbf file when querying
Vincent Schut
schut at sarvision.com
Thu Aug 7 07:53:39 PDT 2003
Stefan,
I think php has dbf support built in or as an extension. See
http://nl2.php.net/manual/en/ref.dbase.php . So using this and mapscript you
should be able to tackle the problem, I think.
Cheers,
Vincent.
On Thursday 07 August 2003 16:07, Stefan Schwarzer wrote:
> Thanks Daniel,
>
> but unfortunately I do not know the names of the fields, so that I can't
> access the fields like "$population = $shape->values["Population"];", but
> rather I should retrieve the results by using the column-number [0, 1, 2,
> ....]. But this does not work. Any further suggestion?
>
> Stefan
>
> >Stefan Schwarzer wrote:
> >>can anyone give me a hint/an example on how can I read with mapscript/PHP
> >>*all fields* in the dbf-part of a shapefile? For a couple of layers I
> >>would like to display upon a query request all fields - and not those
> >>predefined in the METADATA tag.
> >
> >When you read query results using $layer->getShape(), the shapeObj
> >contains an array member called 'values' that contains all the field
> >values for this shape. See the shapeObj docs at
> >http://mapserver.gis.umn.edu/doc40/phpmapscript-class-guide.html#ShapeObj
> >
> >--
> >------------------------------------------------------------
> > Daniel Morissette morissette at dmsolutions.ca
> > DM Solutions Group http://www.dmsolutions.ca/
> >------------------------------------------------------------
>
> _______________________________________
>
> Stefan Schwarzer
> Consultant on GEO
>
> UNEP/DEWA/GRID-Geneva
> Chemin des Anemones 11
> CH - 1219 Chatelaine
> Switzerland
>
> Tel: (+41) 22.917.83.49
> Fax: (+41) 22.917.80.29
>
> Email: stefan.schwarzer at grid.unep.ch
> Internet: http://geodata.grid.unep.ch/
> _______________________________________
--
______________________________________
Vincent Schut
Sarvision B.V.
Wageningen, The Netherlands
www.sarvision.com
More information about the MapServer-users
mailing list