return grid;
}
private void createAllTile(Grid grid, String path) throws IOException {
Envelope oenvelop = map.getLayerCollection().getEnvelop();
double w = grid.getSubEnvelop().getWidth();
double h = grid.getSubEnvelop().getHeight();
double zw = oenvelop.getWidth();
double zh = oenvelop.getHeight();
// double vw = map.getView().getEnvelop().getWidth();
// double vh = map.getView().getEnvelop().getHeight();
double ox = oenvelop.getMinX();
double oy = oenvelop.getMinY();
double dn = zw / w + 0.4999;
double dm = zh / h + 0.4999;
int n = (int) Math.round(dn);
int m = (int) Math.round(dm);
double dx, dy;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
// compute envelop
dx = i * w + ox;
dy = j * h + oy;
// pixels expand
// double dd = buffer / map.getView().getScale();
Envelope envelop = new Envelope(dx, dy, dx + w, dy + h);
map.getView().setViewEnvelop(envelop);
// map.getView().pan(0, dy);
createImage(grid, path, i, j);
}