Examples of FeatureSource


Examples of org.geotools.data.FeatureSource

        Set<FeatureTypeMapping> featureTypeMappings = new HashSet<FeatureTypeMapping>();

        for (Iterator it = mappingsConfigs.iterator(); it.hasNext();) {
            TypeMapping dto = (TypeMapping) it.next();           
            try {
                FeatureSource featureSource = getFeatureSource(dto, sourceDataStores);
                // get CRS from underlying feature source and pass it on
                CoordinateReferenceSystem crs;
                try {
                    crs = featureSource.getSchema().getCoordinateReferenceSystem();
                } catch (UnsupportedOperationException e) {
                    // web service back end doesn't support getSchema
                    crs = null;
                }
                AttributeDescriptor target = getTargetDescriptor(dto, crs);
View Full Code Here

Examples of org.geotools.data.FeatureSource

        }

        AppSchemaDataAccessConfigurator.LOGGER.fine("asking datastore " + sourceDataStore
                + " for source type " + typeName);
        Name name = Types.degloseName(typeName, namespaces);
        FeatureSource fSource = sourceDataStore.getFeatureSource(name);
        if (fSource instanceof XmlFeatureSource) {
            ((XmlFeatureSource) fSource).setNamespaces(namespaces);
        }
        AppSchemaDataAccessConfigurator.LOGGER.fine("found feature source for " + typeName);
        return fSource;
View Full Code Here

Examples of org.geotools.data.FeatureSource

        }       

        boolean isJoining = AppSchemaDataAccessConfigurator.isJoining();
        boolean removeQueryLimitIfDenormalised = false;

        FeatureSource mappedSource = mapping.getSource();           
       
        if (isJoining && !(mappedSource instanceof JDBCFeatureSource
                || mappedSource instanceof JDBCFeatureStore)) {
          // check if joining is explicitly set for non database backends
          if (AppSchemaDataAccessConfigurator.isJoiningSet()) {
View Full Code Here

Examples of org.geotools.data.FeatureSource

                + "gss:formattedName = Unit Name1233811724109 UC1233811724109 description name ]]";
    }
   
    private FeatureCollection getFeatures(final int maxFeatures, Filter inputFilter)
            throws Exception {
        FeatureSource fSource = (FeatureSource) mappingDataStore.getFeatureSource(typeName);
        FeatureCollection features = (FeatureCollection) fSource.getFeatures(namedQuery(
                inputFilter, new Integer(maxFeatures)));
        return features;
    }
View Full Code Here

Examples of org.geotools.data.FeatureSource

        if (!notFound) {
            fail("Expecting DataSourceException but didn't occur. Deregistering data access fails.");
        }
        notFound = false;
        try {
            FeatureSource source = AppSchemaDataAccessRegistry.getSimpleFeatureSource(typeName);
        } catch (DataSourceException e) {
            notFound = true;
            assertTrue(e.getMessage().startsWith("Feature type " + typeName + " not found"));
        }
        if (!notFound) {
View Full Code Here

Examples of org.geotools.data.FeatureSource

        dsParams.put("dbtype", "app-schema");
        dsParams.put("url", url.toExternalForm());
        DataAccess mfDataAccess = DataAccessFinder.getDataStore(dsParams);
        assertNotNull(mfDataAccess);

        FeatureSource guSource = (FeatureSource) guDataStore
                .getFeatureSource(FeatureChainingTest.GEOLOGIC_UNIT);

        FeatureCollection guFeatures = (FeatureCollection) guSource.getFeatures();
        assertEquals(3, size(guFeatures));

        FeatureSource cpSource = DataAccessRegistry
                .getFeatureSource(FeatureChainingTest.COMPOSITION_PART);
        FeatureCollection cpFeatures = (FeatureCollection) cpSource.getFeatures();
        assertEquals(4, size(cpFeatures));

        FeatureSource cgiSource = DataAccessRegistry
                .getFeatureSource(FeatureChainingTest.CGI_TERM_VALUE);
        FeatureCollection cgiFeatures = (FeatureCollection) cgiSource.getFeatures();
        assertEquals(6, size(cgiFeatures));
    }
View Full Code Here

Examples of org.geotools.data.FeatureSource

        if (file == null) {
            return;
        }

        FileDataStore store = FileDataStoreFinder.getDataStore(file);
        FeatureSource featureSource = store.getFeatureSource();

        // Create a map content and add our shapefile to it
        MapContent map = new MapContent();
        map.setTitle("StyleLab");
View Full Code Here

Examples of org.geotools.data.FeatureSource

    }

    public int getCount(Query query) throws IOException {
        int count = 0;
        Query namedQuery = namedQuery(query);
        FeatureSource mappedSource = mapping.getSource();
        if (!(mappedSource instanceof JDBCFeatureSource || mappedSource instanceof JDBCFeatureStore)) {
            count = store.getCount(namedQuery);
        }
        if (count >= 0) {
            // normal case
View Full Code Here

Examples of org.geotools.data.FeatureSource

    public void testFeatureSource() throws Exception {
        File file = copyShapefiles("shapes/archsites.shp");
        tempDir = file.getParentFile();
       
        DataStore dds = new DirectoryDataStore(tempDir, getFileStoreFactory());
        FeatureSource fs = dds.getFeatureSource("archsites");
        assertNotNull(fs);
        assertSame(dds, fs.getDataStore());
        dds.dispose();
    }
View Full Code Here

Examples of org.geotools.data.FeatureSource

        Style style = RendererBaseTest.loadStyle(this, invert ? "attributeRename.sld"
                : "attributeRenameNoInvert.sld");
        // grab the data
        File property = new File(TestData.getResource(this, "point.properties").toURI());
        PropertyDataStore ds = new PropertyDataStore(property.getParentFile());
        FeatureSource fs = ds.getFeatureSource("point");

        // prepare a feature layer with a query and the rendering tx
        FeatureLayer layer = new FeatureLayer(fs, style);
        layer.setQuery(new Query(null, CQL.toFilter("id > 5")));
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.