Examples of FeatureVisitor


Examples of org.opengis.feature.FeatureVisitor

                IONIC_STATISTICAL_UNIT.DATA);

        int nof = parser.getNumberOfFeatures();
        assertEquals(-1, nof);

        FeatureVisitor assertor = new FeatureAssertor(featureType);
        testParseGetFeatures(featureName, featureType, parser, assertor, 2);
    }
View Full Code Here

Examples of org.opengis.feature.FeatureVisitor

        public List<Object[]> doInBackground() {
            List<Object[]> list = new ArrayList<Object[]>();
           
            final NullProgressListener listener = new NullProgressListener();
            try {
                features.accepts( new FeatureVisitor() {               
                    public void visit(Feature feature) {
                        SimpleFeature simple = (SimpleFeature) feature;
                        Object[] values = simple.getAttributes().toArray();
                        ArrayList<Object> row = new ArrayList<Object>( Arrays.asList( values ));
                        row.add(0, simple.getID() );
View Full Code Here

Examples of org.opengis.feature.FeatureVisitor

    public void testMultiLine() throws Exception {
        SimpleFeatureSource road = storeMultiline.getFeatureSource( "multiline" );
        FeatureId fid1 = ff.featureId("fid1");
        Filter select = ff.id( Collections.singleton(fid1));
        SimpleFeatureCollection featureCollection = road.getFeatures( select );
        featureCollection.accepts(new FeatureVisitor() {
            public void visit(Feature f) {
                SimpleFeature feature = (SimpleFeature) f;
                String name = (String) feature.getAttribute("name");
                assertEquals( "jody \ngarnett", name );
            }
View Full Code Here

Examples of org.opengis.feature.FeatureVisitor

        SimpleFeatureSource table = storeTable.getFeatureSource( "table" );
        //GenericEntity.f004=description-f004|name-f004
        FeatureId fid1 = ff.featureId("GenericEntity.f004");
        Filter select = ff.id( Collections.singleton(fid1));
        SimpleFeatureCollection featureCollection = table.getFeatures( select );
        featureCollection.accepts(new FeatureVisitor() {
            public void visit(Feature f) {
                SimpleFeature feature = (SimpleFeature) f;
                String name = (String) feature.getAttribute("name");
                assertEquals( "name-f004", name );
            }
        },null);
        //GenericEntity.f003=description-f003|<null>
        fid1 = ff.featureId("GenericEntity.f003");
        select = ff.id( Collections.singleton(fid1));
        featureCollection = table.getFeatures( select );
        featureCollection.accepts(new FeatureVisitor() {
            public void visit(Feature f) {
                SimpleFeature feature = (SimpleFeature) f;
                String name = (String) feature.getAttribute("name");
                System.out.println( name );
                assertNull( "represent null", name );
            }
        },null);
        //GenericEntity.f007=description-f007|
        fid1 = ff.featureId("GenericEntity.f007");
        select = ff.id( Collections.singleton(fid1));
        featureCollection = table.getFeatures( select );
        featureCollection.accepts(new FeatureVisitor() {
            public void visit(Feature f) {
                SimpleFeature feature = (SimpleFeature) f;
                String name = (String) feature.getAttribute("name");
                assertEquals( "represent empty string", "", name );
            }
        },null);
        //"  GenericEntity.f009=description-f009| "
        fid1 = ff.featureId("GenericEntity.f009");
        select = ff.id( Collections.singleton(fid1));
        featureCollection = table.getFeatures( select );
        featureCollection.accepts(new FeatureVisitor() {
            public void visit(Feature f) {
                SimpleFeature feature = (SimpleFeature) f;
                String name = (String) feature.getAttribute("name");
                assertEquals( "represent empty string", " ", name );
            }
View Full Code Here

Examples of org.opengis.feature.FeatureVisitor

        try {
            while( iterator.hasNext()) {
              SimpleFeature feature = (SimpleFeature) iterator.next();
   
                for (int i = 0; i < visitors.length; i++) {
                    FeatureVisitor visitor = visitors[i];
                    visitor.visit(feature);
                }
            }
        } finally {
            iterator.close();
        }
View Full Code Here

Examples of org.opengis.feature.FeatureVisitor

    @Test
    public void testWkbSidecars() throws Exception {
        // create wkb sidecar files
        ShapefileDataStore ds = new ShapefileDataStore(DataUtilities.fileToURL(new File(
                footprintsSource, "footprints.shp")));
        ds.getFeatureSource().getFeatures().accepts(new FeatureVisitor() {

            @Override
            public void visit(Feature feature) {
                try {
                    SimpleFeature sf = (SimpleFeature) feature;
View Full Code Here

Examples of org.opengis.feature.FeatureVisitor

    @Test
    public void testWktSidecars() throws Exception {
        // create wkb sidecar files
        ShapefileDataStore ds = new ShapefileDataStore(DataUtilities.fileToURL(new File(
                footprintsSource, "footprints.shp")));
        ds.getFeatureSource().getFeatures().accepts(new FeatureVisitor() {

            @Override
            public void visit(Feature feature) {
                try {
                    SimpleFeature sf = (SimpleFeature) feature;
View Full Code Here

Examples of org.opengis.feature.FeatureVisitor

    @Test
    public void testShapefileSidecars() throws Exception {
        // create wkb sidecar files
        ShapefileDataStore ds = new ShapefileDataStore(DataUtilities.fileToURL(new File(
                footprintsSource, "footprints.shp")));
        ds.getFeatureSource().getFeatures().accepts(new FeatureVisitor() {

            @Override
            public void visit(Feature feature) {
                try {
                    SimpleFeature sf = (SimpleFeature) feature;
View Full Code Here

Examples of org.opengis.feature.FeatureVisitor

        assertEquals("stored", list.size(), trip.getCount(Query.ALL));
       
        final Map<String,SimpleFeature> cache = new HashMap<String,SimpleFeature>();
        SimpleFeatureCollection readFeatures = trip.getFeatures();
       
        FeatureVisitor cacheResults = new FeatureVisitor() {
            @Override
            public void visit(Feature f) {
                SimpleFeature feature = (SimpleFeature) f;
                cache.put( feature.getID(), feature );
            }
View Full Code Here

Examples of org.opengis.feature.FeatureVisitor

            String[] dynamicProperties = getDynamicProperties(dynamicRules);
            query.setPropertyNames(dynamicProperties);
           
            // visit all features and evaluate buffer size
            final DynamicBufferEstimator dbe = new DynamicBufferEstimator();
            fs.getFeatures(query).accepts(new FeatureVisitor() {
               
                @Override
                public void visit(Feature feature) {
                    dbe.setFeature(feature);
                    for (Rule rule : dynamicRules) {
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.