[gdal-dev] Question on using SetFID
Gane R
gane.prog at gmail.com
Wed Feb 17 02:38:08 PST 2016
I am using gdal-1.11.3
I see the nFID have the value at debug when the
poFeature->setFID(100);
is called.
then poLayer->CreateFeature( poFeature ) is called.
Thanks
Gane
On Wed, Feb 17, 2016 at 3:37 PM, Even Rouault <even.rouault at spatialys.com>
wrote:
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160217/16e73362/attachment.html>
More information about the gdal-dev
mailing list