Example #1
0
  @Override
  public double getLayerCellSize() {

    if (_layerExtent != null) {
      return _layerExtent.getCellSize();
    }
    return 0;
  }
Example #2
0
  @Override
  public void postProcess() {

    try {

      // BufferedImage bi = new
      // BufferedImage(RasterRenderer.getDefaultColorModel(
      // (WritableRaster)m_Raster), (WritableRaster)m_Raster, false,
      // null);
      // Sector sector = Sector.fromDegrees(m_LayerExtent.getYMin(),
      // m_LayerExtent.getYMax(),
      // m_LayerExtent.getXMin(), m_LayerExtent.getXMax());
      // GeotiffWriter writer;
      // File file = new File(m_sFilename);
      // writer = new GeotiffWriter(file);
      // writer.write(bi);
      // TODO:Sector???????????
      final File file = new File(_filename);
      final GRasterGeodata geodata =
          new GRasterGeodata(
              _layerExtent.getXMin(),
              _layerExtent.getYMin(),
              _layerExtent.getCellSize(),
              _layerExtent.getNY(),
              _layerExtent.getNX(),
              _projection);

      final GGlobeRasterLayer layer = new GGlobeRasterLayer(_raster, geodata);
      layer.setNoDataValue(_noDataValue);
      layer.setName(_name);
      ESRIAsciiFileTools.writeFile(layer, file);
      create(layer);

    } catch (final Exception e) {
      e.printStackTrace();
    }
  }