<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>After posting about my experimental format I realized that I lack numbers on the potential performance, so I tried to make some more or less scientific measuring. The results was disappointing, reaching similar performance as shapefile for full sequential reads and so I lost interest for a while. But recently I found out that my method of measuring was flawed - I measured the time to read into a new shapefile using ogr2ogr, but it turns out that can be quite unfair due to the string field length dynamic resize that ogr2ogr will do if the strings from input feature attributes are of variable length. I've now made some new measurements using ogrinfo and the undocumented flag -qq to get a full sequential read.</div><div><br></div><div>I've used the shapefiles "gis_osm_buildings_a_free_1" (exploded to single poly) and "gis_osm_roads_free_1" from Denmark at <a href="http://download.geofabrik.de/europe.html">http://download.geofabrik.de/europe.html</a> as the source, converted to respective format, then measured the time it takes to run ogrinfo -qq on them. Results (average over three runs):</div><div><br></div><div>## gis_osm_buildings_a_free_1 (2027890 Polygons)</div><div>* SHP: 3800 ms</div><div>* GPKG: 2700 ms</div><div>* FlatGeobuf: 2200 ms</div><div><div><br></div><div>## gis_osm_roads_free_1 (812547 LineStrings)</div><div>* SHP: 1600 ms</div><div>* GPKG: 1350 ms</div><div>* FlatGeobuf: 800 ms</div></div><div><br></div><div>With that my hope and interest is rekindled. I believe I can fare even better against the competition with with spatially filtered searches, will hopefully soon have some results on that too.</div><div><br></div><div>/Björn</div><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr">Den sön 9 dec. 2018 kl 20:36 skrev Björn Harrtell <<a href="mailto:bjorn.harrtell@gmail.com" target="_blank">bjorn.harrtell@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi GDAL/OGR folks,</div><div><br></div><div>In my spare time I've been working on a vector file format called FlatGeobuf (tentatively). The main reason, besides curiosity and learning, I'm putting time into it is that I think shapefile still rules the read/query static data performance game, which is kind of sad, and probably one of the reasons it is still so widely popular. Also, the main competitor (GeoPackage) isn't suitable for streaming access (AFAIK) which shapefiles also handles surprisingly (?) well.</div><div><br></div><div>By using a performance focused write once binary encoding (flatbuffers), schema constraint and focusing on read/query performance by clustering on an optimal spatial index (Packed Hilbert R-Tree) I hope to be able to beat shapefile performance and at the same time be optimal for streaming/cloud access.</div><div><br></div><div>I think I'm starting to get somewhere, more details and source is at <a href="https://github.com/bjornharrtell/flatgeobuf" target="_blank">https://github.com/bjornharrtell/flatgeobuf</a> and I have an early proof of concept driver implementation at <a href="https://github.com/bjornharrtell/gdal/tree/flatgeobuf" target="_blank">https://github.com/bjornharrtell/gdal/tree/flatgeobuf</a> and results are already quite promising - it can do roundtrip read/write and is already quite a bit faster than shapefile. I also have implemented naive read only QGIS provider for experimental purposes.</div><div><br></div><div>Basically I'm fishing for interest in this effort, hoping that others will see potential in it even if it's "yet another format" and far from final/stable yet. Any feedback is welcome. As I see it, GDAL is a good place for a format specification and reference implementation to incubate.<br></div><div><br></div><div>Some additional food for thought that I've had during the experimentation:</div><div><br></div><div>1. The main in memory representations of geometry/coordinates seem to be either separate arrays per dimension (GDAL (partially?) and QGIS) or a single array with dimension as stride. I've chosen the latter as of yet but I'm still a bit undecided. There is of course a substantial involved in transforming between the two representations so the situation with two competing models is a bit unfortunate. I'm also not sure about which of these models are objectively "better" than the other?</div><div><br></div><div>2. One could get better space efficiency with protobuf instead of flatbuffers, but it has a performance cost. I have not gone far into investigating how much though and one could even reason about supporting both these encodings in a single format specification but it's taking it a bit far I think.</div><div><br></div><div>3. Is there a reason to support different packing strategies for the R-Tree or is Packed Hilbert a good compromise (besides it being beautifully simple to implement)?</div><div><br></div><div>4. FlatGeobuf is perhaps a too technical name, not catchy enough and has a bad/boring abbreviation. Other candidates I've considered are OpenGeoFile, OpenVectorFile or OpenSpatialFile but I'm undecided. Any ideas? :)</div><div><br></div><div>Regards,<br><br>Björn Harrtell</div></div>
</blockquote></div></div>
</div></div></div></div></div></div></div></div></div>