[gdal-dev] Getting field values after obtaining FID

Even Rouault even.rouault at mines-paris.org
Mon Oct 31 09:11:28 EDT 2011


Selon ahmet temiz <ahmettemiz88 at gmail.com>:

> hello
>
> Using the gdal.jar,
> I am confused about getting other field values after obtaining FID.
>
> I got ly2.GetFeature(fid)) but when I used
> ly2.GetNextFeature().GetFieldAsString("koy"),
> I got exception.

Which exception ? Please be precise when you report issues.

>
> What is the way to get other field values after getting fid value of a
> particular record ?

If you call GetNextFeature(), you will get the next feature...

What you want is to store a reference to the feature you are interested in and
do several queries on it :

Feature feat = ly2.GetFeature(fid):
String val = feat.GetFieldAsString("koy");

>
> regards
>
> --
> Ahmet Temiz
> Jeoloji Müh.
> Afet ve Acil Durum Yönetimi Baþkanlýðý
> Planlama ve Zarar Azaltma Dairesi Baþkanlýðý
> Bilgi ve CBS grubu
> Eskiþehir Yolu 10. km.
> Lodumlu / Ankara
> Tel : 0 312 2872680 / 1535
> ________________________
>
> Ahmet Temiz
> Geological Eng.
> Information Systems - GIS Group
> Disaster and Emergency Management
> of Presidency
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>




More information about the gdal-dev mailing list