Package org.geotools.data.store

Examples of org.geotools.data.store.ReTypingFeatureCollection


            // rebuild the type and wrap the reader
            SimpleFeatureType schema = collection.getSchema();
            SimpleFeatureType target = SimpleFeatureTypeBuilder.retype(schema, query
                    .getPropertyNames());
            if (!target.equals(schema)) {
                collection = new ReTypingFeatureCollection(collection, target);
            }
        }
        return collection;
    }
View Full Code Here


        // apply retyping if necessary
        if (attributes != null && attributes.size() > 0) {
            final String[] names = (String[]) attributes.toArray(new String[attributes.size()]);
            SimpleFeatureType ft = SimpleFeatureTypeBuilder.retype(features.getSchema(), names);
            if (!(ft.equals(features.getSchema()))) {
                features = new ReTypingFeatureCollection(features, ft);
            }
        }

        return features;
    }
View Full Code Here

                    .getPropertyNames());

            // do an equals check because we may have needlessly retyped (that is,
            // the subclass might be able to only partially retype)
            if (!target.equals(schema)) {
                features = new ReTypingFeatureCollection(features, target);
            }
        }
        // Wrap up the results in a method that allows subCollection
        return new SubCollection( query, features );
    }
View Full Code Here

        // apply retyping if necessary
        if (attributes != null && attributes.size() > 0) {
            final String[] names = (String[]) attributes.toArray(new String[attributes.size()]);
            SimpleFeatureType ft = SimpleFeatureTypeBuilder.retype(features.getSchema(), names);
            if (!(ft.equals(features.getSchema()))) {
                features = new ReTypingFeatureCollection(features, ft);
            }
        }

        return features;
    }
View Full Code Here

                   
                    builder.setName(info.getName());
                    builder.setNamespaceURI(info.getNamespace().getURI());
                  
                    SimpleFeatureType targetFeatureType = builder.buildFeatureType();
                    FeatureCollection rfc = new ReTypingFeatureCollection(fc, targetFeatureType);
                   
                    results.add(rfc);
                }
            }
        } catch (Throwable t) {
View Full Code Here

            if (limitedAttributeSize > 0 && fc.getSchema().getDescriptors().size() > limitedAttributeSize) {
                if(fc instanceof SimpleFeatureCollection) {
                    // the datastore did not honour the query properties?? It's broken, but we can fix it
                    SimpleFeatureCollection sfc = (SimpleFeatureCollection) fc;
                    SimpleFeatureType target = SimpleFeatureTypeBuilder.retype(sfc.getSchema(), mixed.getPropertyNames());
                    ReTypingFeatureCollection retyped = new ReTypingFeatureCollection(sfc, target);
                    return (FeatureCollection) SecuredObjects.secure(retyped, policy);
                } else {
                    // complex feature store eh? No way to fix it at least warn the admin
                    LOGGER.log(Level.SEVERE, "Complex store returned more properties than allowed " +
                        "by security (because they are required by the schema). " +
View Full Code Here

                   
                    builder.setName(info.getName());
                    builder.setNamespaceURI(info.getNamespace().getURI());
                  
                    FeatureCollection rfc =
                        new ReTypingFeatureCollection(fc, builder.buildFeatureType());
                   
                    retypedResults.add(rfc);
                }
                results = retypedResults;               
            }
View Full Code Here

TOP

Related Classes of org.geotools.data.store.ReTypingFeatureCollection

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.