[gdal-dev] Querying Field Names

Livingstone stakk_man at hotmail.com
Thu Feb 25 21:55:31 EST 2010


Hi,

I'm using Python to do some work with shape files, with GDAL/OGR, although I
am not particularly experienced in GIS programming (so I apologise for any
incorrect terminology, etc.). What I need to do is retrieve the list of
field names in the shape file; fields can be queried by name or row number,
surely the field names can be listed? (Then I can query the field given that
I know the field name)...

I have searched the documentation quite thoroughly with no luck.. Perhaps my
terminology is incorrect? Using QGIS to bring up the attribute table shows
(for example):
       ID    Street_Add           Road_Locat         Title
1    143   1 Lake Place          Ilam                   Smith, C. J.
2    144   3 Tower Road         Riccarton           Townshend, P.
3    145   7 Lake Place          Ilam                   Morrison, J.
4    146   9 Harper Court       Ilam                   Doe, J.
5    147   11 Tower Road      South Ricc           Black, F.

I need to find what field names are available; e.g. ID, Street_Add,
Road_Locat, Title...

Thanks in advance,
Stacy
-- 
View this message in context: http://n2.nabble.com/Querying-Field-Names-tp4636867p4636867.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list