public SimpleFeatureCollection getFeatures() throws IOException { return getFeatures(Query.ALL); }
/** * Factory that make the correct decorator for the provided featureSource. * * <p>This factory method is public and will be used to create all required subclasses. By * comparison the constructors for this class have package visibility. * * @param featureSource * @param settings Settings for this store */ public static GeoServerFeatureSource create( FeatureSource<SimpleFeatureType, SimpleFeature> featureSource, Settings settings) { if (featureSource instanceof FeatureLocking) { return new GeoServerFeatureLocking( (FeatureLocking<SimpleFeatureType, SimpleFeature>) featureSource, settings); } else if (featureSource instanceof FeatureStore) { return new GeoServerFeatureStore( (FeatureStore<SimpleFeatureType, SimpleFeature>) featureSource, settings); } return new GeoServerFeatureSource(featureSource, settings); }
Double linearizationTolerance, MetadataMap metadata) { return create( featureSource, new Settings(
public FeatureCollection 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 fc = versioningSource.getVersionedFeatures(newQuery); return reprojectFeatureCollection(targetCRS, fc); } catch (Exception e) { throw new DataSourceException(e); } }
Query reprojected = reprojectFilter(query); Query newQuery = adaptQuery(reprojected, schema); return applyProjectionPolicies(targetCRS, fc); } catch (Exception e) { throw new DataSourceException(e);
String[] propNames = extractAllowedAttributes(query, schema); Filter filter = query.getFilter(); filter = makeDefinitionFilter(filter);
/** * Retrive the extent of the Query. * * <p>This method provides access to an optimized getBounds opperation. If no optimized * opperation is available <code>null</code> will be returned. * * <p>You may still make use of getFeatures( Query ).getCount() which will return the correct * answer (even if it has to itterate through all the results to do so. * * @param query User's query * @return Extend of Query or <code>null</code> if no optimization is available * @throws IOException If a problem is encountered with source */ public ReferencedEnvelope getBounds(Query query) throws IOException { // since CRS is at most forced, we don't need to change this code try { query = makeDefinitionQuery(query, schema); } catch (IOException ex) { return null; } return source.getBounds(query); }
/** * Returns the same name than the feature type (ie, {@code getSchema().getName()} to honor the * simple feature land common practice of calling the same both the Features produces and their * types * * @since 1.7 * @see FeatureSource#getName() */ public Name getName() { return getSchema().getName(); }
public FeatureCollection 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 fc = versioningSource.getVersionedFeatures(newQuery); return reprojectFeatureCollection(targetCRS, fc); } catch (Exception e) { throw new DataSourceException(e); } }
/** * Adjust query and forward to source. * * <p>This method provides access to an optimized getCount opperation. If no optimized * opperation is available <code>-1</code> will be returned. * * <p>You may still make use of getFeatures( Query ).getCount() which will return the correct * answer (even if it has to itterate through all the results to do so). * * @param query User's query. * @return Number of Features for Query, or -1 if no optimization is available. */ public int getCount(Query query) { try { query = makeDefinitionQuery(query, schema); } catch (IOException ex) { return -1; } try { return source.getCount(query); } catch (IOException e) { return 0; } }
/** * Retrieves the total extent of this FeatureSource. * * <p>Please note this extent will reflect the provided definitionQuery. * * @return Extent of this FeatureSource, or <code>null</code> if no optimizations exist. * @throws IOException If bounds of definitionQuery */ public ReferencedEnvelope getBounds() throws IOException { // since CRS is at most forced, we don't need to change this code if (definitionQuery == Filter.INCLUDE) { return source.getBounds(); } else { Query query = new Query(getSchema().getTypeName(), definitionQuery); return source.getBounds(query); } }
public SimpleFeatureCollection getFeatures(Filter filter) throws IOException { return getFeatures(new Query(schema.getTypeName(), filter)); }
public FeatureCollection 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 fc = versioningSource.getVersionedFeatures(newQuery); return reprojectFeatureCollection(targetCRS, fc); } catch (Exception e) { throw new DataSourceException(e); } }
Query newQuery = makeDefinitionQuery(query, schema);
public FeatureCollection getVersionedFeatures() throws IOException { return getFeatures(Query.ALL); } }
public FeatureCollection getVersionedFeatures() throws IOException { return getFeatures(Query.ALL); } }
public FeatureCollection getVersionedFeatures() throws IOException { return getFeatures(Query.ALL); } }
public FeatureCollection getVersionedFeatures(Filter filter) throws IOException { return getFeatures(new DefaultQuery(schema.getTypeName(), filter)); }
public FeatureCollection getVersionedFeatures(Filter filter) throws IOException { return getFeatures(new DefaultQuery(schema.getTypeName(), filter)); }
public FeatureCollection getVersionedFeatures(Filter filter) throws IOException { return getFeatures(new DefaultQuery(schema.getTypeName(), filter)); }