getSpatialindexBBoxWherePiece method
Implementation
Future<String?> getSpatialindexBBoxWherePiece(
TableName tableName, double x1, double y1, double x2, double y2) async {
Polygon bounds = PostgisUtils.createPolygonFromBounds(x1, y1, x2, y2);
GeometryColumn? gCol = await getGeometryColumnsForTable(tableName);
if (gCol == null) {
return null;
}
int srid = gCol.srid;
String sql = gCol.geometryColumnName +
" && ST_GeomFromText('" +
bounds.toText() +
"', $srid) AND ST_Intersects(" +
gCol.geometryColumnName +
",ST_GeomFromText('" +
bounds.toText() +
"',$srid))";
return sql;
}