Examples of NullProgressListener


Examples of org.geotools.util.NullProgressListener

     * @throws IOException
     */
    static Object near(SimpleFeatureCollection collection, Expression expression, Object value)
            throws IllegalFilterException, IOException {
        NearestVisitor visitor = new NearestVisitor(expression, value);
        collection.accepts(visitor, new NullProgressListener());
        return visitor.getNearestMatch();
    }
View Full Code Here

Examples of org.geotools.util.NullProgressListener

    private Object calculate(SimpleFeatureCollection featureCollection) {
        try {
            int classNum = getClasses();
          //use a visitor to grab the unique values
            UniqueVisitor uniqueVisit = new UniqueVisitor(getParameters().get(0));
          if (progress == null) progress = new NullProgressListener();
                featureCollection.accepts(uniqueVisit, progress);
          if (progress.isCanceled()) return null;
       
            CalcResult calcResult = uniqueVisit.getResult();
            if (calcResult == null) return null;
View Full Code Here

Examples of org.geotools.util.NullProgressListener

       
    final public Map<String,Object> execute( Map<String,Object> input, ProgressListener monitor ) {
        if (started) throw new IllegalStateException("Process can only be run once");
        started = true;
       
        if( monitor == null ) monitor = new NullProgressListener();
        try {
            if( monitor.isCanceled() ) return null; // respect isCanceled
            this.input = input;
            result = new HashMap<String,Object>();
           
View Full Code Here

Examples of org.geotools.util.NullProgressListener

    }

    public final Map<String, Object> execute(Map<String, Object> input,
            ProgressListener monitor) {
        if ( monitor == null ) {
            monitor = new NullProgressListener();
        }
       
        //read the parameters, features and buffer amount
        FeatureCollection features =
            (FeatureCollection) input.get( FeatureToFeatureProcessFactory.FEATURES.key );
View Full Code Here

Examples of org.geotools.util.NullProgressListener

  }
   
  private Object calculate(SimpleFeatureCollection featureCollection) {
    // use a visitor to find the values in each bin
    QuantileListVisitor quantileVisit = new QuantileListVisitor(getParameters().get(0), getClasses());
    if (progress == null) progress = new NullProgressListener();
    try {
            featureCollection.accepts(quantileVisit, progress);
        } catch (IOException e) {
            LOGGER.log(Level.SEVERE, "QuantileFunction calculate(SimpleFeatureCollection) failed" , e);
            return null;
View Full Code Here

Examples of org.geotools.util.NullProgressListener

         * its attributes
         */
        public List<Object[]> doInBackground() {
            List<Object[]> list = new ArrayList<Object[]>();
           
            final NullProgressListener listener = new NullProgressListener();
            try {
                features.accepts( new FeatureVisitor() {               
                    public void visit(Feature feature) {
                        SimpleFeature simple = (SimpleFeature) feature;
                        Object[] values = simple.getAttributes().toArray();
                        ArrayList<Object> row = new ArrayList<Object>( Arrays.asList( values ));
                        row.add(0, simple.getID() );
                        publish( row.toArray() );
                       
                        if( isCancelled() ) listener.setCanceled(true);
                    }
                } , listener );
            } catch (IOException e) {
                exception = e;
            }          
View Full Code Here

Examples of org.geotools.util.NullProgressListener

        int classNum = getClasses();
        Comparable globalMin;
        Comparable globalMax;
    try {
            MinVisitor minVisit = new MinVisitor(getParameters().get(0));
      if (progress == null) progress = new NullProgressListener();
      featureCollection.accepts(minVisit, progress);
      if (progress.isCanceled()) return null;
      globalMin = (Comparable) minVisit.getResult().getValue();

      MaxVisitor maxVisit = new MaxVisitor(getParameters().get(0));
View Full Code Here

Examples of org.geotools.util.NullProgressListener

   
    @SuppressWarnings("unchecked")
    private RangedClassifier calculateNonNumerical(int classNum, FeatureCollection<?,?> featureCollection) throws IOException {
        //obtain of list of unique values, so we can enumerate
        UniqueVisitor uniqueVisit = new UniqueVisitor(getParameters().get(0));
        featureCollection.accepts(uniqueVisit, new NullProgressListener());
        List result = uniqueVisit.getResult().toList();
        //sort the results and put them in an array
        Collections.sort(result);
       
        Comparable[] values = (Comparable[]) result.toArray(new Comparable[result.size()]);
View Full Code Here

Examples of org.geotools.util.NullProgressListener

    }

    public void accepts(final FeatureVisitor visitor, ProgressListener listener) throws IOException {
        Envelope everything = new Envelope(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
                Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
        final ProgressListener progress = listener != null ? listener : new NullProgressListener();
        progress.started();
        final float size = (float) size();
        final IOException problem[] = new IOException[1];
        index.query(everything, new ItemVisitor() {
            float count = 0f;
View Full Code Here

Examples of org.geotools.util.NullProgressListener

     * @param listener
     * @return a collection of coverages.
     */
    public Collection<? extends Coverage> getResults(ProgressListener listener) {
        if (listener == null)
            listener = new NullProgressListener();
        listener.started();
        try {
            synchronized (this.results) {
                return new ArrayList<GridCoverage>(this.results);
            }
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.