Examples of ArcGridFormat


Examples of org.geotools.gce.arcgrid.ArcGridFormat

            File dumpFile = new File(newFilePath + ".tif");
            GeoTiffWriter gtw = (GeoTiffWriter) format.getWriter(dumpFile);
            gtw.write(coverage2D, (GeneralParameterValue[]) paramWrite.values().toArray(new GeneralParameterValue[1]));
        }
        if (isAscii) {
            final ArcGridFormat format = new ArcGridFormat();
            final ArcGridWriteParams wp = new ArcGridWriteParams();
            // wp.setProgressiveMode(GeoTiffWriteParams.MODE_DEFAULT);
            // 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

Examples of org.geotools.gce.arcgrid.ArcGridFormat

                                            .createFormat();
                                    GridCoverageReader reader = format.getReader(mapEnvironment.getCELL());
                                    GridCoverage2D geodata = ((GridCoverage2D) reader.read(readParams));
                                    geodata = geodata.view(ViewType.GEOPHYSICS);

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

Examples of org.geotools.gce.arcgrid.ArcGridFormat

        MockHttpServletResponse response = postAsServletResponse(root(), xml);
        // System.out.println(response.getOutputStreamContent());
        InputStream is = getBinaryInputStream(response);
       
        ArcGridFormat format = new ArcGridFormat();
        GridCoverage gc = format.getReader(is).read(null);
       
        GridCoverage original = getCatalog().getCoverageByName(getLayerId(MockData.TASMANIA_DEM)).getGridCoverage(null, null);
       
        // check the envelope did not change
        assertEquals(original.getEnvelope().getMinimum(0), gc.getEnvelope().getMinimum(0), EPS);
View Full Code Here

Examples of org.geotools.gce.arcgrid.ArcGridFormat

                + "  </wps:ResponseForm>\n" + "</wps:Execute>\n" + "\n" + "";

        MockHttpServletResponse response = postAsServletResponse(root(), xml);
        InputStream is = getBinaryInputStream(response);
       
        ArcGridFormat format = new ArcGridFormat();
        GridCoverage gc = format.getReader(is).read(null);
       
        assertTrue(new Envelope(-145.4, 145.6, -41.8, -42.1).contains(new ReferencedEnvelope(gc.getEnvelope())));
       
        double[] valueInside = (double[]) gc.evaluate(new DirectPosition2D(145.55, -42));
        assertEquals(615.0, valueInside[0]);
View Full Code Here

Examples of org.geotools.gce.arcgrid.ArcGridFormat

    }

    @Override
    public Object decode(InputStream input) throws Exception {
        // ArcGrid files can be read directly from stream
        return new ArcGridFormat().getReader(input).read(null);
    }
View Full Code Here

Examples of org.geotools.gce.arcgrid.ArcGridFormat

        // if the user forgot to add the final newline let's just add it
        if(!arcgrid.endsWith("\n")) {
            arcgrid += "\n";
        }
        ByteArrayInputStream in = new ByteArrayInputStream(arcgrid.getBytes());
        return new ArcGridFormat().getReader(in).read(null);
    }
View Full Code Here

Examples of org.geotools.gce.arcgrid.ArcGridFormat


    @Override
    public void encode(Object value, OutputStream os) throws IOException {
        Parameter<Boolean> forceSquareCells = new Parameter<Boolean>(ArcGridFormat.FORCE_CELLSIZE, Boolean.TRUE);
        new ArcGridFormat().getWriter(os).write((GridCoverage2D) value,
                new GeneralParameterValue[] {forceSquareCells});
    }
View Full Code Here

Examples of org.geotools.gce.arcgrid.ArcGridFormat

        } finally {
            IOUtils.closeQuietly(os);
        }

        // and then we try to read it as a asc
        return new ArcGridFormat().getReader(f).read(null);
    }
View Full Code Here

Examples of org.geotools.gce.arcgrid.ArcGridFormat

        // if the user forgot to add the final newline let's just add it
        if(!arcgrid.endsWith("\n")) {
            arcgrid += "\n";
        }
        ByteArrayInputStream in = new ByteArrayInputStream(arcgrid.getBytes());
        return new ArcGridFormat().getReader(in).read(null);
    }
View Full Code Here

Examples of org.geotools.gce.arcgrid.ArcGridFormat


    @Override
    public void encode(Object value, OutputStream os) throws IOException {
        Parameter<Boolean> forceSquareCells = new Parameter<Boolean>(ArcGridFormat.FORCE_CELLSIZE, Boolean.TRUE);
        new ArcGridFormat().getWriter(os).write((GridCoverage2D) value,
                new GeneralParameterValue[] {forceSquareCells});
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.