本文整理了Java中org.geotools.data.Query.getFilter
方法的一些代码示例,展示了Query.getFilter
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getFilter
方法的具体详情如下:
包路径:org.geotools.data.Query
类名称:Query
方法名:getFilter
[英]Gets the filter used to define constraints on the features that will be retrieved by this Query.
[中]获取用于定义此查询将检索的功能约束的筛选器。
代码示例来源:origin: geoserver/geoserver
public SecuredIterator(Iterator wrapped, WrapperPolicy policy) {
super(wrapped);
this.policy = policy;
writeFilter = SecurityUtils.getWriteQuery(policy).getFilter();
}
代码示例来源:origin: geoserver/geoserver
public void setFeatureLock(FeatureLock lock) {
Query writeQuery = getWriteQuery(policy);
if (writeQuery.getFilter() == Filter.EXCLUDE) {
throw unsupportedOperation();
} else {
lockDelegate.setFeatureLock(lock);
}
}
代码示例来源:origin: geoserver/geoserver
public void removeFeatures(Filter filter) throws IOException {
// are we limiting anything?
Query writeQuery = getWriteQuery(policy);
if (writeQuery == Query.ALL) {
storeDelegate.removeFeatures(filter);
} else if (writeQuery.getFilter() == Filter.EXCLUDE
|| writeQuery.getPropertyNames() == Query.NO_NAMES) {
throw unsupportedOperation();
}
// get the mixed filter
final Query local = new Query(null, filter);
Query mixed = mixQueries(local, writeQuery);
storeDelegate.removeFeatures(mixed.getFilter());
}
代码示例来源:origin: geoserver/geoserver
public int lockFeatures(Query query) throws IOException {
Query writeQuery = getWriteQuery(policy);
Query mixed = mixQueries(query, writeQuery);
final Filter writeFilter = writeQuery.getFilter();
if (writeFilter == Filter.EXCLUDE) {
throw unsupportedOperation();
} else if (writeFilter == Filter.INCLUDE) {
return lockDelegate.lockFeatures(query);
} else {
return lockDelegate.lockFeatures(mixed);
}
}
代码示例来源:origin: geoserver/geoserver
public void unLockFeatures(Query query) throws IOException {
Query writeQuery = getWriteQuery(policy);
Query mixed = mixQueries(query, writeQuery);
final Filter writeFilter = writeQuery.getFilter();
if (writeFilter == Filter.EXCLUDE) {
throw unsupportedOperation();
} else if (writeFilter == Filter.INCLUDE) {
lockDelegate.unLockFeatures(query);
} else {
lockDelegate.unLockFeatures(mixed);
}
}
}
代码示例来源:origin: geoserver/geoserver
if (writeQuery == Query.ALL) {
((SimpleFeatureStore) storeDelegate).modifyFeatures(names, values, filter);
} else if (writeQuery.getFilter() == Filter.EXCLUDE
|| writeQuery.getPropertyNames() == Query.NO_NAMES) {
throw unsupportedOperation();
((SimpleFeatureStore) storeDelegate).modifyFeatures(names, values, mixed.getFilter());
} else {
((SimpleFeatureStore) storeDelegate).modifyFeatures(names, values, mixed.getFilter());
代码示例来源:origin: geoserver/geoserver
((SimpleFeatureStore) storeDelegate).modifyFeatures(names, values, filter);
return;
} else if (writeQuery.getFilter() == Filter.EXCLUDE
|| writeQuery.getPropertyNames() == Query.NO_NAMES) {
throw unsupportedOperation();
((SimpleFeatureStore) storeDelegate).modifyFeatures(names, values, mixed.getFilter());
} else {
((SimpleFeatureStore) storeDelegate).modifyFeatures(names, values, mixed.getFilter());
代码示例来源:origin: geoserver/geoserver
storeDelegate.modifyFeatures(names, values, filter);
return;
} else if (writeQuery.getFilter() == Filter.EXCLUDE
|| writeQuery.getPropertyNames() == Query.NO_NAMES) {
throw unsupportedOperation();
storeDelegate.modifyFeatures(names, values, mixed.getFilter());
} else {
storeDelegate.modifyFeatures(names, values, mixed.getFilter());
代码示例来源:origin: geoserver/geoserver
public List<FeatureId> addFeatures(FeatureCollection<T, F> collection) throws IOException {
Query writeQuery = getWriteQuery(policy);
if (writeQuery.getFilter() == Filter.EXCLUDE
|| writeQuery.getPropertyNames() == Query.NO_NAMES) {
throw unsupportedOperation();
} else {
if (writeQuery.getFilter() != null && writeQuery.getFilter() != Filter.INCLUDE) {
final FilteringFeatureCollection<T, F> filtered =
new FilteringFeatureCollection<T, F>(collection, writeQuery.getFilter());
if (filtered.size() < collection.size()) {
String typeName = getSchema().getName().getLocalPart();
代码示例来源:origin: geoserver/geoserver
List<CoverageBand> bands = coverageView.getCoverageBands();
Query renamedQuery = q != null ? new Query(q) : new Query();
if (q != null && q.getFilter() != null) {
Filter unmapped =
GranuleStoreViewFilterVisitor.unmapIdentifiers(
q.getFilter(), coverageView.getName());
renamedQuery.setFilter(unmapped);
代码示例来源:origin: geoserver/geoserver
Filter filter = query.getFilter() != null ? query.getFilter() : Filter.INCLUDE;
Filter defaultedFilter = (Filter) filter.accept(defaultCRSVisitor, null);
代码示例来源:origin: geotools/geotools
/** @param indexLocation */
public JTSIndexVisitorAdapter(final GranuleCatalogVisitor adaptee, Filter filter) {
this.adaptee = adaptee;
this.filter = filter == null ? Query.ALL.getFilter() : filter;
}
代码示例来源:origin: geoserver/geoserver
Query modified = new Query(q);
modified.setTypeName(typeMap.getOriginalName());
modified.setFilter(retypeFilter(q.getFilter(), typeMap));
List<Join> joins = q.getJoins();
if (!joins.isEmpty()) {
代码示例来源:origin: geoserver/geoserver
Filter filter = query.getFilter();
filter = makeDefinitionFilter(filter);
代码示例来源:origin: geotools/geotools
public JTSIndexVisitorAdapter(final GranuleCatalogVisitor adaptee, Query q) {
this.adaptee = adaptee;
this.filter = q == null ? Query.ALL.getFilter() : q.getFilter();
this.maxGranules = q.getMaxFeatures();
}
代码示例来源:origin: geotools/geotools
/**
* Locks features specified by a query.
*
* <p>This method calls through to {@link #lockFeatures(Filter)}.
*/
public final int lockFeatures(Query query) throws IOException {
return lockFeatures(query.getFilter());
}
代码示例来源:origin: geotools/geotools
@Override
protected int getCountInternal(Query query) throws IOException {
if (query.getFilter() == Filter.INCLUDE) {
MemoryEntry entry = getEntry();
return entry.getMemory().size();
}
// feature by feature count required
return -1;
}
代码示例来源:origin: geotools/geotools
protected Query unrollIndexes(Query query) {
Query newQuery = new Query(query);
newQuery.setFilter(unrollFilter(query.getFilter()));
return newQuery;
}
代码示例来源:origin: geotools/geotools
protected void initDetection() {
IndexedFilterDetectorVisitor visitor = new SchemaIndexedFilterDetectorVisitor(mapping);
query.getFilter().accept(visitor, null);
indexedParentLogicOperator = visitor.getParentLogicOperator();
indexedFilters = visitor.getIndexedFilters();
buildIndexQuery();
}
代码示例来源:origin: geotools/geotools
/** Test of getFilter method, of class org.geotools.data.Query. */
public void testFilter() {
// System.out.println("testGetFilter");
Query query = new Query();
query.setFilter(Filter.EXCLUDE);
assertEquals(Filter.EXCLUDE, query.getFilter());
query = new Query("test", Filter.INCLUDE);
assertEquals(Filter.INCLUDE, query.getFilter());
}
内容来源于网络,如有侵权,请联系作者删除!