Re: [gdal-dev] Where to find a FlatGeobuf test file?

2024-12-06 Thread Even Rouault via gdal-dev
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(o

Re: [gdal-dev] Where to find a FlatGeobuf test file?

2024-12-06 Thread Rahkonen Jukka via gdal-dev
Hi, All right, TestCapability(ogr.OLCFastSpatialFilter) is the answer gdal - How to check if FlatGeobuf layer has a spatial index? - Geographic Information Systems Stack Exchange. -Jukka Rahkon

Re: [gdal-dev] Where to find a FlatGeobuf test file?

2024-12-06 Thread Rahkonen Jukka via gdal-dev
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

Re: [gdal-dev] Where to find a FlatGeobuf test file?

2024-12-06 Thread Even Rouault via gdal-dev
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.spati

Re: [gdal-dev] Where to find a FlatGeobuf test file?

2024-12-06 Thread Rahkonen Jukka via gdal-dev
Next question: Why this gives true for me? Create test data ogr2ogr -f flatgeobuf test.fgb -lco SPATIAL_INDEX=NO kiinteistorekisterikartta.gpkg PalstanSijaintitiedot Python: from osgeo import ogr fgb_ds = ogr.Open("test.fgb") fgb_lyr = fgb_ds.GetLayer(0) fgb_lyr.TestCapability(ogr.OLCFastGetEx