<div dir="ltr"><div><div><div><div><div>I am using gdal-1.11.3 <br><br></div>I see the nFID have the value at debug when the <br>poFeature->setFID(100);<br></div>is called.<br></div>then poLayer->CreateFeature( poFeature ) is called.<br><br></div>Thanks<br></div>Gane<br><div><div><div><br><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 17, 2016 at 3:37 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Le mercredi 17 février 2016 08:33:02, Gane R a écrit :<br>
> Hi all,<br>
><br>
> I am creating a layer for geopackage, But I don't see the fid I set using<br>
> setFID here is my code flow.<br>
><br>
> Step1:<br>
> poLayer = OGRDataSource::CreateLayer(....);<br>
><br>
> Step2:<br>
> adding all the fields<br>
><br>
> Step3:<br>
> poFeature = OGRFeature::CreateFeature( poLayer->GetLayerDefn() );<br>
><br>
> then<br>
> Step 4:<br>
> poFeature->SetFID(100);<br>
>  setting to a layer using<br>
>  poLayer->CreateFeature( poFeature )<br>
><br>
> Step 5:<br>
><br>
> OGRFeature::DestroyFeature( poFeature );<br>
> then destroying the poFeature,<br>
> again creating the feature using Step 3:<br>
><br>
> Every thing is fine but the feature id is set to start from 1, but I was<br>
> expecting<br>
> as 100 for the code flow above,<br>
><br>
> did I miss some GDAL API call ?.<br>
<br>
</span>Do you use GDAL 2.0 or above ? The GPKG driver only takes into account user-<br>
set FID in CreateFeature() starting with GDAL 2.0<br>
<br>
><br>
> Thanks<br>
> Gane<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
</font></span></blockquote></div><br></div>