Package org.opengis.coverage.processing

Examples of org.opengis.coverage.processing.Operation


   * Implementation of {@link #addOperation} method. Also used by {@link #scanForPlugins}
   * instead of the public method in order to avoid never-ending loop.
   */
  private void addOperation0(final Operation operation) throws IllegalStateException {
      final String name = operation.getName().trim();
      final Operation old = operations.put(name, operation);
      if (old!=null && !old.equals(operation)) {
          operations.put(old.getName().trim(), old);
          throw new IllegalStateException(Errors.getResources(getLocale()).getString(
                    ErrorKeys.OPERATION_ALREADY_BOUND_$1, operation.getName()));
      }
  }
View Full Code Here


        synchronized (operations) {
         
          if (operations.isEmpty()) {
              scanForPlugins();
          }
          final Operation operation = operations.get(name);
          if (operation != null) {
              return operation;
          }
          throw new OperationNotFoundException(Errors.getResources(getLocale()).getString(
                  ErrorKeys.OPERATION_NOT_FOUND_$1, name));
View Full Code Here

   */
  @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;
View Full Code Here

  public void scanForPlugins() {
    synchronized (operations) {
     
        final Iterator<Operation> it = registry.getServiceProviders(Operation.class, null, null);
        while (it.hasNext()) {
            final Operation operation = it.next();
            final String name = operation.getName().trim();
            if (!operations.containsKey(name)) {
                addOperation0(operation);
            }
        }
    }
View Full Code Here

            return coverage;
        }

        // reproject
        final CoverageProcessor processor=hints==null?CoverageProcessor.getInstance():CoverageProcessor.getInstance(hints);
        final Operation operation = processor.getOperation("Resample");
        final ParameterValueGroup parameters = operation.getParameters();
        parameters.parameter("Source").setValue(coverage);
        parameters.parameter("CoordinateReferenceSystem").setValue(targetCRS);
        parameters.parameter("GridGeometry").setValue(null);
        parameters.parameter("InterpolationType").setValue(spatialInterpolation);
        return (GridCoverage2D) processor.doOperation(parameters);
View Full Code Here

             // NO SCALING do we need interpolation?
            if(spatialInterpolation instanceof InterpolationNearest){
                return coverage;
            } else {
                // interpolate coverage if requested and not nearest!!!!        
                final Operation operation = CoverageProcessor.getInstance().getOperation("Warp");
                final ParameterValueGroup parameters = operation.getParameters();
                parameters.parameter("Source").setValue(coverage);
                parameters.parameter("warp").setValue(new WarpAffine(AffineTransform.getScaleInstance(1, 1)));//identity
                parameters.parameter("interpolation").setValue(spatialInterpolation!=null?spatialInterpolation:InterpolationPolicy.getDefaultPolicy().getInterpolation());
                parameters.parameter( "backgroundValues").setValue(CoverageUtilities.getBackgroundValues(coverage));// TODO check and improve
                return (GridCoverage2D) CoverageProcessor.getInstance().doOperation(parameters,hints);
View Full Code Here

TOP

Related Classes of org.opengis.coverage.processing.Operation

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.