Package org.geotools.coverage.processing

Examples of org.geotools.coverage.processing.OperationJAI$Name


    }

    private static Name getFirstName(InternationalString iname) throws JAXRException {
        for (Object o : iname.getLocalizedStrings()) {
            LocalizedString locName = (LocalizedString) o;
            Name name = objectFactory.createName();
            name.setValue(locName.getValue());
            name.setLang(locName.getLocale().getLanguage());
            return name;
        }
        return null;
    }
View Full Code Here


        return null;
    }
    private static void addNames(List<Name> names, InternationalString iname) throws JAXRException {
        for (Object o : iname.getLocalizedStrings()) {
            LocalizedString locName = (LocalizedString) o;
            Name name = objectFactory.createName();
            name.setValue(locName.getValue());
            name.setLang(locName.getLocale().getLanguage());
            names.add(name);
        }
    }
View Full Code Here

        Name[] result = new Name[namePatterns.size()];
        int currLoc = 0;
        for (Iterator i = namePatterns.iterator(); i.hasNext();)
        {
            Object obj = i.next();
            Name name = objectFactory.createName();
            if (obj instanceof String) {
                name.setValue((String)obj);
            } else if (obj instanceof LocalizedString) {
                LocalizedString ls = (LocalizedString)obj;
                name.setValue(ls.getValue());
                name.setLang(ls.getLocale().getLanguage());
            }
            result[currLoc] = name;
            currLoc++;
        }
        return result;
View Full Code Here

            RasterSymbolizerHelper rsp = new RasterSymbolizerHelper(gc, null);
            rsp.visit(rs);
            GridCoverage2D recoloredGridCoverage = (GridCoverage2D) rsp.getOutput();

            final OperationJAI op = new OperationJAI("Histogram"); //$NON-NLS-1$
            ParameterValueGroup params = op.getParameters();
            params.parameter("Source").setValue(recoloredGridCoverage); //$NON-NLS-1$

            recoloredGridCoverage = (GridCoverage2D) op.doOperation(params, null);
            final Histogram h = (Histogram) recoloredGridCoverage.getProperty("histogram"); //$NON-NLS-1$

            Display.getDefault().asyncExec(new Runnable(){
                public void run() {
                    rgbViewer.updateHistograms(h.getBins());
View Full Code Here

        return null;
      }
     
    }
     
    final OperationJAI op = new OperationJAI("ZonalStats"); //$NON-NLS-1$
    ParameterValueGroup params = op.getParameters();
    params.parameter("dataImage").setValue(gcRaw); //$NON-NLS-1$
    params.parameter("stats").setValue(stats); //$NON-NLS-1$
    params.parameter("bands").setValue(new Integer[] { 0 }); //$NON-NLS-1$
    if (ignore.size() > 0){
      params.parameter("ranges").setValue(ignore); //$NON-NLS-1$
      params.parameter("rangesType").setValue(Range.Type.EXCLUDE); //$NON-NLS-1$
      params.parameter("rangeLocalStats").setValue(false); //$NON-NLS-1$
    }
   

    final GridCoverage2D coverage = (GridCoverage2D) op.doOperation(params,null);
    final ZonalStats zstats = (ZonalStats) coverage
        .getProperty(ZonalStatsDescriptor.ZONAL_STATS_PROPERTY);
    double min = zstats.statistic(Statistic.MIN).results().get(0).getValue();
    double max = zstats.statistic(Statistic.MAX).results().get(0).getValue();
    return new double[]{min,max};
View Full Code Here

                    }

                    final Statistic[] statistis = statisticsSet.toArray(new Statistic[statisticsSet
                            .size()]);

                    final OperationJAI op = new OperationJAI("ZonalStats");
                    ParameterValueGroup params = op.getParameters();
                    params.parameter("dataImage").setValue(cropped);
                    params.parameter("stats").setValue(statistis);
                    params.parameter("bands").setValue(bands);
                    params.parameter("roi").setValue(roi);
                    params.parameter("ranges").setValue(inclusionRanges);
                    params.parameter("rangesType").setValue(rangesType);
                    params.parameter("rangeLocalStats").setValue(isLocal);

                    final GridCoverage2D coverage = (GridCoverage2D) op.doOperation(params, null);
                    final ZonalStats stats = (ZonalStats) coverage
                            .getProperty(ZonalStatsDescriptor.ZONAL_STATS_PROPERTY);
                    final Map<Statistic, List<Result>> statsMap = new HashMap<Statistic, List<Result>>();
                    for (Statistic statistic : statistis) {
                        final List<Range> inclRanges = CollectionFactory.list();
View Full Code Here

      for (String string : findQualifyers) {
        findQualifiers.getFindQualifier().add(string);
      }
      findBusiness.setFindQualifiers(findQualifiers);

      Name name = new Name();
      name.setValue(nameStr);
      findBusiness.getName().add(name);


      logger.debug("FindBusiness " + findBusiness + " sending findBusinesses request..");
      List<Business> businesses = new ArrayList<Business>();
View Full Code Here

    }
    assertEquals(names1.size(), names2.size());
    Iterator<Name> names1Itr = names1.iterator();
    Iterator<Name> names2Itr = names2.iterator();
    while (names1Itr.hasNext()) {
      Name name1 = names1Itr.next();
      Name name2 = names2Itr.next();
      assertEquals(name1.getLang(), name2.getLang());
      assertEquals(name1.getValue(), name2.getValue());
    }
  }
View Full Code Here

      //service
      String lang = "en"; //default to english
      if (uddiService.lang()!=null) {
        lang = uddiService.lang();
      }
      Name name = new Name();
      name.setLang(lang);
      service.setBusinessKey(TokenResolver.replaceTokens(uddiService.businessKey(),properties));
      service.setServiceKey(TokenResolver.replaceTokens(uddiService.serviceKey(),properties));
      if (!"".equals(uddiService.serviceName())) {
        name.setValue(TokenResolver.replaceTokens(uddiService.serviceName(),properties));
      } else if (webServiceAnnotation!=null && !"".equals(webServiceAnnotation.serviceName())) {
        name.setValue(webServiceAnnotation.serviceName());
      } else {
        name.setValue(clazz.getSimpleName());
      }
      service.getName().add(name);
      Description description = new Description();
      description.setLang(lang);
      description.setValue(TokenResolver.replaceTokens(uddiService.description(),properties));
View Full Code Here

  @Override
  protected void execute() throws Exception {

    //Name of business were looking for in English.
    int max = 5;
    Name q = new Name();
    q.setLang("en");
    q.setValue(businessName);

    //Optional qualifiers that will modify the search.
    FindQualifiers findQualifiers = new FindQualifiers();
    findQualifiers.getFindQualifier().add("sortByNameDesc");
    findQualifiers.getFindQualifier().add("approximateMatch");

    //The FindBusiness object that is submitted via the inquiry service.
    FindBusiness findBusiness = new FindBusiness();
    findBusiness.setAuthInfo(authenticationToken.getAuthInfo());
    findBusiness.getName().add(q);
    findBusiness.setFindQualifiers(findQualifiers);
    findBusiness.setMaxRows(max);

    BusinessList businessList = inquiryService.findBusiness(findBusiness);
    businessInfos = businessList.getBusinessInfos();

    //Print out the names of the returned businesses
    for (BusinessInfo bi : businessInfos.getBusinessInfo()) {
      if (businessInfo == null) {
        businessInfo = bi;
      }
      Name _name = bi.getName().get(0);
      System.out.println("BusinessInfo: " + _name.getValue());
    }

   
  }
View Full Code Here

TOP

Related Classes of org.geotools.coverage.processing.OperationJAI$Name

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.