SqfliteDatabaseSpatialiteExt extension

SpatiaLite spatial query helpers.

All methods build parameterized SQL calling SpatiaLite SQL functions and run it through DatabaseExecutor.rawQuery/DatabaseExecutor.execute — there is no additional native method channel surface. Geometries are passed/returned as WKT (Well-Known Text, e.g. 'POINT(1 2)').

Queries that filter by geometry pre-filter using the RTree spatial index (idx_<table>_<geomColumn>, created via createSpatialIndexSql) before applying the exact SpatiaLite predicate — the standard SpatiaLite performance idiom, since the RTree alone only tests bounding-box overlap.

Only produces correct results against a SpatiaLite-enabled native engine (currently Android, opened via openSpatialDatabase).

on

Methods

spatialBoundingBoxFilter(String table, String geomColumn, double minX, double minY, double maxX, double maxY) Future<List<Map<String, Object?>>>

Available on Database, provided by the SqfliteDatabaseSpatialiteExt extension

The rows of table whose geomColumn's bounding box overlaps the rectangle ([minX], [minY])-([maxX], [maxY]).
spatialContains(String table, String geomColumn, String polygonWkt) Future<List<Map<String, Object?>>>

Available on Database, provided by the SqfliteDatabaseSpatialiteExt extension

The rows of table whose geomColumn is fully contained within the polygon described by polygonWkt.
spatialDistance(String table, String geomColumn, String wkt, {required String idColumn, required Object id}) Future<double?>

Available on Database, provided by the SqfliteDatabaseSpatialiteExt extension

The planar distance between the geometry in geomColumn of the row where idColumn equals id, and the geometry described by wkt, in the spatial reference system's units.
spatialIntersects(String table, String geomColumn, String wkt) Future<List<Map<String, Object?>>>

Available on Database, provided by the SqfliteDatabaseSpatialiteExt extension

The rows of table whose geomColumn intersects the geometry described by wkt.
spatialNearest(String table, String geomColumn, String wkt, {int limit = 10, double searchBuffer = 1.0}) Future<List<Map<String, Object?>>>

Available on Database, provided by the SqfliteDatabaseSpatialiteExt extension

The limit rows of table whose geomColumn is nearest to wkt, ordered by ascending distance. Each returned row includes a distance column.