Package org.geotools.feature.collection

Examples of org.geotools.feature.collection.AdaptorFeatureCollection


    *
    * @param collection
    * @return
    */
    public static FeatureCollection<SimpleFeatureType, SimpleFeature> toFeatureCollection( final Collection<SimpleFeature> collection, SimpleFeatureType type ) {
        return new AdaptorFeatureCollection("collection",type){
            @Override
            protected void closeIterator( Iterator arg0 ) {
            }
            @Override
            protected Iterator openIterator() {
View Full Code Here


   
    // we add a custom feature collection so that we can convert the feature fromt the source feature type to the destination one
    // A slightly faster implementation is to not create a new Feature each time in the iterator but wrap the
    // source feature in a decorator that adapts the feature to the new Feature type.
    // It is a more complicated example and you can see it in action in org.locationtech.udig.catalog.ui.export.FeatureWrapper
    dest.addFeatures(new AdaptorFeatureCollection("converting",dest.getSchema()){
     
      @Override
      protected void closeIterator(Iterator arg0) {
        ((ConvertingIterator)arg0).iter.close();
      }
View Full Code Here

       
        IListStrategy strategy=new AbstractDatastoreStrategy(){
       
            @Override
            public FeatureCollection<SimpleFeatureType, SimpleFeature> getFeatures() throws IOException {
                return new AdaptorFeatureCollection("type", ft){

                    @Override
                    protected void closeIterator( Iterator close ) {
                    }
View Full Code Here

     * @param store
     * @throws IOException
     */
    @SuppressWarnings("unchecked")
    private void createAndAddFeatures( final Set<EditGeom> addedGeoms, final FeatureStore<SimpleFeatureType, SimpleFeature> store ) throws IOException {
        newFids = store.addFeatures(new AdaptorFeatureCollection("createAndAddCollection", store.getSchema()){

            @Override
            public int size() {
                return addedGeoms.size() - 1;
            }
View Full Code Here

TOP

Related Classes of org.geotools.feature.collection.AdaptorFeatureCollection

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.