<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Abel,</p>
<p>At the minimum for the reading side of a vector driver, you need
to implement GetNextFeature().</p>
<p>If there is an efficient way of knowing the number of features
without iterating over the whole file (typically a field in a
header giving that number), you may implement GetFeatureCount().
If you don't implement it, and code using your driver needs the
feature count, the generic implementation of
OGRLayer::GetFeatureCount() will call GetNextFeature() repeatdly
until it returns NULL.</p>
<p>Not totally sure to understand your question about multielements.
If you have an instance of OGRGeometryCollection or any deriving
class, there's a getNumGeometries() method to get the number of
parts</p>
<p>Even<br>
</p>
<div class="moz-cite-prefix">Le 07/07/2023 à 11:33, Abel Pau a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:AS8PR07MB8168B3DB9A4C742DB424EAC6A22DA@AS8PR07MB8168.eurprd07.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}span.EstiloCorreo17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I would like to know if
when we use the code of GDAL to program a driver (or
whatever) in vectors (so, ogr) we can assume that we can
know the number of elements we are going to import in any
way or it would be possible not knowing that until
NextFeature is empty (or something like that). So, there is
any way to obtain this number of elements without doing a
while? And in case of multielements its possible to know how
many parts are there in total?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I need that to write my
format (I don’t explain the details cause I don’t get you
bored :) )<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">If anyone know that I’d
appreciate an answer. Thanks in advance.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Abel.<o:p></o:p></span></p>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-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="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>