Stacy,<br><br>This should help: <a href="http://trac.osgeo.org/gdal/browser/trunk/autotest/ogr/ogr_shape.py#L1384">http://trac.osgeo.org/gdal/browser/trunk/autotest/ogr/ogr_shape.py#L1384</a><br><br><div class="gmail_quote">
On Fri, Feb 26, 2010 at 8:25 AM, Livingstone <span dir="ltr"><<a href="mailto:stakk_man@hotmail.com">stakk_man@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Hi,<br>
<br>
I'm using Python to do some work with shape files, with GDAL/OGR, although I<br>
am not particularly experienced in GIS programming (so I apologise for any<br>
incorrect terminology, etc.). What I need to do is retrieve the list of<br>
field names in the shape file; fields can be queried by name or row number,<br>
surely the field names can be listed? (Then I can query the field given that<br>
I know the field name)...<br>
<br>
I have searched the documentation quite thoroughly with no luck.. Perhaps my<br>
terminology is incorrect? Using QGIS to bring up the attribute table shows<br>
(for example):<br>
ID Street_Add Road_Locat Title<br>
1 143 1 Lake Place Ilam Smith, C. J.<br>
2 144 3 Tower Road Riccarton Townshend, P.<br>
3 145 7 Lake Place Ilam Morrison, J.<br>
4 146 9 Harper Court Ilam Doe, J.<br>
5 147 11 Tower Road South Ricc Black, F.<br>
<br>
I need to find what field names are available; e.g. ID, Street_Add,<br>
Road_Locat, Title...<br>
<br>
Thanks in advance,<br>
Stacy<br>
<font color="#888888">--<br>
View this message in context: <a href="http://n2.nabble.com/Querying-Field-Names-tp4636867p4636867.html" target="_blank">http://n2.nabble.com/Querying-Field-Names-tp4636867p4636867.html</a><br>
Sent from the GDAL - Dev mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br>/tʃaɪθənjə/ /kʊmɑr/ <br>+91-9848167848<br>17.241582N 80.142635E<br>