Package org.geotools.parameter

Examples of org.geotools.parameter.Parameter


     * Returns the parameters for this math transform.
     */
    @Override
    public ParameterValueGroup getParameterValues() {
        return new ParameterGroup(getParameterDescriptors(),
               new ParameterValue[] {new Parameter(Provider.ORDER, nmax)});
    }
View Full Code Here


      final String grassParam = ArcGridFormat.GRASS.getName().getCode().toString();
      final String cellSizeParam = ArcGridFormat.FORCE_CELLSIZE
          .getName().getCode().toString();
      if (parameters != null) {
        for (int i = 0; i < parameters.length; i++) {
          Parameter param = (Parameter) parameters[i];
          String name = param.getDescriptor().getName().toString();
          if (param.getDescriptor().getName().getCode().equals(
              AbstractGridFormat.GEOTOOLS_WRITE_PARAMS.getName()
                  .toString())) {
            gtParams = (GeoToolsWriteParams) param.getValue();
          }
          if (name.equalsIgnoreCase(grassParam))
            grass = param.booleanValue();
          if (name.equalsIgnoreCase(cellSizeParam))
            forceCellSize = param.booleanValue();
        }
      }
      if (gtParams == null)
        gtParams = new ArcGridWriteParams();
      // write band
      int[] writeBands = gtParams.getSourceBands();
      writeBand = CoverageUtilities.getVisibleBand(gc.getRenderedImage());
      if ((writeBands == null || writeBands.length == 0 || writeBands.length > 1)
          && (writeBand < 0 || writeBand > gc
              .getNumSampleDimensions()))
        throw new IllegalArgumentException(
            "You need to supply a valid index for deciding which band to write.");
      if (!((writeBands == null || writeBands.length == 0 || writeBands.length > 1)))
        writeBand = writeBands[0];

      // /////////////////////////////////////////////////////////////////
      //
      // Getting CRS and envelope information
      //
      // /////////////////////////////////////////////////////////////////
      final CoordinateReferenceSystem crs = gc.getCoordinateReferenceSystem2D();

      // /////////////////////////////////////////////////////////////////
      //
      // getting visible band, if needed
      // /////////////////////////////////////////////////////////////////
      final int numBands = gc.getNumSampleDimensions();
      if (numBands > 1) {
        final int visibleBand;
        if (writeBand > 0 && writeBand < numBands)
          visibleBand = writeBand;
        else
          visibleBand = CoverageUtilities.getVisibleBand(gc);

        final ParameterValueGroup param = (ParameterValueGroup) ArcGridWriter.bandSelectParams
            .clone();
        param.parameter("source").setValue(gc);
        param.parameter("SampleDimensions").setValue(
            new int[] { visibleBand });
        gc = (GridCoverage2D) bandSelectFactory
            .doOperation(param, null);
      }
      // /////////////////////////////////////////////////////////////////
