Package org.geotools.data.collection

Examples of org.geotools.data.collection.CollectionFeatureSource


                if (layerData.numberOfLines != null) {
                    features = createFeaturesFromNumberOfLines(mapContext, featureBuilder, layerData);
                } else {
                    features = createFeaturesFromSpacing(mapContext, featureBuilder, layerData);
                }
                return new CollectionFeatureSource(features);
            }
        };
    }
View Full Code Here


            @Nonnull
            @Override
            public FeatureSource load(@Nonnull final MfClientHttpRequestFactory requestFactory,
                                      @Nonnull final MapfishMapContext mapContext) {
                return new CollectionFeatureSource(featureCollection);
            }
        };
    }
View Full Code Here

                        throw ExceptionUtils.getRuntimeException(e);
                    }
                    if (featureCollection == null) {
                        throw new IllegalArgumentException(url + " does not reference a GML file");
                    }
                    return new CollectionFeatureSource(featureCollection);
                }
            };
        }
View Full Code Here

            return new FeatureSourceSupplier() {
                @Override
                public FeatureSource load(
                        final MfClientHttpRequestFactory requestFactory,
                        final MapfishMapContext mapContext) {
                    return new CollectionFeatureSource(features);
                }
            };
        }
View Full Code Here

                                          @Nonnull final MapfishMapContext mapContext) {
                    final FeaturesParser parser = new FeaturesParser(requestFactory, mapContext.isForceLongitudeFirst());
                    SimpleFeatureCollection featureCollection;
                    try {
                        featureCollection = parser.autoTreat(template, geoJsonString);
                        return new CollectionFeatureSource(featureCollection);
                    } catch (IOException e) {
                        throw ExceptionUtils.getRuntimeException(e);
                    }
                }
            };
View Full Code Here

   
    @Test
    public void testRepeatedEnvelopeExpansion() throws Exception {
        final List<Filter> filters = new ArrayList<Filter>();
       
        SimpleFeatureSource testSource = new CollectionFeatureSource(createLineCollection()) {
            @Override
            public SimpleFeatureCollection getFeatures(Query query) {
                filters.add(query.getFilter());
                return super.getFeatures(query);
            }
View Full Code Here

        SimpleFeature zigzag1 = SimpleFeatureBuilder.build(testLineFeatureType, new Object[] { gf.createLineString(cs) }, "zz1");
        SimpleFeature zigzag2 = SimpleFeatureBuilder.build(testLineFeatureType, new Object[] { gf.createLineString(cs) }, "zz2");
        DefaultFeatureCollection fc = new DefaultFeatureCollection();
        fc.add(zigzag1);
        fc.add(zigzag2);
        SimpleFeatureSource zzSource = new CollectionFeatureSource(fc);
       
        // prepare the map
        MapContent mc = new MapContent();
        StyleBuilder sb = new StyleBuilder();
        mc.addLayer(new FeatureLayer(zzSource, sb.createStyle(sb.createLineSymbolizer())));
View Full Code Here

        if (collection == null) {
            throw new NullPointerException("No content provided");
        }
        if (collection instanceof ListFeatureCollection) {
            ListFeatureCollection list = (ListFeatureCollection) collection;
            CollectionFeatureSource source = new CollectionFeatureSource(list);

            return source;
        }
        if (collection instanceof SpatialIndexFeatureCollection) {
            SpatialIndexFeatureCollection indexed = (SpatialIndexFeatureCollection) collection;
            SpatialIndexFeatureSource source = new SpatialIndexFeatureSource(indexed);

            return source;
        }
        if (collection instanceof TreeSetFeatureCollection) {
            TreeSetFeatureCollection tree = (TreeSetFeatureCollection) collection;
            CollectionFeatureSource source = new CollectionFeatureSource(tree);

            return source;
        }
        // if( collection instanceof SimpleFeatureCollection ){
        // SimpleFeatureCollection simpleFeatureCollection = simple( collection );
View Full Code Here

TOP

Related Classes of org.geotools.data.collection.CollectionFeatureSource

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.