Package org.opengis.coverage

Examples of org.opengis.coverage.Coverage


    // resample the new image with the world CRS
    GridCoverage2D warpedCoverage = null;
    try {
      Operations ops = new Operations(null);
      Coverage resample = ops.resample(coverage, this.crsTarget);
      warpedCoverage = (GridCoverage2D) resample;
      saveImage(warpedCoverage);

    } catch (Exception e) {
     
View Full Code Here


        return bandSelect(coverage, bands);
    }

    public static Coverage bandSelect(final GridCoverage coverage, final int[] bands) {
        Coverage bandSelectedCoverage;

        if ((bands != null) && (bands.length > 0)) {
            /* Operations.DEFAULT.selectSampleDimension(coverage, bands) */
            final ParameterValueGroup param = (ParameterValueGroup) bandSelectParams.clone();
            param.parameter("Source").setValue(coverage);
View Full Code Here

        }

        /**
         * Band Select
         */
        Coverage bandSelectedCoverage = null;

        bandSelectedCoverage = WCSUtils.bandSelect(request.getParameters(), coverage);

        /**
         * Crop
 
View Full Code Here

    }

    @Override
    public void buildGraph(Graph graph, HashMap<Class<?>, Object> extra) {
        gridCoverageFactory.setGraph(graph);
        Coverage gridCov = gridCoverageFactory.getGridCoverage();

        // If gridCov is a GridCoverage2D, apply a bilinear interpolator. Otherwise, just use the
        // coverage as is (note: UnifiedGridCoverages created by NEDGridCoverageFactoryImpl handle
        // interpolation internally)
        coverage = (gridCov instanceof GridCoverage2D) ? Interpolator2D.create(
View Full Code Here

   * @return The result as a coverage.
   * @throws OperationNotFoundException if there is no operation for the parameter group name.
   */
  @SuppressWarnings("unchecked")
  public Coverage doOperation(final ParameterValueGroup parameters, final Hints hints){
    Coverage source = getPrimarySource(parameters);
      final String operationName = getOperationName(parameters);
      final Operation  operation = getOperation(operationName);
      /*
       * Detects the interpolation type for the source grid coverage.
       * The same interpolation will be applied on the result.
       */
      Interpolation[] interpolations = null;
      if (!operationName.equalsIgnoreCase("Interpolate")) {
          for (final GeneralParameterValue param : parameters.values()) {
              if (param instanceof ParameterValue) {
                  final Object value = ((ParameterValue) param).getValue();
                  if (value instanceof Interpolator2D) {
                      // If all sources use the same interpolation, preserves the
                      // interpolation for the resulting coverage. Otherwise, uses
                      // the default interpolation (nearest neighbor).
                      final Interpolation[] interp = ((Interpolator2D) value).getInterpolations();
                      if (interpolations == null) {
                          interpolations = interp;
                      } else if (!Arrays.equals(interpolations, interp)) {
                          // Set to no interpolation.
                          interpolations = null;
                          break;
                      }
                  }
              }
          }
      }
      /*
       * Applies the operation, applies the same interpolation and log a message.
       * Note: we don't use "if (operation instanceof AbstractOperation)" below
       *       because if it is not, we want the ClassCastException as the cause
       *       for the failure.
       */
      final AbstractOperation op;
      try {
          op = (AbstractOperation) operation;
      } catch (ClassCastException cause) {
          final OperationNotFoundException exception = new OperationNotFoundException(
                      Errors.getResources(getLocale()).getString(
                      ErrorKeys.OPERATION_NOT_FOUND_$1, operationName));
          exception.initCause(cause);
          throw exception;
      }
     
      //set up hints
      final Hints localMergeHints=this.hints.clone();
      if(hints!=null)
        localMergeHints.add(hints);
     
      // processwith local hints
      Coverage coverage = op.doOperation(parameters, localMergeHints);
      if (interpolations != null && (coverage instanceof GridCoverage2D) &&
                                   !(coverage instanceof Interpolator2D)){
          coverage = Interpolator2D.create((GridCoverage2D) coverage, interpolations);
      }
      log(source, coverage, operationName, false);
View Full Code Here

        return bandSelect(coverage, bands);
    }

    public static Coverage bandSelect(final GridCoverage coverage, final int[] bands) {
        Coverage bandSelectedCoverage;

        if ((bands != null) && (bands.length > 0)) {
            /* Operations.DEFAULT.selectSampleDimension(coverage, bands) */
            final ParameterValueGroup param = (ParameterValueGroup) bandSelectParams.clone();
            param.parameter("Source").setValue(coverage);
View Full Code Here

        return bandSelect(coverage, bands);
    }

    public static Coverage bandSelect(final GridCoverage coverage, final int[] bands) {
        Coverage bandSelectedCoverage;

        if ((bands != null) && (bands.length > 0)) {
            /* Operations.DEFAULT.selectSampleDimension(coverage, bands) */
            final ParameterValueGroup param = (ParameterValueGroup) bandSelectParams.clone();
            param.parameter("Source").setValue(coverage);
View Full Code Here

TOP

Related Classes of org.opengis.coverage.Coverage

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.