Repository navigation
Releases
0.14.4
This release changes the QGIS plugin and its plugin repository. The crates'
code is the same as in 0.14.3.
Changed
- The QGIS plugin's Plugins → GeoPackage Toolkit menu lists every
Processing algorithm, in the toolbox's groups. It listed only the four in
Inspect and repair, so the coverage algorithms and Export layer to
GeoPackage were only in the toolbox. When thegeopackage_rsmodule
does not load, the menu has no entries: no algorithm is registered then.
Fixed
- The QGIS plugin repository gave the plugin's
file_nameas the release
asset's name,gpkg_toolkit-0.14.3.zip. QGIS takes a plugin's id from
that name, up to its first dot, so it read the id asgpkg_toolkit-0. An
install from the repository then failed with "Could not store plugin to
the plugin directory", and an installed plugin was shown as available
only locally.file_nameis nowgpkg_toolkit.<version>.zip, as
plugins.qgis.org names it.
QGIS plugin 0.15.0
Changed
- The plugin has its own releases, separate from the crates'. Its version
continues from 0.14.4. - The Processing provider's name gives the plugin's version, such as
GeoPackage Toolkit 0.15.0. - The menu entries, algorithm help, parameter labels and messages are
rewritten for QGIS users. Check coverage samples (Requirement 21) is now
Find NaN and infinite values in coverages; its identifier,
checkcoveragesamples, is unchanged. Add GeoPackage layer (geopackage
crate) is now Add GeoPackage layer with this plugin. The data
provider's description is GeoPackage (GeoPackage Toolkit). In the report
of Repair spatial indexes, theactionfor a replaced trigger set is
rebuilt with 1.4 triggers. - The data provider says why it cannot open a source that names no layer:
the file has no layers or tables, or it has more than one and the source
must add|layername=<name>.
0.14.3
This release publishes the QGIS plugin through a plugin repository and
documents it in the book. The crates' code is the same as in 0.14.2.
Added
scripts/qgis_versions.pyreports QGIS 4 minor versions that the native
provider has no build for, with the matrix entries each needs: the release
tag, and the name and SHA-256 of OSGeo4W'sqgis-develarchive. A monthly
workflow,qgis-versions.yml, runs it and opens an issue for each.- A QGIS plugin repository,
https://urschrei.github.io/geopackage/qgis/plugins.xml,
from which QGIS installs and updates the GeoPackage Toolkit plugin. The
book's site serves it, andscripts/plugins_xml.pywrites it from the
newest release's plugin zip after each release. - The book has a guide to installing the QGIS plugin and adding a layer
through it, and a reference page for its algorithms and data provider. - The plugin has a
LICENSEfile, with both licence texts beside it in the
release zip, and an icon. Itsabouttext names the compiled parts it
holds and the platforms they are built for.
0.14.2
This release changes the QGIS plugin's native provider and its release
builds. The crates' code is the same as in 0.14.1.
Added
- The QGIS plugin ships the native provider for QGIS 4.0 on Windows. The
Windows builds for QGIS 4.0 and 4.2 link theqgis_core.libof OSGeo4W's
qgis-develpackage for the same release.
Changed
- The QGIS native provider keeps reader threads for each layer. Each holds a
read-only connection and the layer resolved on it, so a read no longer
starts a thread or resolves the layer again, which the crate'shandles
benchmark puts at 37 to 51 µs, more than a small read itself.
0.14.1
This release changes the QGIS plugin and the scripts that build it. The
crates' code is the same as in 0.14.0.
Added
scripts/dev_qgis_plugin.pybuildsgeopackage_rsand the native provider
into the repository's copy of the QGIS plugin, for a QGIS profile that
links to it. The plugin's startup message names the provider library it
loaded and the revision the script built each part from.
Fixed
- On Linux and macOS, the QGIS plugin's module and native provider link the
SQLite that QGIS has loaded, instead of a copy of their own. Two copies in
one process do not see each other's locks, and closing a file in one
releases the locks that the other holds on it. So the plugin could write to
a file while QGIS, through GDAL, was writing to it.scripts/host_sqlite.py
gives the settings for these builds and checks the result. The plugin's
Linux module now needs glibc 2.28, as the native provider does. - The QGIS plugin's version follows the workspace's: the 0.14.0 release
attached its plugin asgpkg_toolkit-0.13.0.zip.
scripts/package_qgis_plugin.pynow refuses a plugin version that differs
from the workspace's.
0.14.0
Added
-
curve::to_iso_wkbreturns a WKB body with every type code in ISO form, at
every nesting depth: a code that gives Z or M by a high-bit flag becomes
the ISO code for the same type and dimensions. Coordinates and byte order
are copied unchanged. -
Layer::repair_wkb_type_codesrewrites each geometry whose type codes use
the high-bit flags with ISO codes, keeping its coordinates and SRS id and
adding a header envelope, in one transaction. It returns how many it
rewrote, writes nothing when there is nothing to rewrite, and leaves a
geometry it cannot read alone. TheNonIsoWkbTypeCodefinding now names
it as the repair. -
Layer::repair_datetimesrewritesDATETIMEtext that only the lenient
parser reads, such as2017-08-01T00:00:00.0Z, in the GeoPackage form
YYYY-MM-DDTHH:MM:SS.SSSZ, when nothing is lost: a numeric UTC offset
becomesZfor the same instant, and a value with a sub-millisecond part
is left alone.validatereports such text as the new
NonStandardDateTimewarning, per table, naming that repair. -
gpkg repairalso runs both repairs: on every feature layer and, for
DATETIMEtext, on every attribute table, or on one named table. It
reports how many values each rewrote. -
geopackage-py, Python bindings built with PyO3 as abi3 wheels for CPython
3.9 and later, with SQLite vendored. They cover open and create, layer
schemas, streaming feature reads by bounding box,WHEREclause and column
projection (one reader thread and connection per read), batched inserts,
updates and deletes with ISO WKB geometry,validate, spatial index audit
and repair, the extension catalogue, SRS rows, and tiled gridded coverages
with value lookups, per-tile statistics and the Requirement 21 check. The
tests are pytest, run in CI on three OSes. -
qgis-plugin/gpkg_toolkit, a QGIS Processing plugin overgeopackage-py
with seven algorithms: validate, repair spatial indexes, list extensions,
sample a coverage at points, coverage tile statistics, the Requirement 21
check, and layer export. It supports QGIS 3.28 to 4.x. Its tests run
headless in CI.scripts/package_qgis_plugin.pyand theqgis-plugin
workflow build one zip with the native module for each platform. -
The QGIS plugin registers a vector data provider,
geopackage_rs, that
reads and edits GeoPackage layers throughgeopackage-pyin place of OGR,
with OGR's URI form. Bounding-box requests use the RTree, subset strings
are SQLiteWHEREclauses, attribute subsets and no-geometry requests are
column projections, and edit sessions add, delete and change features.
Field changes are not offered, since the crate has no schema changes. Its
tests compare it feature by feature with OGR on GDAL-written fixtures,
commit an edit session and check the result with the crate and with OGR,
render a map on worker threads, and save and reopen a project with a
relative path. -
geopackage-qgis, a native build of that provider for QGIS 4: Rust over
the crate's Arrow reads, behind a C++ shim that subclasses QGIS's provider
classes throughcxx. On 200,000 points it reads in a half to a third of
OGR's time, where the Python provider takes three to four times OGR's. It
edits as the Python provider does, each edit call in one transaction. The
plugin loads it, under the samegeopackage_rskey, when it ships a build
for the running QGIS minor version, and otherwise falls back to the
Python provider. On Linux and macOS a build needs QGIS's and Qt's headers
only, taking their symbols from the QGIS it loads into, so it serves any
patch release of its QGIS minor version.scripts/qgis_headers.pymakes
those headers from QGIS's source, for a QGIS without them, such as the
macOS app. The provider tests run against both providers, the native one
in a new CI job on Linux, macOS and Windows with QGIS 4.2 from
conda-forge. The plugin zip carries native builds for QGIS 4.0 and 4.2 on
Linux (x86_64 and aarch64, glibc 2.28 or later), macOS (universal2) and
Windows (4.2 only). -
geopackage_core::triggers::missing_triggersreturns the 1.4 suffixes of
the trigger jobs that a set of trigger names leaves undone. Its result is
empty for a complete set.
Changed
-
curve::BodyScanhas a new public field,flagged_type_code(see
Fixed). Code that builds aBodyScanwith a struct literal must set it. -
Layer::read_arrow_inandread_arrow_in_whereread a box that selects
every row asread_arrowandread_arrow_wheredo, with their threads and
aggregate path, instead of walking every RTree candidate. A box selects
every row when it holds the bounds of the layer's spatial index, widened by
onef32step, and every row has an index entry (no NULL or empty
geometries). The widening is needed because the RTree module stores a
subnormal coordinate as the nearestf32, which can be inside the true one;
so a box exactly equal to the index bounds still filters. This is the
request a map canvas makes when zoomed out to the whole layer. On the
scatteredgroup of thefilteredbenchmark, a box over all 200,000
points takes 28 ms instead of 119 ms. A smaller box pays for one read of
the RTree's root node, about 4 µs. -
The workspace requires
arrow-array60.1.geopackage-ffiuses
RecordBatchStreamReader, the new name offfi_stream::ArrowArrayStreamReader,
which 60.1 deprecates and which CI's-D warningsrejects. -
TileAncillary'smin,max,meanandstd_devfields, and the
writer and builder documentation, now give their units: values after the
tile's and the coverage's scale and offset, not stored samples. The field
documentation used to say "sample", which was the misreading the CLI made.
Fixed
-
The WKB scanner that computes envelopes rejected a type code that gives Z
or M by a high-bit flag (0x8000_0000,0x4000_0000, as in OGC 99-402)
instead of the ISO offset. Some writers put such codes in GeoPackage
bodies; one Esri export has ISOMULTIPOLYGON Zcontainers whose polygons
are0x80000003. GDAL reads them, and so did this crate'swkb-crate read
path, but the scanner's rejection madeaudit_spatial_index, the index
rebuild andvalidatefail on the whole file. The scanner now reads the
Z and M flags and reports the first flagged code in the new
BodyScan::flagged_type_code. It still rejects the EWKB SRID flag and a
code with both a flag and an ISO offset.encode_gpb_from_wkbstill
refuses to write a flagged body, so the crate writes only ISO WKB. -
GeoPackage::validatestopped with an error at the first geometry it could
not read, so one bad row hid every other finding in the file. It now reads
the header and walks the body of every geometry once, and reports two new
findings per layer:UnreadableGeometry(an error, with the count and the
first reason), andNonIsoWkbTypeCode(a warning, with the count and the
first code) for the high-bit flags above. A layer with an unreadable
geometry is not audited, since the audit reads the same geometries. The
extra pass makesvalidateread every geometry, where before only the
index audit read the feature tables. -
Layer::read_arrow_inandread_arrow_in_wherewere slow on spatially
scattered data, the usual case. They walked the RTree's candidates as runs
of consecutive keys, with one query per run, and scattered rows make nearly
every candidate its own run. A box selecting 1% of 200,000 scattered points
issued about 2,000 queries and took 4.9 times as long asfeatures_in. The
candidates are now read a page at a time: a page whose ids fill at least
half its key span is read as a range, as before, and a sparser one by its
explicit ids, bound through rusqlite'srarray. On the newscattered
group of thefilteredbenchmark, that box now takes 3.6 ms instead of
17.6 ms (the row path takes 3.4 ms), and a 10% box takes 24 ms instead of
73 ms. Clustered data is unaffected: its candidates were already ranges.
Every connection the crate opens now registersrarray, which needs
rusqlite'sarrayfeature. -
A spatial index that had lost some of its triggers was reported as
SpatialIndexStatus::Current(orLegacy), because the status was decided
from which trigger names were present, and any one ofupdate5,update6
orupdate7passed for the whole 1.4 set.has_spatial_indexthen
answeredtrue, sofeatures_in, the Arrow bbox reads and the bulk-write
decision used an index that writes were getting past: after dropping only
theinserttrigger, a bounding-box query missed every row inserted since.
repair_spatial_indexandgpkg repairdid nothing to it, andvalidate
was silent until the index had drifted. Such an index is now
SpatialIndexStatus::Stale. Reads fall back to a full scan,validate
reportsStaleSpatialIndexstraight away, and repair reinstalls the whole
set and rebuilds the content. A missing trigger can also make writes fail:
withoutupdate2, an emptied geometry keeps its entry, and a later update
back to a non-empty geometry hitsupdate7's UNIQUE id.has_spatial_index,repair_spatial_indexandrebuild_spatial_index
now decide fromspatial_index_status, so they cannot disagree with it.- A large
write_allinto such a layer now takes the per-row path, as it
already did for a stale index with no triggers. It used to take the bulk
path, which reinstalled the whole trigger set as a side effect. Repair
is never automatic, so the index stays stale until you repair it. - Completeness is by role, not exact name. A complete pre-1.4 set
(insert,update1toupdate4,delete) is stillLegacy, and so is
a complete mixed set. Trigger bodies are not inspected. A trigger with the
right name and the wrong body passes, andaudit_spatial_indexfinds the
drift it ...
0.13.0
Added
GeoPackage::validatereports coverage tiles whose pixel size is not the
one their zoom level declares asFinding::CoverageTileSizeMismatch, an
error: GDAL refuses such a tile, as do this crate's sample reads. It reads
only the header, so it does not need thecoverage-samplesfeature.- The
coverage-samplesfeature, off by default, decodes the samples of
tiled gridded coverage tiles with thetiffandpngcrates. The feature
is ongeopackage-core, which holds the decode, andgeopackageforwards
it. Image tiles are still never decoded.- In
geopackage-core::coverage:decode_samplesanddecode_payload
return a tile'sTileSamples, whosecheck_finitechecks Requirement
21 and whosestatisticscalculatesSampleStatistics.SampleLookup
finds theWeightedSamples a position reads and combines their values,
so a reader without SQLite can look up values too. - A small payload whose header declares a huge tile cannot make the
decoder allocate for it. Where the zoom level is known, a tile whose size
is not the level's is refused from its header before it is decoded, as
GDAL does (TileError::PayloadSizeMismatch). Every decode
also has a limit,DEFAULT_MAX_DECODED_SAMPLES(4096 by 4096) unless
OpenOptions::max_decoded_samplesordecode_payload's argument sets
another, over which it returns the newTileError::PayloadTooLarge. CoveragePayload::tile_payload, to check a coverage payload's size with
TileMatrix::check_payload.Coverage::decodeandCoverage::samplesreturn a tile's stored
samples asTileSamples.samplesrefuses a tile whose size is not its
zoom level's.Coverage::value_atreturns the value at a position in the coverage's
CRS, withInterpolation::NearestorInterpolation::Bilinear, following
itsgrid_cell_encoding.Coverage::sampleropens aCoverageSampler,
which keeps decoded tiles across lookups.Coverage::statisticscalculates a tile'sSampleStatistics, and
CoverageWriter::put_with_statisticsrecords them on write. Both match
the statistics GDAL records: of values after the scale and offset,
withoutdata_null, with the population standard deviation.Coverage::check_sampleschecks Requirement 21 (no NaN or infinite
samples), andput_with_statisticsenforces it.
- In
Changed
- With the
coverage-samplesfeature,GeoPackage::validatedecodes every
coverage tile and reports a NaN or infinite sample as
Finding::CoveragePayloadNonConformantwith requirement 21, and data that
does not decode with requirement 15 (TIFF) or 13 (PNG). A tile whose size
is not its zoom level's, or that is over the decode limit, is not decoded,
and its samples are not checked. Without the feature it does not change. CoverageAncillaryandTileAncillarymove togeopackage-core::coverage,
andgeopackagere-exports them under the same names.CoverageAncillary
gainsnew,datatype,valueandis_null. Both are
#[non_exhaustive], so code outside the crates builds them withnewand
field assignment rather than a struct literal.
Fixed
geopackage-ffino longer exports the Rust methods of its handle types,
other thanContainer::gpkg. Safe Rust could use them to drop a
Containerwhile aLayerHandleorTilesHandlestill pointed into it.
The C ABI does not change.
0.12.0
Added
Error::NanAncillaryValue, for a NaN in a coverage's ancillary row or a
tile's. SQLite stores NaN as NULL, so neither table can store one.GeometryError::InteriorRingsWithoutExterior, for a polygon with interior
rings and an empty exterior ring.DateTime::format_strictreturns the strict 1.4 text of an instant,
normalised to UTC and floored to the millisecond.Error::NoSuchRow, for aROWIDa table does not have.Finding::StaleSpatialIndex, for a spatial index whose virtual table or
whose triggers are missing.Layer::repair_spatial_indexrepairs it.Error::NanEpoch, for a NaN epoch in a spatial reference system row.
Changed
features_inselects no feature for a box with a NaN edge or with a
minimum above its maximum. An inverted box used to select every envelope
wide enough to span it, and on a layer without a spatial index a NaN edge
was an SQLite error.cursor_inandTileMatrixSet::tile_rangeselect the tile on each side of
a shared tile edge that a box's west or north edge lies on, as the docs
stated. Before, only a box's east and south edges did.TileMatrixSet::tile_boundscalculates each tile edge once, so adjacent
tiles share their edges exactly and the outer edges are the extent's.
tile_atreturns the tile whose bounds contain the position.- Creating a layer, attribute table, tile pyramid or coverage whose name
beginssqlite_, in any case, isError::ReservedTablePrefix. It used to
be an SQLite error. encode_gpb, and with itFeatureWriterandwrite_all, rejects a
geometry nested more than 32 levels deep (GeometryError::NestingTooDeep)
and a polygon with interior rings but no exterior ring. The first could not
be read by theST_*functions or indexed;wkb0.9.3 wrote the second
with a ring count of zero, so its holes were lost on read.create_coverageandCoverageWriter::put_with_ancillaryreject a NaN
in the ancillary row. A NaN scale or offset was an SQLite error, and a NaN
data_nullor statistic read back asNone.- A
DATETIMEis written in the strict 1.4 form, normalised to UTC and
floored to the millisecond, bywrite_all,FeatureWriterand
write_arrow. A value with sub-millisecond digits or a UTC offset used to
be written in a form the default strict read rejects. A value whose offset
moves it outside years 0 to 9999 isError::InvalidDateTimeValue. write_arrowchecks each batch's column types against the layer's before
writing its rows: a column takes the Arrow type a read gives it, a narrower
or unsigned integer,Float32,LargeUtf8,LargeBinary, or a timestamp
in any unit. It used to write any type into any column. Unsigned integers
and second and nanosecond timestamps, whichfrom_arrow_schemaalready
mapped, are now written; aUInt64abovei64::MAXis an error.- The Arrow reads use the layer's
StorageStrictness, as the row path does,
and read a geometry cell that is not a BLOB as a null geometry instead of
failing the batch. read_arrow_inandread_arrow_in_whereselect no row for a box with a
NaN edge or inverted edges, asfeatures_indoes.read_arrow_inreturns
its rows in key order; its docs no longer sayfeatures_in's order.add_metadata_referencechecks that a column target's column
(Requirement 98) and a row target'sROWID(Requirement 99) exist, and
writes its timestamp in the strict form. A row in a view is not checked.RelationName::is_conformantjudges the string a name writes: an
Extendedname with an empty author or name, or an author containing_,
is not conformant, because it reads back as another name;Otherholding a
class name is.add_relationfollows it.MetadataScope::is_listedalso
judges the written name.Extension::supportjudges the name a value writes: aGeometryTypeof a
core type isUnrecognised, andOtherholding a known name has that
extension's support.create_attributes_table, coverage tile writes,add_relationand
add_mappingreturnError::UnsupportedExtensionwhen an extension the
crate does not know applies to the table, as the feature and tile writes
already did. Theblocking_extensiondocs list the writes that check.add_relationchecks its mapping table's name as every other creation path
does: an empty or NUL name isInvalidIdentifier, and agpkg_or
sqlite_prefix isReservedTablePrefix.- Once a file has the
definition_12_063column,add_srsand
add_epsg_srsgive an EPSG row without WKT2 of its own the EPSG
registry's WKT2, as adding the column already did for the rows present.
The table no longer depends on the order of the calls: a WKT1 code added
after a WKT2-only code used to getundefined. add_srsrejects a NaN epoch withError::NanEpoch. It used to store
NULL, which reads back as no epoch, and still add the WKT2 columns.Error::UnknownEpsgCodesays the code is in neither the vendored
definitions nor the EPSG registry. It used to name only the vendored
subset.geopackage-ffi: an SQLite constraint failure, such as an insert with a
feature id already in use, isGPKG_STATUS_CONSTRAINTinstead of
GPKG_STATUS_IO. A file that is not an SQLite database is
GPKG_STATUS_NOT_A_GEOPACKAGEinstead ofGPKG_STATUS_IO, as an empty
file or a plain SQLite database already was.geopackage-ffi:FloatCoverageScaled,NanAncillaryValue,
UnwritableCoveragePayload,NoCoverageAncillaryand
InteriorRingsWithoutExteriorhave a status category instead of
GPKG_STATUS_OTHER.- A NaN written to a
REALcolumn is stored as NULL and a negative zero as
zero, as SQLite stores them; the write docs now say so. - Dev-dependency
hegeltestis now 0.49.11 ingeopackageand
geopackage-core, and new ingeopackage-ffi;hegel.tomlruns 2000
cases per property test.
Fixed
- A coverage put that failed after writing its tile left the tile without
its ancillary row in the writer's transaction. Each put is now undone as a
whole. audit_spatial_indexreported an index as inconsistent where SQLite's
RTree stores a coordinate beyond thef32range as an infinite bound, or a
subnormal coordinate as the nearestf32. A rebuild could not fix it. The
bulk index build fell back to the triggered build for the same data.Date::from_days_since_epochpanicked for a count beyond about 20,000
years from 1970, instead of returningOutOfRange.DateTime::micros_since_epochrounded an instant before 1970 with
sub-microsecond digits up to the next microsecond, which at
1969-12-31T23:59:59.9999995Z moved it into 1970.- A GPB header's Z range included the Z of a coordinate whose X or Y is not
finite, such as an empty point, which the XY range already left out. gpb::body_offsetreported a 4 to 7 byte blob with a bad magic as
BadMagic, whereparse_headerreports it asTruncated.DateTime::micros_since_epochandfrom_micros_since_epochfailed for an
instant after 9999-12-30T22:00Z, so an Arrow read of such aDATETIME
failed.tile_atandtile_rangecould miss tiles where several tiles thinner
than the coordinates' resolution share one rounded edge.validatefailed with an error for agpkg_contentsrow of a feature
table or a coverage whose table is absent, instead of reporting
MissingContentsTable.validatefailed with an error for a spatial index whose virtual table is
absent, and reported nothing for one whose triggers are absent. It reports
both asStaleSpatialIndex.validatereported no dangling metadata reference once every metadata
record was deleted.- Adding the WKT2 column filled in a row's WKT2 from its
srs_id, not from
itsorganization_coordsys_id. A row whose id is not its EPSG code got
another CRS's definition, or none. geopackage-ffi:gpkg_writer_insert,gpkg_writer_updateand
gpkg_writer_update_columnreturnedGPKG_STATUS_INVALID_ARGUMENTfor a
NULL or non-UTF-8 text value, while the error they filled in said
GPKG_STATUS_BAD_ARGUMENT.gpkg_layer_read_arrow_filteredreturned
GPKG_STATUS_BAD_ARGUMENTfor an invalid date parameter, while the error
saidGPKG_STATUS_INVALID_ARGUMENT. Each now returns the status its error
reports.geopackage-ffi: thegpkg_tiles_putdocs said an address outside the
grid or a payload of the wrong size returnsGPKG_STATUS_OTHER. They
returnGPKG_STATUS_INVALID_ARGUMENTandGPKG_STATUS_CONSTRAINT.
0.11.2
Added
- Each GitHub release has
gpkgbinaries for x86_64 and aarch64 Linux,
x86_64 and aarch64 macOS, and x86_64 Windows, built with the workspace's
SQLite compile flags.cargo binstall geopackage-cliinstalls them. A
cargo installfrom crates.io does not get the flags unless
LIBSQLITE3_FLAGSis set in the environment: without them,gpkg copyof
the benchmark subsets takes 8 to 25 % longer.
Changed
- The README, the crate documentation and the book install
gpkgwith
cargo binstall geopackage-cli, and give theLIBSQLITE3_FLAGSsetting
forcargo install.geopackage-clistates the layout of its release
archives in[package.metadata.binstall].
0.11.1
Added
OpenOptions::mmap_sizereads the file through a memory map of up to the
given size (PRAGMA mmap_size). It is off by default. A threaded
read_arrowgives its worker connections the same size.- The
ST_EnvIntersects(geom, minx, miny, maxx, maxy)SQL function, with the
name and arguments of GDAL's, is registered with theST_*functions.
Changed
- Builds from this repository compile the bundled SQLite without
SQLITE_ENABLE_MEMORY_MANAGEMENTand withSQLITE_DEFAULT_MEMSTATUS=0,
throughLIBSQLITE3_FLAGSin.cargo/config.toml. With the first flag, all
connections in a process shared one page cache behind one mutex, so the
threads of a threadedread_arrowwaited for each other. A 4-thread read of
the rivers dataset takes 1.5 s instead of 1.76 s, and an 8-thread read 0.82 s
instead of 1.23 s. The crate documentation of thebundledfeature gives
the same setting for dependants. Acargo installfrom crates.io does not
read this file. read_arrowsizes the text, blob and geometry buffers of each batch from
the bytes per row of the batch before it, instead of from a fixed estimate,
so that a buffer does not grow and copy itself while the batch is filled. A
read of the rivers dataset has 18,000 page faults instead of 129,000, and
takes 5.1 s instead of 5.5 s on one thread and 1.39 s instead of 1.56 s on 4.read_arrowreads each row's geometry once, instead of once for the batch's
byte ceiling and again to append it. When the key is one of the selected
columns, the batch's last key comes from that column. A read of the
buildings dataset executes 3.9 % fewer instructions, and of the rivers
dataset 1.3 % fewer.GeoPackage::openandopen_read_onlyopen the connection with
SQLITE_OPEN_NO_MUTEX, ascreatealready did. SQLite no longer locks a
mutex around each column read: a scalar read of the rivers dataset takes
8.2 s instead of 10.2 s.- Row reads select the columns in the order the table stores them. On a table
that stores the geometry first, as GDAL does, SQLite no longer
reads a row's last overflow page twice: a scalar read of the admin dataset
takes 3.0 s instead of 3.4 s. - A threaded
read_arrowno longer needs a primary key without gaps, and no
longer counts the rows first. Workers read windows ofbatch_size
consecutive keys, so a batch has fewer rows where the key has gaps. A read
of the buildings dataset takes 1.4 s instead of 2.8 s. read_arrowfills each batch withSELECT agg(...) FROM t WHERE key BETWEEN a AND binstead of wrapping aLIMITquery in a subquery, which
SQLite copied every text and blob value out of. A single-threaded read of
the rivers dataset takes 5.3 s instead of 7.4 s, and a threaded one 1.7 s
instead of 2.2 s.- A bounding-box query on a layer with no spatial index tests each row's
envelope in SQL, withST_EnvIntersects, so SQLite reads only the geometry
of a row outside the box.features_in_sqlreturns the new query, which
has four box parameters. A query of the rivers dataset takes 1.7 s instead
of 3.2 s. roadmap/benchmarks/README.mdreplaces the dated benchmark write-ups. It
compares the library andgpkg copywith GDAL 3.13.3.scripts/bench_datasets.shmeasures over subsets of about 250 MB per
dataset, which itssubsetmode makes, and timesgpkg copyagainst
ogr2ogras one more operation. Peak memory comes from the timed runs.
GDAL's results are kept in one file per GDAL version, so a run with them
cached measures this crate's side only.scripts/bench_fly.sh benchbuilds
a local jj revision.scripts/bench_fly.sh quick <revA> <revB>compares two local revisions in
about a minute, by the instructions each operation executes on the
benchmark subsets (scripts/quick_ab.sh).scripts/bench_datasets.shtimes GDAL beside this crate for each operation,
through the newscripts/gdal_dataset_bench.c. Thedataset_benchwrite
and index arms usesynchronous = OFF, and its box query builds each
geometry.
Removed
scripts/compare_gdal_arrow.sh,scripts/compare_gdal_arrow_write.sh,
scripts/compare_gdal_index.sh,scripts/compare_gdal_copy.sh,
scripts/gdal_baseline.sh, their C programs, thearrow_benchand
index_benchexamples, andscripts/bench_fly.sh copy.
scripts/bench_datasets.shreplaces them.