Package org.geotools.data

Examples of org.geotools.data.VersioningFeatureSource


        return ((VersioningFeatureSource) source).getLog(fromVersion, toVersion, filter, users, maxFeatures);
    }

    public FeatureCollection<SimpleFeatureType, SimpleFeature> getVersionedFeatures(Query query)
            throws IOException {
        final VersioningFeatureSource versioningSource = ((VersioningFeatureSource) source);
        Query newQuery = adaptQuery(query, versioningSource.getVersionedFeatures().getSchema());
       
        CoordinateReferenceSystem targetCRS = query.getCoordinateSystemReproject();
        try {
            //this is the raw "unprojected" feature collection
           
            FeatureCollection<SimpleFeatureType, SimpleFeature> fc = versioningSource
                    .getVersionedFeatures(newQuery);

            return applyProjectionPolicies(targetCRS, fc);
        } catch (Exception e) {
            throw new DataSourceException(e);
View Full Code Here


   
   

    public FeatureCollection<SimpleFeatureType, SimpleFeature> getVersionedFeatures(Query query)
            throws IOException {
        final VersioningFeatureSource versioningSource = ((VersioningFeatureSource) source);
        Query newQuery = adaptQuery(query, versioningSource.getVersionedFeatures().getSchema());
       
        CoordinateReferenceSystem targetCRS = query.getCoordinateSystemReproject();
        try {
            //this is the raw "unprojected" feature collection
           
            FeatureCollection<SimpleFeatureType, SimpleFeature> fc;
            fc = versioningSource.getVersionedFeatures(newQuery);

            return applyProjectionPolicies(targetCRS, fc);
        } catch (Exception e) {
            throw new DataSourceException(e);
        }
View Full Code Here

        return ((VersioningFeatureSource) source).getLog(fromVersion, toVersion, filter, users, maxFeatures);
    }

    public FeatureCollection<SimpleFeatureType, SimpleFeature> getVersionedFeatures(Query query)
            throws IOException {
        final VersioningFeatureSource versioningSource = ((VersioningFeatureSource) source);
        Query newQuery = adaptQuery(query, versioningSource.getVersionedFeatures().getSchema());
       
        CoordinateReferenceSystem targetCRS = query.getCoordinateSystemReproject();
        try {
            //this is the raw "unprojected" feature collection
           
            FeatureCollection<SimpleFeatureType, SimpleFeature> fc;
            fc = versioningSource.getVersionedFeatures(newQuery);

            return applyProjectionPolicies(targetCRS, fc);
        } catch (Exception e) {
            throw new DataSourceException(e);
        }
View Full Code Here

                    filter.accept(new AbstractFilterVisitor(visitor), null);
                }

                // extract collection
                VersioningFeatureSource store = (VersioningFeatureSource) source;
                FeatureCollection<SimpleFeatureType, SimpleFeature> logs = store.getLog(query
                        .getFromFeatureVersion(), query.getToFeatureVersion(), filter, null,
                        residual);
                residual -= logs.size();

                // TODO: handle logs reprojection in another CRS
View Full Code Here

                    filter.accept(new AbstractFilterVisitor(visitor), null);
                }

                // extract collection
                VersioningFeatureSource store = (VersioningFeatureSource) source;
                FeatureDiffReader differences = store.getDifferences(query.getFromFeatureVersion(),
                        query.getToFeatureVersion(), filter, null);

                // TODO: handle logs reprojection in another CRS
                result.add(differences);
            }
