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


Java Or类代码示例

本文整理汇总了Java中org.opengis.filter.Or的典型用法代码示例。如果您正苦于以下问题:Java Or类的具体用法?Java Or怎么用?Java Or使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testGetFeaturesWithORLogicFilter

import org.opengis.filter.Or; //导入依赖的package包/类
@Test
public void testGetFeaturesWithORLogicFilter() throws Exception {
    init();
    FilterFactory ff = dataStore.getFilterFactory();
    PropertyIsEqualTo property1 = ff.equals(ff.property("vendor_s"), ff.literal("D-Link"));
    PropertyIsEqualTo property2 = ff.equals(ff.property("vendor_s"), ff.literal("Linksys"));
    Or filter = ff.or(property1, property2);
    SimpleFeatureCollection features = featureSource.getFeatures(filter);
    assertEquals(6, features.size());
    SimpleFeatureIterator iterator = features.features();
    while (iterator.hasNext()) {
        SimpleFeature f = iterator.next();
        assertTrue(f.getAttribute("vendor_s").equals("D-Link")
                || f.getAttribute("vendor_s").equals("Linksys"));
    }
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:17,代码来源:ElasticFeatureFilterIT.java

示例2: getLayerGroupsFor

import org.opengis.filter.Or; //导入依赖的package包/类
private Iterable<LayerGroupInfo> getLayerGroupsFor(final FeatureTypeInfo featureType) {
    List<LayerGroupInfo> layerGroups = new ArrayList<LayerGroupInfo>();
    
    // get the layers whose default style is that style, they might be in layer groups
    // using their default style
    Iterable<LayerInfo> layers = catalog.getLayers(featureType);

    // build a query retrieving the first list of candidates
    List<Filter> filters = new ArrayList<>();
    for (LayerInfo layer : layers) {
        filters.add(ff.equal(ff.property("layers.id"), ff.literal(layer.getId()), true, MatchAction.ANY));
        filters.add(ff.equal(ff.property("rootLayer.id"), ff.literal(layer.getId()), true));
    }
    Or groupFilter = ff.or(filters);
    
    try(CloseableIterator<LayerGroupInfo> it = catalog.list(LayerGroupInfo.class, groupFilter)) {
        while(it.hasNext()) {
            LayerGroupInfo lg = it.next();
            layerGroups.add(lg);
        }
    } catch (Exception e) {
        log.log(Level.SEVERE, "Failed to load groups associated with feature type " + featureType.prefixedName(), e);
    }
    
    loadGroupParents(layerGroups); 
    
    return layerGroups;
}
 
开发者ID:MapStory,项目名称:ms-gs-plugins,代码行数:29,代码来源:BoundsUpdateTransactionListener.java

示例3: testOr

import org.opengis.filter.Or; //导入依赖的package包/类
@Test
public void testOr() {
    final Or filter = ff.or(ff.id(ff.featureId("id1")), ff.id(ff.featureId("id2")));
    Map<String,Object> expected = ImmutableMap.of("bool", ImmutableMap.of("should",
            ImmutableList.of(ImmutableMap.of("ids", ImmutableMap.of("values", ImmutableList.of("id1"))),
                    ImmutableMap.of("ids", ImmutableMap.of("values", ImmutableList.of("id2"))))));

    builder.visit(filter, null);
    assertTrue(builder.createFilterCapabilities().fullySupports(filter));
    assertEquals(expected, builder.getQueryBuilder());
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:12,代码来源:ElasticFilterTest.java

示例4: visit

import org.opengis.filter.Or; //导入依赖的package包/类
@Override
public Object visit(
		final Or filter,
		final Object data ) {
	final TemporalConstraintsSet constraints = new TemporalConstraintsSet();
	for (final Filter f : filter.getChildren()) {
		final Object output = f.accept(
				this,
				data);
		if (output instanceof ParameterTimeConstraint) {
			final ParameterTimeConstraint ranges = (ParameterTimeConstraint) output;
			constraints.getConstraintsFor(
					ranges.getName()).replaceWithMerged(
					ranges);
		}
		else if (output instanceof TemporalConstraintsSet) {
			final TemporalConstraintsSet rangeSet = (TemporalConstraintsSet) output;
			for (final Map.Entry<String, TemporalConstraints> entry : rangeSet.getSet()) {
				constraints.getConstraintsFor(
						entry.getKey()).replaceWithMerged(
						entry.getValue());
			}
		}

	}

	return constraints;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:29,代码来源:ExtractTimeFilterVisitor.java

示例5: visit

import org.opengis.filter.Or; //导入依赖的package包/类
@Override
public Object visit(
		final Or filter,
		final Object data ) {
	final PropertyConstraintSet constraints = new PropertyConstraintSet();
	for (final Filter f : filter.getChildren()) {
		final Object output = f.accept(
				this,
				data);
		if (output instanceof PropertyConstraintSet) {
			constraints.union((PropertyConstraintSet) output);
		}
	}
	return constraints;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:16,代码来源:PropertyFilterVisitor.java

示例6: visit

import org.opengis.filter.Or; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public Object visit(Or filter, Object userData) {
	Criterion c = null;
	for (Filter element : filter.getChildren()) {
		if (c == null) {
			c = (Criterion) element.accept(this, userData);
		} else {
			c = Restrictions.or(c, (Criterion) element.accept(this, userData));
		}
	}
	return c;
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:14,代码来源:CriteriaVisitor.java

示例7: visit

import org.opengis.filter.Or; //导入依赖的package包/类
@Override
public Object visit(Or or, Object o) {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
 
开发者ID:DennisPallett,项目名称:gt-jdbc-monetdb-simple,代码行数:5,代码来源:FilterToSQL.java

示例8: visit

import org.opengis.filter.Or; //导入依赖的package包/类
@Override
public Object visit(
		final Or filter,
		final Object data ) {
	ExtractGeometryFilterVisitorResult finalResult = new ExtractGeometryFilterVisitorResult(
			new GeometryFactory().toGeometry(new Envelope()),
			null);
	for (final Filter f : filter.getChildren()) {
		final Object obj = f.accept(
				this,
				data);
		if ((obj != null) && (obj instanceof ExtractGeometryFilterVisitorResult)) {
			final ExtractGeometryFilterVisitorResult currentResult = (ExtractGeometryFilterVisitorResult) obj;
			final Geometry currentGeom = currentResult.getGeometry();
			final double currentArea = currentGeom.getArea();
			if (finalResult.getGeometry().isEmpty()) {
				finalResult = currentResult;
			}
			else if (!Double.isInfinite(currentArea) && !Double.isNaN(currentArea)) {
				if (currentResult.matchPredicate(finalResult)) {
					finalResult = new ExtractGeometryFilterVisitorResult(
							finalResult.getGeometry().union(
									currentGeom),
							currentResult.getCompareOp());
				}
				else {
					finalResult = new ExtractGeometryFilterVisitorResult(
							finalResult.getGeometry().union(
									currentGeom),
							null);
				}
			}
			else {
				finalResult = new ExtractGeometryFilterVisitorResult(
						finalResult.getGeometry(),
						null);
			}
		}
	}
	if (finalResult.getGeometry().isEmpty()) {
		return new ExtractGeometryFilterVisitorResult(
				infinity(),
				null);
	}
	return finalResult;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:47,代码来源:ExtractGeometryFilterVisitor.java

示例9: visit

import org.opengis.filter.Or; //导入依赖的package包/类
/**
 * Write the FilterBuilder for an Or filter
 * 
 * @param filter the filter to visit
 * @param extraData extra data (unused by this method)
 * 
 */
public Object visit(Or filter, Object extraData) {
    return visit((BinaryLogicOperator)filter, "OR");
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:11,代码来源:FilterToElastic.java


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