Package org.geotools.data.wfs.feature

Examples of org.geotools.data.wfs.feature.LenientBuilder


        }
        List<FeatureId> r = new LinkedList<FeatureId>();
       
        SimpleFeatureType schema = getSchema();
       
        LenientBuilder build = new LenientBuilder( schema );
       
        boolean isLenient = true;
        if( schema.getUserData().containsKey("lenient")){
            isLenient = (Boolean) schema.getUserData().get("lenient");
        }
       
        if( isLenient ){
            build.setFeatureFactory( new LenientFeatureFactory());
        }
       
        List<AttributeDescriptor> atrs = schema.getAttributeDescriptors();
        FeatureIterator<SimpleFeature> iter=collection.features();
        try{
            ReferencedEnvelope bounds=null;
           
        while (iter.hasNext()){
            try {
                SimpleFeature newFeature;
                try {
                    SimpleFeature f = iter.next();
                   
                    String nextFid = ts.nextFid(schema.getTypeName());
                    Object[] values = f.getAttributes().toArray();
                   
                    build.addAll( values );
                    newFeature = build.buildFeature( nextFid );
                   
                    r.add(newFeature.getIdentifier());
                } catch (IllegalAttributeException e) {
                    throw (IOException) new IOException( e.getLocalizedMessage() );
                }
View Full Code Here

TOP

Related Classes of org.geotools.data.wfs.feature.LenientBuilder

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.