View Full Code Here

                // diffs
                Filter nonConflictingFilter = getFidConflictFilter(tableName,
                        getActiveConflicts(tableName));
   
                // gather all of the diff readers for the non conflicting features
                VersioningFeatureSource fs = (VersioningFeatureSource) ds.getFeatureSource(tableName);
                FeatureDiffReader[] readers = new FeatureDiffReader[intervals.size() - 1];
                for (int i = 1; i < intervals.size(); i++) {
                    // mind we need to skip the actual synch points, so we subtract 1
                    // from the revision number
                    String fromVersion = String.valueOf(intervals.get(i - 1));
                    String toVersion = String.valueOf(intervals.get(i) - 1);
   
                    Filter filter = nonConflictingFilter;
                    // skip over all the clean merges
                    Filter cleanMerges = getFidConflictFilter(tableName, getCleanMerges(tableName,
                            intervals.get(i)));
                    if (cleanMerges != Filter.INCLUDE) {
                        if (filter != Filter.INCLUDE) {
                            filter = ff.and(cleanMerges, filter);
                        } else {
                            filter = cleanMerges;
                        }
                    }
   
                    readers[i - 1] = fs.getDifferences(fromVersion, toVersion, filter, null);
                }
   
                // now we need to merge the readers into a global set of changes, skip
                // the changes on the conflicting features, and turn everything into a
                // transaction (easy no?)
View Full Code Here

     * Returns all the active conflicts for the specified table
     */
    FeatureCollection<SimpleFeatureType, SimpleFeature> getActiveConflicts(String tableName)
            throws IOException {
        VersioningDataStore ds = core.getVersioningStore();
        VersioningFeatureSource conflicts = (VersioningFeatureSource) ds
                .getFeatureSource(SYNCH_CONFLICTS);

        Filter unresolved = ff.equals(ff.property("state"), ff.literal(String.valueOf('c')));
        Filter tableFilter = ff.equals(ff.property("table_name"), ff.literal(tableName));
        return conflicts.getFeatures(ff.and(unresolved, tableFilter));
    }
View Full Code Here

     * Returns the clean merges occurred at the specified revision
     */
    FeatureCollection<SimpleFeatureType, SimpleFeature> getCleanMerges(String tableName,
            long revision) throws IOException {
        VersioningDataStore ds = core.getVersioningStore();
        VersioningFeatureSource conflicts = (VersioningFeatureSource) ds
                .getFeatureSource(SYNCH_CONFLICTS);

        Filter unresolved = ff.equals(ff.property("state"), ff.literal(String.valueOf('m')));
        Filter tableFilter = ff.equals(ff.property("table_name"), ff.literal(tableName));
        Filter version = ff.equals(ff.property("local_revision"), ff.literal(revision));
        return conflicts.getFeatures(ff.and(ff.and(unresolved, tableFilter), version));
    }
View Full Code Here

        checkOws10Exception(dom, "InvalidParameterValue", "fromVersion");
    }

    public void testEmptyRepeated() throws Exception {
        VersioningDataStore synch = (VersioningDataStore) getCatalog().getDataStoreByName("synch").getDataStore(null);
        VersioningFeatureSource restricted = (VersioningFeatureSource) synch.getFeatureSource("restricted");
        long revisionStart = getLastRevision(restricted);
       
        MockHttpServletResponse response = postAsServletResponse(root(true),
                loadTextResource("PostDiffEmpty.xml"));
        checkPostDiffSuccessResponse(response);
View Full Code Here

        return ((VersioningFeatureSource) source).getLog(fromVersion, toVersion, filter, users,
                maxFeatures);
    }

    public SimpleFeatureCollection getVersionedFeatures(Query query) throws IOException {
        final VersioningFeatureSource versioningSource = ((VersioningFeatureSource) source);
        Query newQuery = adaptQuery(query, versioningSource.getVersionedFeatures().getSchema());

        CoordinateReferenceSystem targetCRS = query.getCoordinateSystemReproject();
        try {
            // this is the raw "unprojected" feature collection

            SimpleFeatureCollection fc = versioningSource.getVersionedFeatures(newQuery);

            return DataUtilities.simple(applyProjectionPolicies(targetCRS, fc));
        } catch (Exception e) {
            throw new DataSourceException(e);
        }
View Full Code Here

TOP

Related Classes of org.geotools.data.VersioningFeatureSource

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.