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 oftablewhosegeomColumn'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 oftablewhosegeomColumnis fully contained within the polygon described bypolygonWkt. -
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 ingeomColumnof the row whereidColumnequalsid, and the geometry described bywkt, 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 oftablewhosegeomColumnintersects the geometry described bywkt. -
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
Thelimitrows oftablewhosegeomColumnis nearest towkt, ordered by ascending distance. Each returned row includes adistancecolumn.