Examples of Coverage


Examples of org.geotools.gce.imagemosaic.catalog.index.Indexer.Coverages.Coverage

    public SimpleFeatureType getIndexSchema(Name coverageName, CoordinateSystem coordinateSystem) throws Exception {
                // get the name for this variable to check his coveragename
        final String _coverageName = coverageName.toString();
        // get the coverage definition for this variable, at this stage this exists otherwise we would have skipped it!
        final Coverage coverage = ancillaryFileManager.coveragesMapping.get(_coverageName);
       
        // now check the schema creation
        SchemaType schema = coverage.getSchema();
        String schemaDef=schema!=null?schema.getAttributes():null;
       
        // no schema was defined yet, let's create a default one
        if (schema == null||schema.getAttributes()==null) {
            // TODO incapsulate in coveragedescriptor
            schemaDef = suggestSchemaFromCoordinateSystem(coverage, coordinateSystem);
           
            //set the schema name to be the coverageName
            ancillaryFileManager.setSchema(coverage,coverage.getName(),schemaDef);  
            schema = coverage.getSchema();
        }
       
        // create featuretype, the name is the CoverageName
        final SimpleFeatureType indexSchema = NetCDFUtilities.createFeatureType(coverage.getName(),schemaDef,NetCDFCRSUtilities.WGS84);
       
        // create
        forceSchemaCreation(indexSchema);
       
        // return
View Full Code Here

Examples of org.geotools.gce.imagemosaic.catalog.index.Indexer.Coverages.Coverage

        indexer.setParameters(params != null ? params : Utils.OBJECT_FACTORY.createParametersType());
        Coverages coverages = Utils.OBJECT_FACTORY.createIndexerCoverages();
        indexer.setCoverages(coverages);
        List<Coverage> coverageList = coverages.getCoverage();

        Coverage coverage = Utils.OBJECT_FACTORY.createIndexerCoveragesCoverage();
        coverageList.add(coverage);

        indexer.setParameters(params);
        List<Parameter> parameters = params.getParameter();

        // name
        if (props.containsKey(Prop.NAME)) {
            IndexerUtils.setParam(parameters, props, Prop.NAME);
            coverage.setName(props.getProperty(Prop.NAME));
        }

        // absolute
        if (props.containsKey(Prop.ABSOLUTE_PATH))
            IndexerUtils.setParam(parameters, props, Prop.ABSOLUTE_PATH);

        // recursive
        if (props.containsKey(Prop.RECURSIVE))
            IndexerUtils.setParam(parameters, props, Prop.RECURSIVE);

        // wildcard
        if (props.containsKey(Prop.WILDCARD))
            IndexerUtils.setParam(parameters, props, Prop.WILDCARD);

        // schema
        if (props.containsKey(Prop.SCHEMA)) {
            SchemasType schemas = Utils.OBJECT_FACTORY.createSchemasType();
            SchemaType schema = Utils.OBJECT_FACTORY.createSchemaType();
            indexer.setSchemas(schemas);
            schemas.getSchema().add(schema);
            schema.setAttributes(props.getProperty(Prop.SCHEMA));
            schema.setName(IndexerUtils.getParameter(Prop.INDEX_NAME, indexer));
        }

        DomainsType domains = coverage.getDomains();
        List<DomainType> domainList = null;
        // time attr
        if (props.containsKey(Prop.TIME_ATTRIBUTE)) {
            if (domains == null) {
                domains = Utils.OBJECT_FACTORY.createDomainsType();
                coverage.setDomains(domains);
                domainList = domains.getDomain();
            }
            DomainType domain = Utils.OBJECT_FACTORY.createDomainType();
            domain.setName(Utils.TIME_DOMAIN.toLowerCase());
            IndexerUtils.setAttributes(domain, props.getProperty(Prop.TIME_ATTRIBUTE));
            domainList.add(domain);
        }

        // elevation attr
        if (props.containsKey(Prop.ELEVATION_ATTRIBUTE)) {
            if (domains == null) {
                domains = Utils.OBJECT_FACTORY.createDomainsType();
                coverage.setDomains(domains);
                domainList = domains.getDomain();
            }
            DomainType domain = Utils.OBJECT_FACTORY.createDomainType();
            domain.setName(Utils.ELEVATION_DOMAIN.toLowerCase());
            IndexerUtils.setAttributes(domain, props.getProperty(Prop.ELEVATION_ATTRIBUTE));
            domainList.add(domain);
        }

        // Additional domain attr
        if (props.containsKey(Prop.ADDITIONAL_DOMAIN_ATTRIBUTES)) {
            if (domains == null) {
                domains = Utils.OBJECT_FACTORY.createDomainsType();
                coverage.setDomains(domains);
                domainList = domains.getDomain();
            }
            String attributes = props.getProperty(Prop.ADDITIONAL_DOMAIN_ATTRIBUTES);
            IndexerUtils.parseAdditionalDomains(attributes, domainList);
        }
View Full Code Here

Examples of org.geotools.gce.imagemosaic.catalog.index.Indexer.Coverages.Coverage

        SchemaType schema = null;
        String schemaAttributes = null;
        Indexer indexer = runConfiguration.getIndexer();
        if (indexer != null) {
            SchemasType schemas = indexer.getSchemas();
            Coverage coverage = IndexerUtils.getCoverage(indexer, name);
            if (coverage != null) {
                schema = IndexerUtils.getSchema(indexer, coverage);
            }
            if (schema != null) {
                schemaAttributes = schema.getAttributes();
View Full Code Here

Examples of org.geotools.gce.imagemosaic.catalog.index.Indexer.Coverages.Coverage

            final String origName = mapping.get(key);
            if (origName.equalsIgnoreCase(varName)){

                // Get the mapped coverage name (as an instance, NO2 for a GOME2 with var = 'z')
                final String coverageName = key.getLocalPart();
                final Coverage coverage = reader.ancillaryFileManager.coveragesMapping.get(coverageName);
                final SchemaType schema = coverage.getSchema();
                if (schema != null) {
                    // look up the name
                    String schName= schema.getName();
                    final CoverageSlicesCatalog catalog = reader.getCatalog();
                    if (catalog != null) {
View Full Code Here

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

Examples of org.opengis.coverage.Coverage

        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

Examples of org.opengis.coverage.Coverage

        }

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

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

        /**
         * Crop
 
View Full Code Here

Examples of org.opengis.coverage.Coverage

    }

    @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

Examples of org.opengis.coverage.Coverage

   * @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

Examples of org.opengis.coverage.Coverage

        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
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.