[gdal-dev] Question on using SetFID
Even Rouault
even.rouault at spatialys.com
Wed Feb 17 02:07:54 PST 2016
Le mercredi 17 février 2016 08:33:02, Gane R a écrit :
> Hi all,
>
> I am creating a layer for geopackage, But I don't see the fid I set using
> setFID here is my code flow.
>
> Step1:
> poLayer = OGRDataSource::CreateLayer(....);
>
> Step2:
> adding all the fields
>
> Step3:
> poFeature = OGRFeature::CreateFeature( poLayer->GetLayerDefn() );
>
> then
> Step 4:
> poFeature->SetFID(100);
> setting to a layer using
> poLayer->CreateFeature( poFeature )
>
> Step 5:
>
> OGRFeature::DestroyFeature( poFeature );
> then destroying the poFeature,
> again creating the feature using Step 3:
>
> Every thing is fine but the feature id is set to start from 1, but I was
> expecting
> as 100 for the code flow above,
>
> did I miss some GDAL API call ?.
Do you use GDAL 2.0 or above ? The GPKG driver only takes into account user-
set FID in CreateFeature() starting with GDAL 2.0
>
> Thanks
> Gane
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the gdal-dev
mailing list