spatialContains method
The rows of table whose geomColumn is fully contained within the
polygon described by polygonWkt.
Implementation
Future<List<Map<String, Object?>>> spatialContains(
String table,
String geomColumn,
String polygonWkt,
) => rawQuery(
'SELECT t.* FROM $table AS t '
'WHERE t.ROWID IN ('
' SELECT ROWID FROM ${_rtreeName(table, geomColumn)}'
' WHERE xmin <= MbrMaxX(GeomFromText(?)) AND xmax >= MbrMinX(GeomFromText(?))'
' AND ymin <= MbrMaxY(GeomFromText(?)) AND ymax >= MbrMinY(GeomFromText(?))'
') '
'AND ST_Contains(GeomFromText(?), t.$geomColumn) = 1',
[polygonWkt, polygonWkt, polygonWkt, polygonWkt, polygonWkt],
);