Examples of CoverageProperties


Examples of org.geotools.coverage.io.SpatialRequestHelper.CoverageProperties

        Envelope envelope = new ReferencedEnvelope(-180, 180, -85, 85, DefaultGeographicCRS.WGS84);
        // Creation of a dummy GridCoverage 2D
        coverage = new GridCoverageFactory(GeoTools.getDefaultHints()).create("testCoverage",
                image, envelope);
        // Properties
        coverageProperties = new CoverageProperties();
        coverageProperties.setBbox(new ReferencedEnvelope(coverage.getEnvelope2D()));
        coverageProperties.setCrs2D(coverage.getCoordinateReferenceSystem2D());
        coverageProperties.setFullResolution(CoverageUtilities
                .getResolution((AffineTransform) coverage.getGridGeometry().getGridToCRS2D(
                        PixelOrientation.UPPER_LEFT)));
View Full Code Here

Examples of org.geotools.coverage.io.SpatialRequestHelper.CoverageProperties

        ReferencedEnvelope envelope = new ReferencedEnvelope(-180, 0, -90, 90,
                coverageProperties.getGeographicCRS2D());
        // Creation of a dummy GridCoverage 2D
        GridCoverage2D coverage2 = new GridCoverageFactory(GeoTools.getDefaultHints()).create(
                "testCoverage", image, envelope);
        CoverageProperties coverageProperties2 = new CoverageProperties();
        coverageProperties2.setBbox(new ReferencedEnvelope(coverage2.getEnvelope2D()));
        coverageProperties2.setCrs2D(coverage2.getCoordinateReferenceSystem2D());
        coverageProperties2.setFullResolution(CoverageUtilities
                .getResolution((AffineTransform) coverage2.getGridGeometry().getGridToCRS2D(
                        PixelOrientation.UPPER_LEFT)));
        coverageProperties2.setRasterArea(coverage2.getGridGeometry().getGridRange2D());
        coverageProperties2.setGeographicBBox(new ReferencedEnvelope(coverage2.getEnvelope2D()));
        coverageProperties2.setGeographicCRS2D(coverage2.getCoordinateReferenceSystem2D());
        coverageProperties2.setGridToWorld2D(coverage2.getGridGeometry().getGridToCRS2D(
                PixelOrientation.UPPER_LEFT));
        // Final GridGeometry
        GridEnvelope2D gridRange = new GridEnvelope2D(0, 0, 1024, 1024);
        ReferencedEnvelope envelope2 = new ReferencedEnvelope(1, 180, -90, 90,
                coverageProperties.getGeographicCRS2D());
View Full Code Here

Examples of org.geotools.coverage.io.SpatialRequestHelper.CoverageProperties

     */
    private void initTransformations() throws Exception {
        //compute final world to grid
        // base grid to world for the center of pixels
        final AffineTransform g2w;
        CoverageProperties properties = request.spatialRequestHelper.getCoverageProperties();
        baseGridToWorld = (AffineTransform) properties.getGridToWorld2D();
        double[] coverageFullResolution = properties.getFullResolution();
        final double resX = coverageFullResolution[0];
        final double resY = coverageFullResolution[1];
        final double[] requestRes = request.spatialRequestHelper.getRequestedResolution();

        g2w = new AffineTransform((AffineTransform) baseGridToWorld);
View Full Code Here

Examples of org.geotools.coverage.io.SpatialRequestHelper.CoverageProperties

        final ReferencedEnvelope referencedEnvelope = new ReferencedEnvelope(bbox);
        final CoordinateReferenceSystem spatialReferenceSystem2D = spatialDomain.getCoordinateReferenceSystem2D();
        rasterArea = rasterElements.iterator().next().toRectangle();

        // Setting up Coverage info
        final CoverageProperties properties = new CoverageProperties();
        properties.setCrs2D(spatialReferenceSystem2D);
        properties.setFullResolution(coverageFullResolution);
       
        // Note that currently, we only support geographic CRS
        properties.setBbox(referencedEnvelope);
        properties.setGeographicBBox(referencedEnvelope);
        properties.setGeographicCRS2D(spatialReferenceSystem2D);
        properties.setGridToWorld2D((MathTransform2D)raster2Model);
        properties.setRasterArea(rasterArea);
        spatialRequestHelper.setCoverageProperties(properties);
        spatialRequestHelper.prepare();
}
View Full Code Here

