Package org.geotools.coverage.grid

Examples of org.geotools.coverage.grid.GridEnvelope2D


    final GeneralEnvelope envelope = reader.getOriginalEnvelope();
    final Dimension dim= new Dimension();
    dim.setSize(reader.getOriginalGridRange().getSpan(0)/2.0, reader.getOriginalGridRange().getSpan(1)/2.0);
    final Rectangle rasterArea=(( GridEnvelope2D)reader.getOriginalGridRange());
    rasterArea.setSize(dim);
    final GridEnvelope2D range= new GridEnvelope2D(rasterArea);
    gg.setValue(new GridGeometry2D(range,envelope));
   
   
    // use imageio with defined tiles
    final ParameterValue<List> time = ImageMosaicFormat.TIME.createValue();
View Full Code Here


    final GeneralEnvelope envelope = reader.getOriginalEnvelope();
    final Dimension dim= new Dimension();
    dim.setSize(reader.getOriginalGridRange().getSpan(0)/2.0, reader.getOriginalGridRange().getSpan(1)/2.0);
    final Rectangle rasterArea=(( GridEnvelope2D)reader.getOriginalGridRange());
    rasterArea.setSize(dim);
    final GridEnvelope2D range= new GridEnvelope2D(rasterArea);
    gg.setValue(new GridGeometry2D(range,envelope));
   
   
    // use imageio with defined tiles
    final ParameterValue<List> time = ImageMosaicFormat.TIME.createValue();
View Full Code Here

    final ParameterValue<GridGeometry2D> gg =  AbstractGridFormat.READ_GRIDGEOMETRY2D.createValue();
    final Dimension dim= new Dimension();
    dim.setSize(reader.getOriginalGridRange().getSpan(0)/3.0, reader.getOriginalGridRange().getSpan(1)/3.0);
    final Rectangle rasterArea=(( GridEnvelope2D)reader.getOriginalGridRange());
    rasterArea.setSize(dim);
    final GridEnvelope2D range= new GridEnvelope2D(rasterArea);
    gg.setValue(new GridGeometry2D(range,envelope));
   
    // use imageio with defined tiles
    final ParameterValue<Boolean> useJai = AbstractGridFormat.USE_JAI_IMAGEREAD.createValue();
    useJai.setValue(false);
View Full Code Here

    final GeneralEnvelope envelope = reader.getOriginalEnvelope();
    final Dimension dim= new Dimension();
    dim.setSize(reader.getOriginalGridRange().getSpan(0)/2.0, reader.getOriginalGridRange().getSpan(1)/2.0);
    final Rectangle rasterArea=(( GridEnvelope2D)reader.getOriginalGridRange());
    rasterArea.setSize(dim);
    final GridEnvelope2D range= new GridEnvelope2D(rasterArea);
    gg.setValue(new GridGeometry2D(range,envelope));
   
    // use imageio with defined tiles
    final ParameterValue<Boolean> useJai = AbstractGridFormat.USE_JAI_IMAGEREAD.createValue();
    useJai.setValue(false);
View Full Code Here

        final GeneralEnvelope envelope = reader.getOriginalEnvelope();
        final Dimension dim = new Dimension();
        dim.setSize(10,10);
        final Rectangle rasterArea = ((GridEnvelope2D) reader.getOriginalGridRange());
        rasterArea.setSize(dim);
        final GridEnvelope2D range = new GridEnvelope2D(rasterArea);
        gg.setValue(new GridGeometry2D(range, envelope));

        // use imageio with defined tiles
        final ParameterValue<Boolean> useJai = AbstractGridFormat.USE_JAI_IMAGEREAD.createValue();
        useJai.setValue(false);
