Obtaining attribute names

Jacob Delfos jacob.delfos at MAUNSELL.COM
Sun Oct 2 15:45:42 PDT 2005


Erik,

They are stored in an associative array. This is what I do to obtain attribute names:

-----------------------------------------------------------------------------------------------------------------------------
         $tmpshp = $oLayer->getShape(-1, 0);
         $fieldnames =  array_keys ($tmpshp->values);

            for ($w=0; $w < count($fieldnames); $w++)           
            {
            print array $fieldnames[$w];
            }
-----------------------------------------------------------------------------------------------------------------------------

regards,

Jacob


» -----Original Message-----
» From: UMN MapServer Users List 
» [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Erik Konijnenburg
» Sent: 2 October 2005 03:39
» To: MAPSERVER-USERS at LISTS.UMN.EDU
» Subject: [UMN_MAPSERVER-USERS] Obtaining attribute names
» 
» Is it possible to obtain the attribute names from a shapeObj 
» returned by
» the layer->getShape. I am able to obtain the attribute values 
» but I want
» the attribute names. Is there a solution?
» 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20051003/9ee647ad/attachment.htm>


More information about the MapServer-users mailing list