Package org.geotools.coverage.grid

Examples of org.geotools.coverage.grid.GridCoverageFactory.create()


        WritableRaster writableRaster = createWritableRasterFromMatrix(dataMatrix, matrixIsRowCol);

        Envelope2D writeEnvelope = new Envelope2D(crs, w, s, e - w, n - s);
        GridCoverageFactory factory = CoverageFactoryFinder.getGridCoverageFactory(GeoTools.getDefaultHints());

        GridCoverage2D coverage2D = factory.create(name, writableRaster, writeEnvelope);
        return coverage2D;
    }
    /**
     * Create a {@link WritableRaster} from a double matrix.
     *
 
View Full Code Here


      bands[i] = new GridSampleDimension("band " + i);
    }
    final String filename = new File(path).getName();
    final GridCoverageFactory factory = org.geotools.coverage.CoverageFactoryFinder.getGridCoverageFactory(GeoTools.getDefaultHints());
    envelope.setCoordinateReferenceSystem(crs);
    return factory.create(filename, image, envelope,bands, null, null);
  }

  /**
   * Returns a projected CRS for test purpose.
   */
 
View Full Code Here

        g2eMapper.setPixelAnchor(cellAnchor);
        MathTransform gridToEnvelopeTransform = g2eMapper.createTransform();
        GridCoverageFactory factory = CoverageFactoryFinder.getGridCoverageFactory(GeoTools.getDefaultHints());

        GridCoverage2D coverage2D = factory.create(name, finalImage, crs, gridToEnvelopeTransform,
                new GridSampleDimension[]{band}, null, null);
        return coverage2D;

    }
View Full Code Here

        if (pixelsPerCell > 1)
            outGrid = upsample(barnesGrid, noDataValue, outputWidth, outputHeight);
       
        // convert to the GridCoverage2D required for output
        GridCoverageFactory gcf = CoverageFactoryFinder.getGridCoverageFactory(GeoTools.getDefaultHints());
        GridCoverage2D gridCov = gcf.create("values", outGrid, outputEnv);
       
        //System.out.println("**************  Barnes Surface computed in " + sw.getTimeString());
       
        return gridCov;
    }   
View Full Code Here

        monitor.complete();

        flattenImage();
       
        GridCoverageFactory gcf = new GridCoverageFactory();
        return gcf.create(covName, image, extent);
    }

    private void initialize(SimpleFeatureCollection features,
            Envelope bounds, Object attribute, Dimension gridDim ) throws VectorToRasterException {
View Full Code Here

        if (pixelsPerCell > 1)
            outGrid = upsample(heatMapGrid, -999, outputWidth, outputHeight);

        // convert to the GridCoverage2D required for output
        GridCoverageFactory gcf = CoverageFactoryFinder.getGridCoverageFactory(GeoTools.getDefaultHints());
        GridCoverage2D gridCov = gcf.create("Process Results", outGrid, argOutputEnv);

        // System.out.println("**************  Heatmap computed in " + sw.getTimeString());

        return gridCov;
    }
View Full Code Here

      GeneralEnvelope env = new GeneralEnvelope(min, max);   
      env.setCoordinateReferenceSystem(crs);
     
      Hints k;
      GridCoverageFactory fac = new GridCoverageFactory();
       GridCoverage2D cov = fac.create("sd", g, env);
      
     
      // Generate some known points to root the interpolation
      DirectPosition a = new DirectPosition2D(crs,10,10);
      DirectPosition b = new DirectPosition2D(crs,80,80);
View Full Code Here

      TPSInterpolation interp = new TPSInterpolation(pointsAndValues, 100, 100, env);


       // We can create and show a coverage image of the interpolation within the Envelope
      GridCoverageFactory gcf = new GridCoverageFactory();
      GridCoverage2D coverage = gcf.create("Intepolated Coverage",  interp.get2DGrid(), env);//.show();
     
     
      //Assert.assertEquals( Double.parseDouble((coverage.evaluate(a, (Set)(new HashSet())).iterator().next()).toString()), pointsAndValues.get(a).floatValue(), 0.01);
      Assert.assertEquals( coverage.evaluate(a, new float[1])[0], pointsAndValues.get(a).floatValue(), 0.01);
     
View Full Code Here

   
    ReferencedEnvelope referencedEnvelope = null;
    BufferedImage bufferedImage = null;
    // exampleGridCoverageFactory start
    GridCoverageFactory factory = new GridCoverageFactory();
    GridCoverage2D coverage = factory.create("GridCoverage", bufferedImage, referencedEnvelope);
    // exampleGridCoverageFactory end
}


@SuppressWarnings("unused")
View Full Code Here

        g.dispose();
       
        // build a coverage around it
        CoordinateReferenceSystem wgs84LatLon = CRS.decode("EPSG:4326");
        final GridCoverageFactory factory = CoverageFactoryFinder.getGridCoverageFactory(null);
        GridCoverage2D coverage = factory.create("translated", ti, new Envelope2D(wgs84LatLon, 3, 5, 6, 8));
       
        // verify we're good
        int[] pixel = new int[3];
        coverage.evaluate((DirectPosition) new DirectPosition2D(4, 6), pixel);
        assertEquals(0, pixel[0]);
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.