View Full Code Here

        assertNotNull(reader);

        // ask to extract an area that is inside the coverage bbox, but in a hole (no data)
        final ParameterValue<GridGeometry2D> ggp =  AbstractGridFormat.READ_GRIDGEOMETRY2D.createValue();
        Envelope2D env = new Envelope2D(reader.getCoordinateReferenceSystem(), 500000, 3200000, 1000, 1000);
        GridGeometry2D gg = new GridGeometry2D(new GridEnvelope2D(0, 0, 100, 100), (Envelope) env);
        ggp.setValue(gg);

        // red background
        final ParameterValue<double[]> bgp =  ImageMosaicFormat.BACKGROUND_VALUES.createValue();
        bgp.setValue(new double[] {255, 0, 0, 255});
View Full Code Here

        // ask to extract an area that is inside the coverage bbox, so that the area is partly
        // inside the raster, and partly outside
        final ParameterValue<GridGeometry2D> ggp =  AbstractGridFormat.READ_GRIDGEOMETRY2D.createValue();
        Envelope2D env = new Envelope2D(reader.getCoordinateReferenceSystem(), 64887, 2499342, 646897 - 64887 , 3155705 - 2499342);
        GridGeometry2D gg = new GridGeometry2D(new GridEnvelope2D(0, 0, 100, 100), (Envelope) env);
        ggp.setValue(gg);

        // red background
        final ParameterValue<double[]> bgp =  ImageMosaicFormat.BACKGROUND_VALUES.createValue();
        bgp.setValue(new double[] {255, 0, 0, 255});
View Full Code Here

        final Dimension dim = new Dimension();
        dim.setSize(reader.getOriginalGridRange().getSpan(0) / 2.0, reader.getOriginalGridRange()
                .getSpan(1) / 2.0);
        final Rectangle rasterArea = ((GridEnvelope2D) reader.getOriginalGridRange());
        rasterArea.setSize(dim);
        final GridEnvelope2D range = new GridEnvelope2D(rasterArea);
        gg.setValue(new GridGeometry2D(range, envelope));

        // use imageio with defined tiles
        final ParameterValue<List> time = ImageMosaicFormat.TIME.createValue();
        final List<Date> timeValues = new ArrayList<Date>();
View Full Code Here

        // Check that we got everything correctly after the crop.
        //
        // /////////////////////////////////////////////////////////////////////
        // checking the ranges of the output image.
        final GridGeometry2D croppedGG = (GridGeometry2D) cropped.getGridGeometry();
        final GridEnvelope2D croppedGR = (GridEnvelope2D) croppedGG.getGridRange();
        final MathTransform croppedG2W = croppedGG.getGridToCRS(PixelInCell.CELL_CENTER);
        final GeneralEnvelope croppedEnvelope = (GeneralEnvelope) cropped.getEnvelope();
        assertTrue("min x do not match after crop", 29 == croppedGR.x);
        assertTrue("min y do not match after crop", 30 == croppedGR.y);
        assertTrue("max x do not match after crop", 90 == croppedGR.getMaxX());
        assertTrue("max y do not match after crop", 91 == croppedGR.getMaxY());
        // check that the affine transform are the same thing
        assertTrue("The Grdi2World tranformations of the original and the cropped covearage do not match",
                sourceG2W.equals(croppedG2W));
        // check that the envelope is correct
        final GeneralEnvelope expectedEnvelope = new GeneralEnvelope(croppedGR,
View Full Code Here

      // get a grid coverage
      final ParameterValueGroup params = reader.getFormat().getReadParameters();
      params.parameter(
          AbstractGridFormat.READ_GRIDGEOMETRY2D.getName().toString()).setValue(
              new GridGeometry2D(new GridEnvelope2D(new Rectangle(0, 0, 640, 480)), reader.getOriginalEnvelope()));
      gc = ((GridCoverage2D) reader.read((GeneralParameterValue[]) params.values().toArray(new GeneralParameterValue[1])));
      assertTrue(CoverageUtilities.hasRenderingCategories(gc));
      if(TestData.isInteractiveTest())
      {
//         logging some info
View Full Code Here

TOP

Related Classes of org.geotools.coverage.grid.GridEnvelope2D

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.