Package org.geotools.geometry.jts

Examples of org.geotools.geometry.jts.GeometryCollector


            ProgressListener progressListener) throws IOException {
        int count = features.size();
        float done = 0;

        FeatureIterator fi = null;
        GeometryCollector collector = new GeometryCollector();
        try {
            fi = features.features();
            while(fi.hasNext()) {
                Geometry g = (Geometry) fi.next().getDefaultGeometryProperty().getValue();
                collector.add(g);
   
                // progress notification
                done++;
                if (progressListener != null && done % 100 == 0) {
                    progressListener.progress(done / count);
                }
            }
        } finally {
            if (fi != null) {
                fi.close();
            }
        }
       
        return collector.collect();
    }
View Full Code Here


            ProgressListener progressListener) throws IOException {
        int count = features.size();
        float done = 0;

        FeatureIterator fi = null;
        GeometryCollector collector = new GeometryCollector();
        try {
            fi = features.features();
            while(fi.hasNext()) {
                Geometry g = (Geometry) fi.next().getDefaultGeometryProperty().getValue();
                collector.add(g);
   
                // progress notification
                done++;
                if (progressListener != null && done % 100 == 0) {
                    progressListener.progress(done / count);
                }
            }
        } finally {
            if (fi != null) {
                fi.close();
            }
        }
       
        return collector.collect();
    }
View Full Code Here

            return new GeometryCollection(null, new GeometryFactory());
        }

        // collect but don't clone, unfortunately we're already stuck with a list, by cloning
        // we'd just increase memory usage
        GeometryCollector collector = new GeometryCollector();
        collector.setFactory(null);
        collector.setMaxCoordinates(maxCoordinates);
        for (Iterator it = geometries.iterator(); it.hasNext();) {
            Geometry geometry = (Geometry) it.next();
            collector.add(geometry);
        }

        return collector.collect();
    }
View Full Code Here

            return new GeometryCollection(null, new GeometryFactory());
        }

        // collect but don't clone, unfortunately we're already stuck with a list, by cloning
        // we'd just increase memory usage
        GeometryCollector collector = new GeometryCollector();
        collector.setFactory(null);
        collector.setMaxCoordinates(maxCoordinates);
        for (Iterator it = geometries.iterator(); it.hasNext();) {
            Geometry geometry = (Geometry) it.next();
            collector.add(geometry);
        }

        return collector.collect();
    }
View Full Code Here

TOP

Related Classes of org.geotools.geometry.jts.GeometryCollector

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.