Examples of FeatureCollection


Examples of org.geotools.feature.FeatureCollection

        assertTrue(csv.contains("123 Main Street"));
    }
   
    public void testSimpleMIF() throws Exception {
        // prepare input
        FeatureCollection fc = dataStore.getFeatureSource("Buildings").getFeatures();
        fct.getFeature().add(fc);

        // write out
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        gft.setOutputFormat("OGR-MIF");
View Full Code Here

Examples of org.geotools.feature.FeatureCollection

        assertTrue(fileNames.contains("Buildings.mid"));
    }
   
    public void testGeometrylessCSV() throws Exception {
        // prepare input
        FeatureCollection fc = dataStore.getFeatureSource("Geometryless").getFeatures();
        fct.getFeature().add(fc);

        // write out
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        gft.setOutputFormat("OGR-CSV");
View Full Code Here

Examples of org.geotools.feature.FeatureCollection

        assertTrue(csv.contains("Alessia"));
    }
   
    public void testAllTypesKML() throws Exception {
        // prepare input
        FeatureCollection fc = dataStore.getFeatureSource("AllTypes").getFeatures();
        fct.getFeature().add(fc);

        // write out
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        gft.setOutputFormat("OGR-KML");
View Full Code Here

Examples of org.geotools.feature.FeatureCollection

    public boolean removeAll(Collection arg0) {
        Iterator it = collections.iterator();
        boolean result = false;
        while (it.hasNext()){
            FeatureCollection col = (FeatureCollection)it.next();
            result |= col.removeAll(arg0);
        }
        return result;
    }
View Full Code Here

Examples of org.geotools.feature.FeatureCollection

    public boolean retainAll(Collection arg0) {
        boolean result = false;
       
        Iterator it = collections.iterator();
        while (it.hasNext()){
            FeatureCollection col = (FeatureCollection)it.next();
            result |= col.removeAll(arg0);
        }
       
        return result;
    }
View Full Code Here

Examples of org.geotools.feature.FeatureCollection

    public Object[] toArray(Object[] arg0) {
        List list = new ArrayList();
       
        Iterator it = collections.iterator();
        while(it.hasNext()){
            FeatureCollection col = (FeatureCollection)it.next();
            Iterator it2 = col.iterator();
            while (it2.hasNext()){
                list.add(it.next());
            }
            col.close(it2);
        }
       
        return list.toArray(arg0);
    }
View Full Code Here

Examples of org.geotools.feature.FeatureCollection

                // surely no one would use a shapefile for more than 50000 features, right?
                q.setStartIndex(1 + 50000 * (page - 1));
                q.setMaxFeatures(50000);
            }

            FeatureCollection col = fti.getFeatureSource(null, null).getFeatures(q);
           
            Iterator fi = col.iterator();

            while (fi.hasNext()){
                try {
                    SimpleFeature f = (SimpleFeature)fi.next();
                    encodeFeatureLink(urlSet, layername, f);
                } catch (Exception e) {
                    e.printStackTrace();
                    // TODO: Log
                }
            }

            col.close(fi);
        } catch (IOException ioe) {
            ioe.printStackTrace();
            // TODO log
        }

View Full Code Here

Examples of org.geotools.feature.FeatureCollection

        DefaultQuery q = new DefaultQuery();
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);

        q.setFilter(ff.id(Collections.singleton(ff.featureId(feature))));

        FeatureCollection col = null;
        try {
            col = featureType.getFeatureSource(null, null).getFeatures(q);
        } catch (IOException e) {
            throw new RestletException(
                    e.getMessage(),
                    Status.SERVER_ERROR_INTERNAL
                    );
        }

        if (col.size() != 1) {
            throw new RestletException(
                "Unexpected results from data query, "
                + "should be exactly one feature with given ID",
                Status.SERVER_ERROR_INTERNAL
            );
        }

        return (SimpleFeature)col.iterator().next();
    }
View Full Code Here

Examples of org.geotools.feature.FeatureCollection

        return fc.getFeature().get( 0 );
    }
   
    @Override
    public void encode(Object object, ContentHandler handler) throws Exception {
        FeatureCollection features = (FeatureCollection) object;
        SimpleFeatureType featureType = (SimpleFeatureType) features.getSchema();
       
        FeatureCollectionType fc = WfsFactory.eINSTANCE.createFeatureCollectionType();
        fc.getFeature().add( features );
       
        Encoder e = new Encoder( new WFSConfiguration() );
View Full Code Here

Examples of org.geotools.feature.FeatureCollection

     * @return
     */
    protected ReferencedEnvelope getEnvelope(List featureList) {
        if (e == null) {
            for (int i = 0; i < featureList.size(); i++) {
                FeatureCollection collection = (FeatureCollection) featureList.get(i);
                if (e == null) {
                    e = collection.getBounds();
                } else {
                    e.expandToInclude(collection.getBounds());
                }
            }
        }
        return normalizeEnvelope(e);
    }
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.