Package org.geotools.coverage.grid.io

Examples of org.geotools.coverage.grid.io.AbstractGridCoverageWriter


  public void close() {}

  public void postProcess() {

    try{
      AbstractGridCoverageWriter writer;
      if (m_sFilename.endsWith("asc")){
        writer = new ArcGridWriter(new File(m_sFilename));
      }
      else{
        writer = new GeoTiffWriter(new File(m_sFilename));
      }
      GridCoverage2D gc = (GridCoverage2D) m_BaseDataObject;
      writer.write(gc.geophysics(true), null);
      writer.dispose();
    }catch (Exception e){
      e.printStackTrace();
    }

  }
View Full Code Here


           
            final ParameterValueGroup wparams = TIFF_FORMAT.getWriteParameters();
            wparams.parameter(AbstractGridFormat.GEOTOOLS_WRITE_PARAMS.getName().toString()).setValue(wp);
            final GeneralParameterValue[] wps = (GeneralParameterValue[]) wparams.values().toArray(new GeneralParameterValue[1]);
            // write out the coverage
            AbstractGridCoverageWriter writer = (AbstractGridCoverageWriter) format.getWriter(os);
            if (writer == null)
                throw new WPSException(
                        "Could not find the GeoTIFF writer, please check it's in the classpath");
            try {
                writer.write(coverage, wps);
            } catch(IOException e) {
                throw new ProcessException(e);
            } finally {
                try {
                    writer.dispose();
                } catch (Exception e) {
                    // swallow
                }
            }
        }
View Full Code Here

  public void close() {}

  public void postProcess() {

    try{
      AbstractGridCoverageWriter writer;
      if (m_sFilename.endsWith("asc")){
        writer = new ArcGridWriter(new File(m_sFilename));
      }
      else{
        writer = new GeoTiffWriter(new File(m_sFilename));
      }
      GridCoverage2D gc = (GridCoverage2D) m_BaseDataObject;
      writer.write(gc.geophysics(true), null);
      writer.dispose();
    }catch (Exception e){
      e.printStackTrace();
    }

  }
View Full Code Here

        params.parameter(AbstractGridFormat.GEOTOOLS_WRITE_PARAMS.getName().toString()).setValue(
                DEFAULT_WRITE_PARAMS);
        final GeneralParameterValue[] wps = (GeneralParameterValue[]) params.values().toArray(
                new GeneralParameterValue[1]);
        // write out the coverage
        AbstractGridCoverageWriter writer = (AbstractGridCoverageWriter) format.getWriter(os);
        if (writer == null)
            throw new WPSException(
                    "Could not find the GeoTIFF writer, please check it's in the classpath");
        try {
            writer.write(coverage, wps);
        } finally {
            try {
                writer.dispose();
            } catch (Exception e) {
                // swallow
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.geotools.coverage.grid.io.AbstractGridCoverageWriter

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.