当前位置: 首页>>代码示例>>Java>>正文


Java Filter.accept方法代码示例

本文整理汇总了Java中org.opengis.filter.Filter.accept方法的典型用法代码示例。如果您正苦于以下问题:Java Filter.accept方法的具体用法?Java Filter.accept怎么用?Java Filter.accept使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opengis.filter.Filter的用法示例。


在下文中一共展示了Filter.accept方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reprojectFilter

import org.opengis.filter.Filter; //导入方法依赖的package包/类
private Query reprojectFilter(Query query) throws IOException {
    SimpleFeatureType nativeFeatureType = source.getSchema();
    final GeometryDescriptor geom = nativeFeatureType.getGeometryDescriptor();
    // if no geometry involved, no reprojection needed
    if(geom == null)
        return query;
    
    try {
        // default CRS: the CRS we can assume geometry and bbox elements in filter are
        // that is, usually the declared one, but the native one in the leave case
        CoordinateReferenceSystem defaultCRS = null;
        // we need to reproject all bbox and geometries to a target crs, which is
        // the native one usually, but it's the declared on in the force case (since in
        // that case we completely ignore the native one)
        CoordinateReferenceSystem targetCRS = null;
        CoordinateReferenceSystem nativeCRS = geom.getCoordinateReferenceSystem();
        if(srsHandling == ProjectionPolicy.FORCE_DECLARED) {
            defaultCRS = declaredCRS;
            targetCRS = declaredCRS;
            nativeFeatureType = FeatureTypes.transform(nativeFeatureType, declaredCRS);
        } else if(srsHandling == ProjectionPolicy.REPROJECT_TO_DECLARED) {
            defaultCRS = declaredCRS;
            targetCRS = nativeCRS;
        } else { // FeatureTypeInfo.LEAVE
            defaultCRS = nativeCRS;
            targetCRS = nativeCRS;
        }
        
        // now we apply a default to all geometries and bbox in the filter
        ISODefaultCRSFilterVisitor defaultCRSVisitor = new ISODefaultCRSFilterVisitor(ff, defaultCRS);
        Filter filter = query.getFilter() != null ? query.getFilter() : Filter.INCLUDE;
        Filter defaultedFilter = (Filter) filter.accept(defaultCRSVisitor, null);
        
        // and then we reproject all geometries so that the datastore receives
        // them in the native projection system (or the forced one, in case of force) 
        ISOReprojectingFilterVisitor reprojectingVisitor = new ISOReprojectingFilterVisitor(ff, nativeFeatureType);
        Filter reprojectedFilter = (Filter) defaultedFilter.accept(reprojectingVisitor, null);
        
        Query reprojectedQuery = new Query(query);
        reprojectedQuery.setFilter(reprojectedFilter);
        return reprojectedQuery;
    } catch(Exception e) {
        throw new DataSourceException("Had troubles handling filter reprojection...", e);
    }
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:46,代码来源:ISOGeoServerFeatureSource.java

示例2: isValidJoinFilter

import org.opengis.filter.Filter; //导入方法依赖的package包/类
boolean isValidJoinFilter(Filter filter) {
    PostPreProcessFilterSplittingVisitor visitor = 
        new PostPreProcessFilterSplittingVisitor(joinFilterCapabilities, null, null);
    filter.accept(visitor, null);
    return visitor.getFilterPost() == null || visitor.getFilterPost() == Filter.INCLUDE;
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:7,代码来源:GetFeature3D.java

示例3: applyDefaultCRS

import org.opengis.filter.Filter; //导入方法依赖的package包/类
/**
 * Applies a default CRS to all geometric filter elements that do not
 * already have one
 * 
 * @param nativeCRS
 * @param wfsVersion
 *
 */
public static Filter applyDefaultCRS(Filter filter, CoordinateReferenceSystem defaultCRS) {
    DefaultCRSFilterVisitor defaultVisitor = new DefaultCRSFilterVisitor(ff, defaultCRS);
    return (Filter) filter.accept(defaultVisitor, null);
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:13,代码来源:WFSReprojectionUtil_ISO.java

示例4: reprojectFilter

import org.opengis.filter.Filter; //导入方法依赖的package包/类
/**
 * Reprojects all geometric filter elements to the native CRS of the
 * provided schema
 * 
 * @param filter
 * @param schema
 *
 */
public static Filter reprojectFilter(Filter filter, FeatureType schema) {
    ISOReprojectingFilterVisitor visitor = new ISOReprojectingFilterVisitor(ff, schema);
    return (Filter) filter.accept(visitor, null);
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:13,代码来源:WFSReprojectionUtil_ISO.java


注:本文中的org.opengis.filter.Filter.accept方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。