[gdal-dev] Where to find a FlatGeobuf test file?
Even Rouault
even.rouault at spatialys.com
Fri Dec 6 05:24:35 PST 2024
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.rouault at spatialys.com>
> *Lähetetty:* perjantai 6. joulukuuta 2024 12.37
> *Vastaanottaja:* Rahkonen Jukka <jukka.rahkonen at maanmittauslaitos.fi>;
> 'gdal-dev at lists.osgeo.org' (gdal-dev at lists.osgeo.org)
> <gdal-dev at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20241206/5a3af751/attachment.htm>
More information about the gdal-dev
mailing list