Examples of features()


Examples of org.geotools.data.simple.SimpleFeatureCollection.features()

    }

    @Test
    public void testFeatureIdsAreVersioned() throws IOException {
        SimpleFeatureCollection collection = pointsSource.getFeatures(Query.ALL);
        SimpleFeatureIterator features = collection.features();

        Set<FeatureId> ids = Sets.newHashSet();
        try {
            while (features.hasNext()) {
                SimpleFeature next = features.next();
View Full Code Here

Examples of org.geotools.data.store.ContentFeatureCollection.features()

                System.out.println(attr.getName() + ": " + attr.getType());
            }
            ContentFeatureCollection fts = source.getFeatures();
            System.out.println("BBox = " + source.getBounds());
            System.out.println("got " + fts.size() + " features");
            SimpleFeatureIterator its = fts.features();
            int count = 10;
            int counter = 0;
            while (its.hasNext() && counter++ < count) {
                SimpleFeature feature = its.next();
                System.out.print(feature.getID() + ": ");
View Full Code Here

Examples of org.geotools.feature.DefaultFeatureCollection.features()

                return newSchema;
            }
           
            private Geometry diff(SimpleFeature f) {
                Geometry geom = (Geometry) f.getDefaultGeometry();
                FeatureIterator<SimpleFeature> i = diffFeatures.features();
                try {
                    while (i.hasNext()) {
                        SimpleFeature diff = i.next();
                        Geometry g = geom.difference((Geometry) diff.getDefaultGeometry());
                        if (g.isEmpty()) {
View Full Code Here

Examples of org.geotools.feature.DefaultFeatureCollection.features()

        DefaultFeatureCollection fc = new DefaultFeatureCollection();
        fc.add(donutFeature);
        fc.add(holeFeature);
       
        //create iterator for collection
        FeatureIterator<SimpleFeature> iterator = fc.features();
       
        //create List<Geometry> for the simulated "drawn" shape
        Polygon userDrawnPoly = (Polygon) reader.read("POLYGON ((114 90, 130 90, 130 130, 114 130, 114 90))");
        List<Geometry> geoms = new ArrayList<Geometry>();
        geoms.add(userDrawnPoly);
View Full Code Here

Examples of org.geotools.feature.DefaultFeatureCollection.features()

            reader.parse(input);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

        SimpleFeature feature=collection.features().next();
        ReferencedEnvelope bounds = new ReferencedEnvelope(feature.getBounds());
        bounds=new ReferencedEnvelope( bounds.getMinX()-(bounds.getWidth()/8),
                bounds.getMaxX()+(bounds.getWidth()/8),
                bounds.getMinY()-(bounds.getHeight()/4),
                bounds.getMaxY()+(bounds.getHeight()/4), DefaultGeographicCRS.WGS84 );
View Full Code Here

Examples of org.geotools.feature.DefaultFeatureCollection.features()

            reader.parse(input);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

        SimpleFeature feature=collection.features().next();
        ReferencedEnvelope bounds = new ReferencedEnvelope( feature.getBounds() );
        bounds=new ReferencedEnvelope( bounds.getMinX()-(bounds.getWidth()/8),
                bounds.getMaxX()+(bounds.getWidth()/8),
                bounds.getMinY()-(bounds.getHeight()/4),
                bounds.getMaxY()+(bounds.getHeight()/4), bounds.getCoordinateReferenceSystem() );
View Full Code Here

Examples of org.geotools.feature.DefaultFeatureCollection.features()

                reader.parse(input);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }

            return collection.features().next();
        }
    }

    /**
     * This strategy exports a feature as Well Known Text as generated by JTS WKTWriter.
View Full Code Here

Examples of org.geotools.feature.FeatureCollection.features()

            CoordinateReferenceSystem crs = null;
            for (int i = 0; i < resultsList.size(); i++) {
                FeatureCollection collection = (FeatureCollection) resultsList
                .get(i);
                FeatureIterator iterator = collection.features();

                try {
                    SimpleFeatureType fType;
                    List<AttributeDescriptor> types;
View Full Code Here

Examples of org.geotools.feature.FeatureCollection.features()

        FeatureTypeInfo fti = getCatalog().getFeatureTypeByName(MockData.BASIC_POLYGONS.getLocalPart());
        assertEquals("EPSG:4269", fti.getSRS());
        assertEquals(ProjectionPolicy.FORCE_DECLARED, fti.getProjectionPolicy());
        FeatureCollection fc = fti.getFeatureSource(null, null).getFeatures();
        assertEquals(CRS.decode("EPSG:4269"), fc.getSchema().getCoordinateReferenceSystem());
        FeatureIterator fi = fc.features();
        Feature f = fi.next();
        fi.close();
        assertEquals(CRS.decode("EPSG:4269"), f.getType().getCoordinateReferenceSystem());
    }
   
View Full Code Here

Examples of org.geotools.feature.FeatureCollection.features()

        FeatureTypeInfo fti = getCatalog().getFeatureTypeByName(MockData.LAKES.getLocalPart());
        assertEquals("EPSG:3003", fti.getSRS());
        assertEquals(ProjectionPolicy.REPROJECT_TO_DECLARED, fti.getProjectionPolicy());
        FeatureCollection fc = fti.getFeatureSource(null, null).getFeatures();
        assertEquals(CRS.decode("EPSG:3003"), fc.getSchema().getCoordinateReferenceSystem());
        FeatureIterator fi = fc.features();
        Feature f = fi.next();
        fi.close();
        assertEquals(CRS.decode("EPSG:3003"), f.getType().getCoordinateReferenceSystem());
    }
   
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.