<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
17.02.2016, 09:33, Gane R kirjoitti:<br>
<blockquote
cite="mid:CALMrLdCpOsjOPrwxqrKLb0f2JAh86HNLPW5rTWUHJwnZ9M1Nyw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>Hi all,<br>
<br>
</div>
I am creating a layer for geopackage, But I don't see the
fid I set using 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>
</div>
<div><br>
</div>
then<br>
Step 4:<br>
poFeature->SetFID(100);<br>
setting to a layer using <br>
poLayer->CreateFeature( poFeature )<br>
<br>
</div>
<div>Step 5:<br>
<br>
OGRFeature::DestroyFeature( poFeature );<br>
</div>
<div>then destroying the poFeature, <br>
again creating the feature using Step 3:<br>
<br>
</div>
<div>Every thing is fine but the feature id is set to start from
1, but I was expecting<br>
</div>
<div>as 100 for the code flow above,<br>
</div>
</div>
</blockquote>
<br>
Please post the whole code. I did a small test using the Perl
bindings and code, which should be similar<br>
<br>
my $ds = Geo::OGR::Driver('GPKG')->Create('test.db');<br>
my $l = $ds->CreateLayer(GeometryType => 'Point');<br>
my $f = Geo::OGR::Feature->new($l->Schema);<br>
$f->Geometry({WKT => 'POINT (1 2)'});<br>
$f->FID(2);<br>
$l->CreateFeature($f);<br>
<br>
and the result is a small database with one spatial table, which has
two columns: fid and geom, and one row. The fid is 2 on the row.<br>
<br>
Ari<br>
<br>
<br>
<blockquote
cite="mid:CALMrLdCpOsjOPrwxqrKLb0f2JAh86HNLPW5rTWUHJwnZ9M1Nyw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<div>did I miss some GDAL API call ?.<br>
<br>
</div>
<div>Thanks<br>
</div>
<div>Gane<br>
</div>
<div><br>
<br>
<br>
<br>
<br>
<br>
<div><br>
<br>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></pre>
</blockquote>
<br>
</body>
</html>