Package chunmap.raster.grid

Examples of chunmap.raster.grid.GridLayer


    return file;
  }

  public GridLayer autoCut(double step, int num) throws IOException {
    double scale = 1;
    GridLayer layer = new GridLayer();
    layer.setEnvelop(map.getLayerCollection().getEnvelop());
    layer.setName(rootPath);

    // 时间戳
    Calendar rightNow = Calendar.getInstance();
    String pars = rightNow.getTimeInMillis() + "";

    Grid[] grids = new Grid[num];
    for (int i = 0; i < num; i++) {

      Grid grid = cut(scale, pars);
      grids[i] = grid;

      scale *= step;
    }
    layer.setGrids(grids);
    return layer;
  }
View Full Code Here


    this.buffer = buffer;
  }

  // --------------------------------------------------------------------------
  public GridLayer createLayer() {
    GridLayer layer = new GridLayer();
    layer.setEnvelop(layerEnvelop);
    layer.setName(rootPath);

    File[] directoryList = getGridDirList();
    int num = directoryList.length;
    Grid[] grids = new Grid[num];

    // create GridDataSource
    FileImageData gridData = new FileImageData();
    gridData.setFormatName(formatName);
    gridData.setRootPath(rootPath);

    int i = 0;
    for (File dir : directoryList) {
      String path = dir.getPath();
      String dirName = dir.getName();

      double scale = getScale(dirName);
      Grid grid = new Grid();
      grid.setParameters(parameters);
      grid.setScale(scale);
      grid.setSubEnvelop(getEnvelop(0, 0, scale));

      setTile4Grid(grid, path);
      grid.setGridData(gridData);

      grids[i] = grid;
      i++;
    }
    layer.setGrids(grids);
    return layer;
  }
View Full Code Here

TOP

Related Classes of chunmap.raster.grid.GridLayer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.