Package org.geotools.data.simple

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


            typeName = fCollection.getSchema().getTypeName();
            assertTrue("GenStreams".equals(typeName));
            assertTrue(fCollection.size() > 0);
            assertFalse(fCollection.isEmpty());

            Object[] array = fCollection.toArray();
            assertTrue(array.length == fCollection.size());
            assertNotNull(array[0]);
            assertTrue(array[0] instanceof PreGeneralizedSimpleFeature);

            array = fCollection.toArray(new Object[fCollection.size()]);
View Full Code Here


            Object[] array = fCollection.toArray();
            assertTrue(array.length == fCollection.size());
            assertNotNull(array[0]);
            assertTrue(array[0] instanceof PreGeneralizedSimpleFeature);

            array = fCollection.toArray(new Object[fCollection.size()]);
            assertTrue(array.length == fCollection.size());
            assertNotNull(array[0]);
            assertTrue(array[0] instanceof PreGeneralizedSimpleFeature);

            assertTrue(fCollection.getBounds().equals(fs.getBounds()));
View Full Code Here

        }
        it.close();

        assertEquals(421, i);

        assertEquals(3, fc.toArray().length);
    }
   
    @Test
    public void testIndexCreation() throws Exception {
        File shpFile = copyShapefiles(STATE_POP);
View Full Code Here

            collection = new ReprojectingFeatureCollection(collection, query
                    .getCoordinateSystemReproject());
        }
        // step two sort! (note this makes a sorted copy)
        if (query.getSortBy() != null && query.getSortBy().length != 0) {
            SimpleFeature array[] = collection.toArray(new SimpleFeature[collection.size()]);
            // Arrays sort is stable (not resorting equal elements)
            for (SortBy sortBy : query.getSortBy()) {
                Comparator<SimpleFeature> comparator = DataUtilities.sortComparator(sortBy);
                Arrays.sort(array, comparator);
            }
View Full Code Here

      LOGGER.finer( typeRef1 +": looking up SimpleFeatureSource " );     
        SimpleFeatureSource polySource1 = (SimpleFeatureSource) layers.get( typeRef1 );
        LOGGER.finer( typeRef1 +": found "+polySource1.getSchema().getTypeName() );
       
        SimpleFeatureCollection collection1 = polySource1.getFeatures(); // limit with envelope
        Object[] poly1 = collection1.toArray();

        String typeRef2 = getRestrictedPolygonTypeRef();
        LOGGER.finer( typeRef2 +": looking up SimpleFeatureSource " );       
        SimpleFeatureSource polySource2 = (SimpleFeatureSource) layers.get( typeRef2 );
        LOGGER.finer( typeRef2 +": found "+polySource2.getSchema().getTypeName() );
View Full Code Here

        LOGGER.finer( typeRef2 +": looking up SimpleFeatureSource " );       
        SimpleFeatureSource polySource2 = (SimpleFeatureSource) layers.get( typeRef2 );
        LOGGER.finer( typeRef2 +": found "+polySource2.getSchema().getTypeName() );
       
        SimpleFeatureCollection collection2 = polySource2.getFeatures(); // limit with envelope
        Object[] poly2 = collection2.toArray();
       
/*        if (!envelope.contains(collection1.getBounds())) {
            results.error((Feature) poly1[0],
                "Polygon Feature Source is not contained within the Envelope provided.");
            return false;
View Full Code Here

            features = new ReprojectingFeatureCollection(features, query
                    .getCoordinateSystemReproject());
        }
        // step two sort! (note this makes a sorted copy)
        if (query.getSortBy() != null && query.getSortBy().length != 0) {
            SimpleFeature array[] = features.toArray(new SimpleFeature[features.size()]);
            // Arrays sort is stable (not resorting equal elements)
            for (SortBy sortBy : query.getSortBy()) {
                Comparator<SimpleFeature> comparator = DataUtilities.sortComparator(sortBy);
                Arrays.sort(array, comparator);
            }
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.