[mapserver-users] Reading shapefile's attributes

Pedro Arriondo pedroaa10 at gmail.com
Wed Apr 21 07:35:59 EDT 2010


First, thanks Josh for your answer.
I tell you that the the file it's good, because i use it in my job with
Mapserver.
Too i can access to attributes with library dbase from PHP.
(dbase_open,...dbase_get_record_with_names,...)
So.... i don't know how to continue....


2010/4/20 Joshua Hevenor <jhevenor at rogers.com>

> You can check that the shapefile has attributes using the command line tool
> ogrinfo.   http://www.gdal.org/ogrinfo.html
> You can check on spelling of fields, etc. It might as least get you
> started.
>
> Cheers,
> Josh
>
> ------------------------------
> *From:* Pedro Arriondo <pedroaa10 at gmail.com>
> *To:* mapserver-users at lists.osgeo.org
> *Sent:* Tue, April 20, 2010 2:36:15 PM
> *Subject:* [mapserver-users] Reading shapefile's attributes
>
> Hi friends, i writte from Argentina.
>
> I'd like read attributes from a shapefile but i get "nothing", however i
> can read very good the geometries.
> My code:
>
> $shpFile = ms_newShapeFileObj( $_SERVER["DOCUMENT_ROOT"]."/zonas", -1);
> //my shapefile in disc
> echo $shpFile->numshapes; //8 -> it's right!!
>
> $oShape = $shpFile->getShape(0); //get first object
>
> //..but....:
> echo $oShape->numvalues; //0, however it has 2 values: "CODIGO" and
> "NOMBRE"
> echo $oShape->values["CODIGO"]; //Here get empty (value is 4)
>
>
>  Thanks in advance!!!!.
>
> Pedro.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100421/0547c900/attachment.html


More information about the mapserver-users mailing list