View Full Code Here

    return getChosenOverview(size, wiReader, null);
  }
    private int getChosenOverview(final int size, WorldImageReader wiReader,
      ParameterValue policy) throws IOException {
    // get the coverage and then the rendered image
    final Parameter readGG = new Parameter(
        AbstractGridFormat.READ_GRIDGEOMETRY2D);

    readGG.setValue(new GridGeometry2D(new GridEnvelope2D(
        new java.awt.Rectangle(size, (int) (164.0 / 125.0 * size))),
        new ReferencedEnvelope(118.8, 134.56, 47.819, 63.142,
            DefaultGeographicCRS.WGS84)));
    final GridCoverage2D coverage = (GridCoverage2D) wiReader
        .read(policy != null ? new GeneralParameterValue[] { readGG,
View Full Code Here

            //
            // Checking params
            //
            // /////////////////////////////////////////////////////////////////////
            if (params != null) {
                Parameter param;
                final int length = params.length;
                for (int i = 0; i < length; i++) {
                    param = (Parameter) params[i];
                    if (param.getDescriptor().getName().getCode().equals(
                            AbstractGridFormat.GEOTOOLS_WRITE_PARAMS.getName()
                                    .toString())) {
                        gtParams = (GeoToolsWriteParams) param.getValue();
                    }
                }
            }
        }
        if (gtParams == null)
View Full Code Here

    public ParameterValueGroup getParameterValues() {
        if (this.warp instanceof WarpGrid) {
           // final WarpGrid wGrid = (WarpGrid) warp;
            final ParameterValue[] p = new ParameterValue[7];
            int c = 0;
            p[c++] = new Parameter(Provider.X_START, ((WarpGrid) getWarp()).getXStart()); //new Integer(((WarpGrid)super.getWarp()).getXStart()));
            p[c++] = new Parameter(Provider.X_STEP, ((WarpGrid) getWarp()).getXStep());
            p[c++] = new Parameter(Provider.X_NUMCELLS, ((WarpGrid) getWarp()).getXNumCells());
            p[c++] = new Parameter(Provider.Y_START, ((WarpGrid) getWarp()).getYStart());
            p[c++] = new Parameter(Provider.Y_STEP, ((WarpGrid) getWarp()).getYStep());
            p[c++] = new Parameter(Provider.Y_NUMCELLS, ((WarpGrid) getWarp()).getYNumCells());

            p[c++] = new Parameter(Provider.WARP_POSITIONS, (Object) this.warpPositions.clone());

            return new ParameterGroup(getParameterDescriptors(),
                (ParameterValue[]) XArray.resize(p, c));
        } else {
            return super.getParameterValues();
View Full Code Here

     *
     * @return A copy of the parameter values for this math transform.
     */
    @Override
    public ParameterValueGroup getParameterValues() {
        final ParameterValue lat_diff_file = new Parameter(Provider.LAT_DIFF_FILE);
        lat_diff_file.setValue(latGridName);

        final ParameterValue long_diff_file = new Parameter(Provider.LONG_DIFF_FILE);
        long_diff_file.setValue(longGridName);

        return new ParameterGroup(getParameterDescriptors(),
            new GeneralParameterValue[] { lat_diff_file, long_diff_file }
        );
    }
View Full Code Here

    public ParameterValueGroup getParameterValues() {
        if (warp instanceof WarpPolynomial) {
            final WarpPolynomial poly = (WarpPolynomial) warp;
            final ParameterValue[] p = new ParameterValue[7];
            int c = 0;
            p[c++] = new Parameter(Provider.DEGREE,   Integer.valueOf(poly.getDegree()));
            p[c++] = new Parameter(Provider.X_COEFFS, poly.getXCoeffs());
            p[c++] = new Parameter(Provider.Y_COEFFS, poly.getYCoeffs());
            float s;
            if ((s=poly.getPreScaleX ()) != 1) p[c++] = new Parameter(Provider. PRE_SCALE_X, s);
            if ((s=poly.getPreScaleY ()) != 1) p[c++] = new Parameter(Provider. PRE_SCALE_Y, s);
            if ((s=poly.getPostScaleX()) != 1) p[c++] = new Parameter(Provider.POST_SCALE_X, s);
            if ((s=poly.getPostScaleY()) != 1) p[c++] = new Parameter(Provider.POST_SCALE_Y, s);
            return new ParameterGroup(getParameterDescriptors(), XArray.resize(p, c));
        } else {
            return super.getParameterValues();
        }
    }
View Full Code Here

        if (queryRect.isEmpty()) {
            return false;
        }

        final GridCoverage2DReader reader = sourceRef.get();
        GeneralParameterValue parameter = new Parameter(
                AbstractGridFormat.READ_GRIDGEOMETRY2D,
                new GridGeometry2D(new GridEnvelope2D(queryRect),
                reader.getOriginalGridToWorld(PixelInCell.CELL_CENTER),
                reader.getCoordinateReferenceSystem()));
       
View Full Code Here

                protected Object valueOf(String text) throws IOException {
                    return param.handle( text );
                }
            };
        }
        return new Parameter(this){
            protected Object valueOf(String text) throws IOException {
                return param.handle( text );
            }
        };
    }
View Full Code Here

            //
            // Checking params
            //
            // /////////////////////////////////////////////////////////////////////
            if (params != null) {
                Parameter param;
                final int length = params.length;
                for (int i = 0; i < length; i++) {
                    param = (Parameter) params[i];
                    final ReferenceIdentifier name = param.getDescriptor().getName();
                    if (name.equals(AbstractGridFormat.GEOTOOLS_WRITE_PARAMS.getName())) {
                        gtParams = (GeoToolsWriteParams) param.getValue();
                    }
                    if (name.equals(GeoTiffFormat.WRITE_TFW.getName())) {
                        writeTfw = (Boolean) param.getValue();
                    }
                }
            }
        }
        if (gtParams == null)
View Full Code Here

TOP

Related Classes of org.geotools.parameter.Parameter

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.