Examples of org.geotools.gce.imagemosaic.SpatialRequestHelper.CoverageProperties

        // Setting default parameters
        //
        // //
        this.rasterManager = rasterManager;
        this.heterogeneousGranules = rasterManager.heterogeneousGranules;
        CoverageProperties coverageProperties = new CoverageProperties();
        coverageProperties.setBBox(rasterManager.spatialDomainManager.coverageBBox);
        coverageProperties.setRasterArea(rasterManager.spatialDomainManager.coverageRasterArea);
        coverageProperties.setFullResolution(rasterManager.spatialDomainManager.coverageFullResolution);
        coverageProperties.setGridToWorld2D(rasterManager.spatialDomainManager.coverageGridToWorld2D);
        coverageProperties.setCrs2D(rasterManager.spatialDomainManager.coverageCRS2D);
        coverageProperties.setGeographicBBox(rasterManager.spatialDomainManager.coverageGeographicBBox);
        coverageProperties.setGeographicCRS2D(rasterManager.spatialDomainManager.coverageGeographicCRS2D);
        this.spatialRequestHelper = new SpatialRequestHelper(coverageProperties);
        setDefaultParameterValues();

        // //
        //
View Full Code Here

Examples of org.geotools.gce.imagemosaic.SpatialRequestHelper.CoverageProperties

   */
    @Test
    public void testNoRequest() throws Exception {
     
      // using CoverageProperties to build the SpatialRequestHelper
        CoverageProperties coverageProperties = new CoverageProperties();

        // source area in project crs
        CoordinateReferenceSystem sourceCRS =DefaultGeographicCRS.WGS84;
    ReferencedEnvelope sourceBBox = new ReferencedEnvelope(
            -180,180,
            -90,90,
            sourceCRS);
    coverageProperties.setBBox(sourceBBox);
        coverageProperties.setCrs2D(sourceCRS);
   
    //raster area
        Rectangle sourceRasterArea = new Rectangle(0,0,1000,1000);
    coverageProperties.setRasterArea(sourceRasterArea);

    // creating the g2d
        final GridToEnvelopeMapper geMapper = new GridToEnvelopeMapper(
            new GridEnvelope2D(sourceRasterArea),
            sourceBBox);
        AffineTransform sourceGridToWorldTransform = geMapper.createAffineTransform();
    coverageProperties.setGridToWorld2D((MathTransform2D) sourceGridToWorldTransform);
        coverageProperties.setFullResolution(new double[]{
            XAffineTransform.getScaleX0(sourceGridToWorldTransform),
            XAffineTransform.getScaleY0(sourceGridToWorldTransform),
            });
        coverageProperties.setGeographicBBox(sourceBBox);
        coverageProperties.setGeographicCRS2D(DefaultGeographicCRS.WGS84);
        SpatialRequestHelper spatialRequestHelper = new SpatialRequestHelper(coverageProperties);
       
        //
        // no target request
        //
View Full Code Here

Examples of org.geotools.gce.imagemosaic.SpatialRequestHelper.CoverageProperties

   */
    @Test
    public void testBasic2() throws Exception {
     
      // using CoverageProperties to build the SpatialRequestHelper
        CoverageProperties coverageProperties = new CoverageProperties();

        // source area in project crs
        CoordinateReferenceSystem sourceCRS = DefaultGeographicCRS.WGS84;
    ReferencedEnvelope sourceBBox = new ReferencedEnvelope(
            -180,180,
            -90,90,
            sourceCRS);
    coverageProperties.setBBox(sourceBBox);
        coverageProperties.setCrs2D(sourceCRS);
   
    //raster area
        Rectangle sourceRasterArea = new Rectangle(0,0,1000,1000);
    coverageProperties.setRasterArea(sourceRasterArea);

    // creating the g2d
        final GridToEnvelopeMapper geMapper = new GridToEnvelopeMapper(
            new GridEnvelope2D(sourceRasterArea),
            sourceBBox);
        AffineTransform sourceGridToWorldTransform = geMapper.createAffineTransform();
    coverageProperties.setGridToWorld2D((MathTransform2D) sourceGridToWorldTransform);
        coverageProperties.setFullResolution(new double[]{
            XAffineTransform.getScaleX0(sourceGridToWorldTransform),
            XAffineTransform.getScaleY0(sourceGridToWorldTransform)
            });
        coverageProperties.setGeographicBBox(sourceBBox);
        coverageProperties.setGeographicCRS2D(DefaultGeographicCRS.WGS84);
        SpatialRequestHelper spatialRequestHelper = new SpatialRequestHelper(coverageProperties);
       
        //
        // now the target request
        //
View Full Code Here

Examples of org.geotools.gce.imagemosaic.SpatialRequestHelper.CoverageProperties

   */
    @Test
    public void testBasic3() throws Exception {
     
      // using CoverageProperties to build the SpatialRequestHelper
        CoverageProperties coverageProperties = new CoverageProperties();

        // source area in project crs
        CoordinateReferenceSystem sourceCRS = DefaultGeographicCRS.WGS84;
    ReferencedEnvelope sourceBBox = new ReferencedEnvelope(
            -180,100,
            -20,90,
            sourceCRS);
    coverageProperties.setBBox(sourceBBox);
        coverageProperties.setCrs2D(sourceCRS);
   
    //raster area
        Rectangle sourceRasterArea = new Rectangle(0,0,1000,1000);
    coverageProperties.setRasterArea(sourceRasterArea);

    // creating the g2d
        final GridToEnvelopeMapper geMapper = new GridToEnvelopeMapper(
            new GridEnvelope2D(sourceRasterArea),
            sourceBBox);
        AffineTransform sourceGridToWorldTransform = geMapper.createAffineTransform();
    coverageProperties.setGridToWorld2D((MathTransform2D) sourceGridToWorldTransform);
        coverageProperties.setFullResolution(new double[]{
            XAffineTransform.getScaleX0(sourceGridToWorldTransform),
            XAffineTransform.getScaleY0(sourceGridToWorldTransform)
            });
        coverageProperties.setGeographicBBox(sourceBBox);
        coverageProperties.setGeographicCRS2D(DefaultGeographicCRS.WGS84);
        SpatialRequestHelper spatialRequestHelper = new SpatialRequestHelper(coverageProperties);
       
        //
        // now the target request
        //
View Full Code Here

Examples of org.geotools.gce.imagemosaic.SpatialRequestHelper.CoverageProperties

   
    @Test
    public void testReprojectQuick() throws Exception {
     
      // using CoverageProperties to build the SpatialRequestHelper
        CoverageProperties coverageProperties = new CoverageProperties();

        // source area in project crs
        CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:27700");
    ReferencedEnvelope sourceBBox = new ReferencedEnvelope(
            414000,420000,
            237000,301000,
            sourceCRS);
    coverageProperties.setBBox(sourceBBox);
        coverageProperties.setCrs2D(sourceCRS);
   
    //raster area
        Rectangle sourceRasterArea = new Rectangle(0,0,1000,1000);
    coverageProperties.setRasterArea(sourceRasterArea);

    // creating the g2d
        final GridToEnvelopeMapper geMapper = new GridToEnvelopeMapper(
            new GridEnvelope2D(sourceRasterArea),
            sourceBBox);

        AffineTransform sourceGridToWorldTransform = geMapper.createAffineTransform();
    coverageProperties.setGridToWorld2D((MathTransform2D) sourceGridToWorldTransform);
        coverageProperties.setFullResolution(new double[]{
            XAffineTransform.getScaleX0(sourceGridToWorldTransform),
            XAffineTransform.getScaleY0(sourceGridToWorldTransform)
            });
        coverageProperties.setGeographicBBox(new ReferencedEnvelope(
            -1.7973440460762267,-1.7061039437509753,
            52.03105268214016,52.60660481087451,
            DefaultGeographicCRS.WGS84));
        coverageProperties.setGeographicCRS2D(DefaultGeographicCRS.WGS84);
        SpatialRequestHelper spatialRequestHelper = new SpatialRequestHelper(coverageProperties);
       
        // now the target request
        spatialRequestHelper.setAccurateResolution(false);
        spatialRequestHelper.setRequestedGridGeometry(new GridGeometry2D(
View Full Code Here

Examples of org.geotools.gce.imagemosaic.SpatialRequestHelper.CoverageProperties

   */
    @Test
    public void testBasicReproject() throws Exception {
     
      // using CoverageProperties to build the SpatialRequestHelper
        CoverageProperties coverageProperties = new CoverageProperties();

        // source area in project crs
        CoordinateReferenceSystem sourceCRS =DefaultGeographicCRS.WGS84;
    ReferencedEnvelope sourceBBox = new ReferencedEnvelope//Italy?
            8,11,
            42,44,
            sourceCRS);
    coverageProperties.setBBox(sourceBBox);
        coverageProperties.setCrs2D(sourceCRS);
   
    //raster area
        Rectangle sourceRasterArea = new Rectangle(0,0,1000,1000);
    coverageProperties.setRasterArea(sourceRasterArea);

    // creating the g2d
        final GridToEnvelopeMapper geMapper = new GridToEnvelopeMapper(
            new GridEnvelope2D(sourceRasterArea),
            sourceBBox);
        AffineTransform sourceGridToWorldTransform = geMapper.createAffineTransform();
    coverageProperties.setGridToWorld2D((MathTransform2D) sourceGridToWorldTransform);
        coverageProperties.setFullResolution(new double[]{
            XAffineTransform.getScaleX0(sourceGridToWorldTransform),
            XAffineTransform.getScaleY0(sourceGridToWorldTransform)
            });
        coverageProperties.setGeographicBBox(sourceBBox);
        coverageProperties.setGeographicCRS2D(DefaultGeographicCRS.WGS84);
        SpatialRequestHelper spatialRequestHelper = new SpatialRequestHelper(coverageProperties);
       
        //
        // now the request
        //
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.