Package org.geotools.referencing.operation.builder

Examples of org.geotools.referencing.operation.builder.GridToEnvelopeMapper.createTransform()


                        GridToEnvelopeMapper g2eMapper = new GridToEnvelopeMapper();
                        g2eMapper.setEnvelope(referencedEnvelope);
                        GridEnvelope2D gridEnvelope2D = new GridEnvelope2D(0, 0, (int) cols, (int) rows);
                        g2eMapper.setGridRange(gridEnvelope2D);
                        g2eMapper.setPixelAnchor(PixelInCell.CELL_CENTER);
                        MathTransform gridToEnvelopeTransform = g2eMapper.createTransform();

                        GridGeometry outputGridGeometry = new GridGeometry2D(gridEnvelope2D, gridToEnvelopeTransform, crs);

                        GridCoverage2D coverage2D = JGrassCatalogUtilities.getGridcoverageFromGrassraster(jgMEnv, sourceRegion);
                        // GrassCoverageReadParam gcReadParam = new
View Full Code Here


        // create a raster to model transform, from this tile pixel space to the tile's geographic
        // extent
        GridToEnvelopeMapper geMapper = new GridToEnvelopeMapper(levelGridRange, levelEnvelope);
        geMapper.setPixelAnchor(PixelInCell.CELL_CORNER);

        MathTransform rasterToModel = geMapper.createTransform();
        return rasterToModel;
    }

    /**
     * @param pixelAnchor
View Full Code Here

        //
        // ///
        highestRes = getResolution(originalEnvelope, actualDim, crs);
        final GridToEnvelopeMapper mapper = new GridToEnvelopeMapper(originalGridRange, originalEnvelope);
        mapper.setPixelAnchor(PixelInCell.CELL_CENTER);
        this.raster2Model=mapper.createTransform();

      }


    }
View Full Code Here

              (int) Math.round(originalEnvelope.getSpan(1)/ highestRes[1])
              )
          );
      final GridToEnvelopeMapper geMapper= new GridToEnvelopeMapper(originalGridRange,originalEnvelope);
      geMapper.setPixelAnchor(PixelInCell.CELL_CORNER);
      raster2Model= geMapper.createTransform();
     
             if(LOGGER.isLoggable(Level.FINE)){
                    LOGGER.fine("Parsed pyramid properties file at:"+sourceURL.toExternalForm());
             }
    }  finally {
View Full Code Here

            synchronized (this) {
                if (coverageGridToWorld2D == null) {
                    final GridToEnvelopeMapper geMapper = new GridToEnvelopeMapper(gridEnvelope,
                            coverageEnvelope);
                    geMapper.setPixelAnchor(PixelInCell.CELL_CENTER);
                    coverageGridToWorld2D = (MathTransform2D) geMapper.createTransform();
                }
            }

            // we do not have to change the pixel datum
            if (pixInCell == PixelInCell.CELL_CENTER)
View Full Code Here

        GridToEnvelopeMapper g2eMapper = new GridToEnvelopeMapper();
        g2eMapper.setEnvelope(requestedRegionEnvelope);
        g2eMapper.setGridRange(new GridEnvelope2D(0, 0, requestedCols, requestedRows));

        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

        synchronized (this) {
            if (raster2Model == null) {
                final GridToEnvelopeMapper geMapper = new GridToEnvelopeMapper(
                        getOriginalGridRange(coverageName), getOriginalEnvelope(coverageName));
                geMapper.setPixelAnchor(PixelInCell.CELL_CENTER);
                raster2Model = geMapper.createTransform();
            }
        }

        // we do not have to change the pixel datum
        if (pixInCell == PixelInCell.CELL_CENTER)
View Full Code Here

        // transform (instead of creating a new one) if the grid
        // and envelope are the same one than during last invocation.
        final GridToEnvelopeMapper m = (GridToEnvelopeMapper) gridToEnvelopeMappers.get();
        m.setGridRange(new GridEnvelope2D(paintArea));
        m.setEnvelope(newEnvelope);
        return (AffineTransform) (m.createTransform().inverse());


  }
 
  /**
 
View Full Code Here

              if (transform == null){
                 final GridToEnvelopeMapper geMapper = new GridToEnvelopeMapper();
                     geMapper.setEnvelope(envelope);
                     geMapper.setGridRange(new GridEnvelope2D(gridRange));
                     geMapper.setPixelAnchor(PixelInCell.CELL_CORNER);
                     transform = (AffineTransform) geMapper.createTransform();
              }
              tempTransform = (AffineTransform) transform.clone();
              break;
            case TeraScan:
              if (transform == null){
View Full Code Here

        final GridToEnvelopeMapper mapper = new GridToEnvelopeMapper(gridRange, userRange);
        if (!automatic) {
            mapper.setReverseAxis(reverse);
            mapper.setSwapXY(swapXY);
        }
        gridToCRS = mapper.createTransform();
    }

    /**
     * Clones the given grid range if necessary. This is mostly a protection for {@link GridRange2D}
     * which is mutable, at the opposite of {@link GeneralGridRange} which is immutable. We test for
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.