Package org.geotools.gce.arcgrid

Examples of org.geotools.gce.arcgrid.ArcGridWriter


            // wp.setCompressionMode(GeoTiffWriteParams.MODE_DEFAULT);
            // wp.setTilingMode(GeoToolsWriteParams.MODE_DEFAULT);
            final ParameterValueGroup paramWrite = format.getWriteParameters();
            paramWrite.parameter(AbstractGridFormat.GEOTOOLS_WRITE_PARAMS.getName().toString()).setValue(wp);
            File dumpFile = new File(newFilePath + ".asc");
            ArcGridWriter gtw = (ArcGridWriter) format.getWriter(dumpFile);
            gtw.write(coverage2D, (GeneralParameterValue[]) paramWrite.values().toArray(new GeneralParameterValue[1]));
        }
    }
View Full Code Here


                                    final ArcGridFormat format1 = new ArcGridFormat();
                                    final ArcGridWriteParams wp = new ArcGridWriteParams();
                                    final ParameterValueGroup paramWrite = format1.getWriteParameters();
                                    paramWrite.parameter(AbstractGridFormat.GEOTOOLS_WRITE_PARAMS.getName().toString()).setValue(
                                            wp);
                                    ArcGridWriter gtw = (ArcGridWriter) format1.getWriter(new File(folderFile, mapFile.getName()
                                            + ".asc"));
                                    gtw.write(geodata,
                                            (GeneralParameterValue[]) paramWrite.values().toArray(new GeneralParameterValue[1]));
                                    gtw.dispose();
                                }
                                pm.worked(1);
                            }
                        } catch (Exception e) {
                            String message = "An error occurred while exporting the maps.";
View Full Code Here

            gzipOut = new GZIPOutputStream(output);
            output = gzipOut;
        }

        try {
            final GridCoverageWriter writer = new ArcGridWriter(output);
            final ParameterValueGroup params = writer.getFormat().getWriteParameters();
            //params.parameter("Compressed").setValue(compressOutput);
            writer.write(sourceCoverage, null);

            if (gzipOut != null) {
                gzipOut.finish();
                gzipOut.flush();
            }

            // freeing everything
            writer.dispose();
            this.sourceCoverage.dispose(false);
            this.sourceCoverage = null;
        } catch (Exception e) {
            throw new WcsException(new StringBuffer("Problems Rendering Image").append(
                    e.getMessage()).toString(), e);
View Full Code Here

  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;
View Full Code Here

        if (compressOutput) {
            gzipOut = new GZIPOutputStream(output);
            output = gzipOut;
        }

        ArcGridWriter writer=null;
        try {
            writer = new ArcGridWriter(output);
            writer.write(sourceCoverage, null);

            if (gzipOut != null) {
                gzipOut.finish();
                gzipOut.flush();
            }


        }finally {
          try{
          if(writer!=null)
            writer.dispose();
          }catch (Throwable e) {
        // eating exception
      }
          if(gzipOut!=null)
            IOUtils.closeQuietly(gzipOut);
View Full Code Here

        if (isOutputCompressed(outputFormat)) {
            gzipOut = new GZIPOutputStream(output);
            output = gzipOut;
        }

        ArcGridWriter writer=null;
        try {
            writer = new ArcGridWriter(output);
            writer.write(sourceCoverage, null);

            if (gzipOut != null) {
                gzipOut.finish();
                gzipOut.flush();
            }


        }finally {
          try{
          if(writer!=null)
            writer.dispose();
          }catch (Throwable e) {
        // eating exception
      }
          if(gzipOut!=null)
            IOUtils.closeQuietly(gzipOut);
View Full Code Here

  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;
View Full Code Here

TOP

Related Classes of org.geotools.gce.arcgrid.ArcGridWriter

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.