<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Jukka,</p>
<p>I'm not sure how poly_no_index.fgb was generated. Perhaps no with
OGR or perhaps with an earlier version that didn't write the layer
extent in the FlatGeobuf header. The extent is optional, and this
file doesn't have one.</p>
<p>To test the presence of the spatial index use
TestCapability(ogr.OLCFastSpatialFilter)</p>
<p>$ python3 -c "from osgeo import ogr; ogr.UseExceptions(); ds =
ogr.Open('autotest/ogr/data/testfgb/poly_no_index.fgb'); lyr =
ds.GetLayer(0);
print(lyr.TestCapability(ogr.OLCFastSpatialFilter))"<br>
False</p>
<p>$ python3 -c "from osgeo import ogr; ogr.UseExceptions(); ds =
ogr.Open('autotest/ogr/data/testfgb/poly.fgb'); lyr =
ds.GetLayer(0);
print(lyr.TestCapability(ogr.OLCFastSpatialFilter))"<br>
True<br>
<br>
</p>
<div class="moz-cite-prefix">Le 06/12/2024 à 14:12, Rahkonen Jukka a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:DB9PR09MB6887F77BC9F9781176C72C3AFD312@DB9PR09MB6887.eurprd09.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;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
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;}pre
{mso-style-priority:99;
mso-style-link:"HTML-esimuotoiltu Char";
margin:0cm;
font-size:10.0pt;
font-family:"Courier New";}span.HTML-esimuotoiltuChar
{mso-style-name:"HTML-esimuotoiltu Char";
mso-style-priority:99;
mso-style-link:HTML-esimuotoiltu;
font-family:Consolas;
mso-fareast-language:EN-US;}span.Shkpostityyli22
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}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">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">Has there been a change
in writing the layer extent?
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I thought that the test
<a
href="https://github.com/OSGeo/gdal/blob/e4d1f7ff474ceeffd69b1ceef3fa635428788e8c/autotest/ogr/ogr_flatgeobuf.py#L182"
moz-do-not-send="true" class="moz-txt-link-freetext">
https://github.com/OSGeo/gdal/blob/e4d1f7ff474ceeffd69b1ceef3fa635428788e8c/autotest/ogr/ogr_flatgeobuf.py#L182</a>
is testing with TestCapability(ogr.OLCFastGetExtent) if
spatial index exists. At least the test file
data/testfgb/poly_no_index.fgb shows false for this
capability.<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">I am not really
interested in the layer extent, what I want to know is how
can I check if an existing FlatGeobuf file has spatial index
or not.
<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">-Jukka-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div
style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span
style="mso-fareast-language:FI">Lähettäjä:</span></b><span
style="mso-fareast-language:FI"> Even Rouault
<a class="moz-txt-link-rfc2396E" href="mailto:even.rouault@spatialys.com"><even.rouault@spatialys.com></a>
<br>
<b>Lähetetty:</b> perjantai 6. joulukuuta 2024 12.37<br>
<b>Vastaanottaja:</b> Rahkonen Jukka
<a class="moz-txt-link-rfc2396E" href="mailto:jukka.rahkonen@maanmittauslaitos.fi"><jukka.rahkonen@maanmittauslaitos.fi></a>;
'<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>' (<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>)
<a class="moz-txt-link-rfc2396E" href="mailto:gdal-dev@lists.osgeo.org"><gdal-dev@lists.osgeo.org></a><br>
<b>Aihe:</b> Re: [gdal-dev] Where to find a FlatGeobuf
test file?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Hi Jukka,<o:p></o:p></p>
<div>
<p class="MsoNormal">Le 06/12/2024 à 11:13, Rahkonen Jukka a
écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US">Next question: Why
this gives true for me?</span><o:p></o:p></p>
</blockquote>
<p>OLCFastGetExtent != OLCFastSpatialFilter<o:p></o:p></p>
<p>The layer extent is written in the FlatGeoBuf layer even in
the SPATIAL_INDEX=NO case, so retrieving the extent is fast.<o:p></o:p></p>
<p>Even<o:p></o:p></p>
<p><o:p> </o:p></p>
<pre>-- <o:p></o:p></pre>
<pre><a href="http://www.spatialys.com/" moz-do-not-send="true"
class="moz-txt-link-freetext">http://www.spatialys.com</a><o:p></o:p></pre>
<pre>My software is free, but my time generally not.<o:p></o:p></pre>
<pre>Butcher of all kinds of standards, open or closed formats. At the end, this is just about bytes.<o:p></o:p></pre>
</div>
</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.
Butcher of all kinds of standards, open or closed formats. At the end, this is just about bytes.</pre>
</body>
</html>