Jukka,
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.
To test the presence of the spatial index use
TestCapability(ogr.OLCFastSpatialFilter)
$ 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))"
False
$ 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))"
True
Le 06/12/2024 à 14:12, Rahkonen Jukka a écrit :
Hi,
Has there been a change in writing the layer extent?
I thought that the test
https://github.com/OSGeo/gdal/blob/e4d1f7ff474ceeffd69b1ceef3fa635428788e8c/autotest/ogr/ogr_flatgeobuf.py#L182
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.
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.
-Jukka-
*Lähettäjä:*Even Rouault <even.roua...@spatialys.com>
*Lähetetty:* perjantai 6. joulukuuta 2024 12.37
*Vastaanottaja:* Rahkonen Jukka <jukka.rahko...@maanmittauslaitos.fi>;
'gdal-dev@lists.osgeo.org' (gdal-dev@lists.osgeo.org)
<gdal-dev@lists.osgeo.org>
*Aihe:* Re: [gdal-dev] Where to find a FlatGeobuf test file?
Hi Jukka,
Le 06/12/2024 à 11:13, Rahkonen Jukka a écrit :
Next question: Why this gives true for me?
OLCFastGetExtent != OLCFastSpatialFilter
The layer extent is written in the FlatGeoBuf layer even in the
SPATIAL_INDEX=NO case, so retrieving the extent is fast.
Even
--
http://www.spatialys.com
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.
--
http://www.spatialys.com
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.
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev