Package org.geotools.feature

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


        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

            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

            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

                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

            while (writer.hasNext()) {
                writer.next();
                writer.remove();
            }
            // copy new features in
            SimpleFeatureIterator iterator = collection.features();
            while (iterator.hasNext()) {
                SimpleFeature feature = iterator.next();
                SimpleFeature newFeature = writer.next(); // new blank feature
                newFeature.setAttributes(feature.getAttributes());
                writer.write();
View Full Code Here

            while (writer.hasNext()) {
                writer.next();
                writer.remove();
            }
            // copy new features in
            SimpleFeatureIterator iterator = collection.features();
            while (iterator.hasNext()) {
                SimpleFeature feature = iterator.next();
                SimpleFeature newFeature = writer.next(); // new blank feature
                newFeature.setAttributes(feature.getAttributes());
                writer.write();
View Full Code Here

            secondFeatures.add(b.buildFeature(numFeatures + ""));

        }

        Coordinate centre = ((Polygon) secondFeatures.features().next().getDefaultGeometry())
                .getCentroid().getCoordinate();
        Point p = gf.createPoint(centre);
        b.add(p);
        b.add(0);
View Full Code Here

            while (writer.hasNext()) {
                writer.next();
                writer.remove();
            }
            // copy new features in
            SimpleFeatureIterator iterator = collection.features();
            while (iterator.hasNext()) {
                SimpleFeature feature = iterator.next();
                SimpleFeature newFeature = writer.next(); // new blank feature
                newFeature.setAttributes(feature.getAttributes());
                writer.write();
View Full Code Here

            secondFeatures.add(b.buildFeature(numFeatures + ""));

        }

        Coordinate centre = ((Polygon) secondFeatures.features().next().getDefaultGeometry())
                .getCentroid().getCoordinate();
        Point p = gf.createPoint(centre);
        b.add(p);
        b.add(0);
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.