• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java PropertyIsEqualTo类的典型用法和代码示例

java 2次浏览

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

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

示例1: testEncodedNativeTermQuery

点赞 3

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testEncodedNativeTermQuery() throws Exception {
    init("not-active");
    Map<String, String> vparams = new HashMap<String, String>();
    Map<String,Object> query = ImmutableMap.of("term", ImmutableMap.of("security_ss", "WPA"));
    vparams.put("q", URLEncoder.encode(mapper.writeValueAsString(query), "UTF-8"));
    Hints hints = new Hints(Hints.VIRTUAL_TABLE_PARAMETERS, vparams);
    Query q = new Query(featureSource.getSchema().getTypeName());
    q.setHints(hints);
    FilterFactory ff = dataStore.getFilterFactory();
    PropertyIsEqualTo filter = ff.equals(ff.property("speed_is"), ff.literal("300"));
    q.setFilter(filter);
    ContentFeatureCollection features = featureSource.getFeatures(q);
    assertEquals(1, features.size());
    SimpleFeatureIterator fsi = features.features();
    assertTrue(fsi.hasNext());
    assertEquals(fsi.next().getID(), "active.12");
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:19,
代码来源:ElasticViewParametersFilterIT.java

示例2: testGetFeaturesWithORLogicFilter

点赞 3

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的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

示例3: testGetFeaturesWithQuery

点赞 3

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testGetFeaturesWithQuery() throws Exception {
    init();
    FilterFactory ff = dataStore.getFilterFactory();
    PropertyIsEqualTo filter = ff.equals(ff.property("modem_b"), ff.literal(true));

    Query query = new Query();
    query.setPropertyNames(new String[] { "standard_ss", "security_ss" });
    query.setFilter(filter);

    SimpleFeatureCollection features = featureSource.getFeatures(query);
    assertEquals(8, features.size());

    SimpleFeatureIterator iterator = features.features();
    try {
        assertTrue(iterator.hasNext());
        SimpleFeature feature = iterator.next();
        assertEquals(2, feature.getAttributeCount());
        String st = (String) feature.getAttribute("standard_ss");
        // changed from "IEEE 802.11b" in SolrFeatureSourceTest
        assertTrue(st.contains("IEEE 802.11b"));
    } finally {
        iterator.close();
    }
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:26,
代码来源:ElasticFeatureFilterIT.java

示例4: testReadStringArrayWithCsvStrategy

点赞 3

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testReadStringArrayWithCsvStrategy() throws Exception {
    init();
    dataStore.setArrayEncoding(ArrayEncoding.CSV);
    FilterFactory ff = dataStore.getFilterFactory();
    PropertyIsEqualTo filter = ff.equals(ff.property("modem_b"), ff.literal(true));

    SimpleFeatureCollection features = featureSource.getFeatures(filter);
    assertEquals(8, features.size());

    SimpleFeatureIterator iterator = features.features();
    try {
        assertTrue(iterator.hasNext());
        SimpleFeature feature = iterator.next();
        String st = (String) feature.getAttribute("standard_ss");
        // changed from "IEEE 802.11b" in SolrFeatureSourceTest
        assertTrue(URLDecoder.decode(st, StandardCharsets.UTF_8.toString()).startsWith("IEEE 802.11"));
    } finally {
        iterator.close();
    }
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:22,
代码来源:ElasticFeatureFilterIT.java

示例5: testBBOXAndEqualsFilter

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testBBOXAndEqualsFilter() throws Exception {
    init();
    FilterFactory ff = dataStore.getFilterFactory();
    PropertyIsEqualTo property = ff.equals(ff.property("standard_ss"),
            ff.literal("IEEE 802.11b"));
    BBOX bbox = ff.bbox("geo", -180, -180, 180, 180, "EPSG:" + SOURCE_SRID);
    And filter = ff.and(property, bbox);
    SimpleFeatureCollection features = featureSource.getFeatures(filter);
    assertEquals(7, features.size());
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:12,
代码来源:ElasticGeometryFilterIT.java

示例6: testPropertyIsEqualToString

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testPropertyIsEqualToString() {
    PropertyIsEqualTo filter = ff.equals(ff.property("stringAttr"), ff.literal("value"));
    Map<String,Object> expected = ImmutableMap.of("term", ImmutableMap.of("stringAttr", "value"));

    builder.visit(filter, null);
    assertTrue(builder.createFilterCapabilities().fullySupports(filter));
    assertEquals(expected, builder.getQueryBuilder());
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:10,
代码来源:ElasticFilterTest.java

示例7: testNestedPropertyIsEqualToString

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testNestedPropertyIsEqualToString() {
    PropertyIsEqualTo filter = ff.equals(ff.property("nested.hej"), ff.literal("value"));
    Map<String,Object> expected = ImmutableMap.of("nested", ImmutableMap.of("path", "nested", "query", ImmutableMap.of("term", ImmutableMap.of("nested.hej", "value"))));

    builder.visit(filter, null);
    assertTrue(builder.createFilterCapabilities().fullySupports(filter));
    assertEquals(expected,builder.getQueryBuilder());
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:10,
代码来源:ElasticFilterTest.java

示例8: testNestedStringIsEqualToProperty

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testNestedStringIsEqualToProperty() {
    PropertyIsEqualTo filter = ff.equals(ff.literal("value"), ff.property("nested.hej"));
    Map<String,Object> expected = ImmutableMap.of("nested", ImmutableMap.of("path", "nested", "query", ImmutableMap.of("term", ImmutableMap.of("nested.hej", "value"))));

    builder.visit(filter, null);
    assertTrue(builder.createFilterCapabilities().fullySupports(filter));
    assertEquals(expected,builder.getQueryBuilder());
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:10,
代码来源:ElasticFilterTest.java

示例9: testPropertyIsEqualToDouble

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testPropertyIsEqualToDouble() {
    PropertyIsEqualTo filter = ff.equals(ff.property("doubleAttr"), ff.literal("4.5"));
    Map<String,Object> expected = ImmutableMap.of("term", ImmutableMap.of("doubleAttr", 4.5));

    builder.visit(filter, null);
    assertTrue(builder.createFilterCapabilities().fullySupports(filter));
    assertEquals(expected, builder.getQueryBuilder());
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:10,
代码来源:ElasticFilterTest.java

示例10: testDoubleIsEqualtoProperty

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testDoubleIsEqualtoProperty() {
    PropertyIsEqualTo filter = ff.equals(ff.literal("4.5"), ff.property("doubleAttr"));
    Map<String,Object> expected = ImmutableMap.of("term", ImmutableMap.of("doubleAttr", 4.5));

    builder.visit(filter, null);
    assertTrue(builder.createFilterCapabilities().fullySupports(filter));
    assertEquals(expected, builder.getQueryBuilder());
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:10,
代码来源:ElasticFilterTest.java

示例11: testPropertyIsEqualToFloat

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testPropertyIsEqualToFloat() {
    PropertyIsEqualTo filter = ff.equals(ff.property("floatAttr"), ff.literal("4.5"));
    Map<String,Object> expected = ImmutableMap.of("term", ImmutableMap.of("floatAttr", 4.5f));

    builder.visit(filter, null);
    assertTrue(builder.createFilterCapabilities().fullySupports(filter));
    assertEquals(expected, builder.getQueryBuilder());
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:10,
代码来源:ElasticFilterTest.java

示例12: testPropertyIsEqualToInteger

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testPropertyIsEqualToInteger() {
    PropertyIsEqualTo filter = ff.equals(ff.property("integerAttr"), ff.literal("4"));
    Map<String,Object> expected = ImmutableMap.of("term", ImmutableMap.of("integerAttr", 4));

    builder.visit(filter, null);
    assertTrue(builder.createFilterCapabilities().fullySupports(filter));
    assertEquals(expected, builder.getQueryBuilder());
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:10,
代码来源:ElasticFilterTest.java

示例13: testPropertyIsEqualToBoolean

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testPropertyIsEqualToBoolean() {
    PropertyIsEqualTo filter = ff.equals(ff.property("booleanAttr"), ff.literal("true"));
    Map<String,Object> expected = ImmutableMap.of("term", ImmutableMap.of("booleanAttr", true));

    builder.visit(filter, null);
    assertTrue(builder.createFilterCapabilities().fullySupports(filter));
    assertEquals(expected, builder.getQueryBuilder());
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:10,
代码来源:ElasticFilterTest.java

示例14: testCountWithIsEqualFilter

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testCountWithIsEqualFilter() throws Exception {
    init();
    FilterFactory ff = dataStore.getFilterFactory();
    PropertyIsEqualTo filter = ff.equals(ff.property("vendor_s"), ff.literal("D-Link"));
    Query query = new Query();
    query.setFilter(filter);
    assertEquals(4, featureSource.getCount(query));
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:10,
代码来源:ElasticFeatureFilterIT.java

示例15: testGetFeaturesWithAndLogicFilter

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testGetFeaturesWithAndLogicFilter() throws Exception {
    init();
    FilterFactory ff = dataStore.getFilterFactory();
    PropertyIsEqualTo property = ff.equals(ff.property("standard_ss"),
            ff.literal("IEEE 802.11b"));
    BBOX bbox = ff.bbox("geo", -1, -1, 10, 10, "EPSG:" + SOURCE_SRID);
    And filter = ff.and(property, bbox);
    SimpleFeatureCollection features = featureSource.getFeatures(filter);
    assertEquals(3, features.size());
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:12,
代码来源:ElasticFeatureFilterIT.java

示例16: testGetFeaturesWithNOTLogicFilter

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testGetFeaturesWithNOTLogicFilter() throws Exception {
    init();
    FilterFactory ff = dataStore.getFilterFactory();
    PropertyIsEqualTo property1 = ff.equals(ff.property("vendor_s"), ff.literal("D-Link"));
    Not filter = ff.not(property1);
    SimpleFeatureCollection features = featureSource.getFeatures(filter);
    assertEquals(7, features.size());
    SimpleFeatureIterator iterator = features.features();
    while (iterator.hasNext()) {
        SimpleFeature f = iterator.next();
        assertTrue(!f.getAttribute("vendor_s").equals("D-Link"));
    }
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:15,
代码来源:ElasticFeatureFilterIT.java

示例17: visit

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Override
public Object visit(
		final PropertyIsEqualTo filter,
		final Object data ) {
	return new ExtractGeometryFilterVisitorResult(
			infinity(),
			null);
}
 

开发者ID:locationtech,
项目名称:geowave,
代码行数:9,
代码来源:ExtractGeometryFilterVisitor.java

示例18: visit

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Override
public Object visit(
		final PropertyIsEqualTo filter,
		final Object data ) {
	final TemporalConstraints leftResult = (TemporalConstraints) filter.getExpression1().accept(
			this,
			data);
	final TemporalConstraints rightResult = (TemporalConstraints) filter.getExpression2().accept(
			this,
			data);
	if (leftResult.isEmpty() || rightResult.isEmpty()) {
		return new TemporalConstraints();
	}
	if (leftResult instanceof ParameterTimeConstraint) {
		return new ParameterTimeConstraint(
				new TemporalRange(
						rightResult.getStartRange().getStartTime(),
						rightResult.getEndRange().getEndTime()),
				leftResult.getName());
	}
	else {
		return new ParameterTimeConstraint(
				new TemporalRange(
						leftResult.getStartRange().getStartTime(),
						leftResult.getEndRange().getEndTime()),
				rightResult.getName());
	}
}
 

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

示例19: visit

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Override
public Object visit(
		final PropertyIsEqualTo filter,
		final Object data ) {
	final ByteArrayId leftResult = (ByteArrayId) filter.getExpression1().accept(
			this,
			data);

	final Object value = filter.getExpression2().accept(
			this,
			data);

	if (value instanceof Number) {
		return new PropertyConstraintSet(
				new NumericEqualsConstraint(
						leftResult,
						(Number) value));
	}
	else if (value instanceof String) {
		return new PropertyConstraintSet(
				new TextQueryConstraint(
						leftResult,
						(String) value,
						true));
	}
	else {
		return new PropertyConstraintSet();
	}

}
 

开发者ID:locationtech,
项目名称:geowave,
代码行数:31,
代码来源:PropertyFilterVisitor.java

示例20: visit

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Override
public Object visit(
		final PropertyIsEqualTo filter,
		final Object extraData ) {
	if (!usesProperty(filter)) {
		return Filter.INCLUDE;
	}
	return super.visit(
			filter,
			extraData);
}
 

开发者ID:locationtech,
项目名称:geowave,
代码行数:12,
代码来源:PropertyIgnoringFilterVisitor.java

示例21: visit

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public Object visit(PropertyIsEqualTo filter, Object userData) {
	String propertyName = getPropertyName(filter.getExpression1());
	String finalName = parsePropertyName(propertyName, userData);

	Object value = castLiteral(getLiteralValue(filter.getExpression2()), propertyName);
	return Restrictions.eq(finalName, value);
}
 

开发者ID:geomajas,
项目名称:geomajas-project-server,
代码行数:10,
代码来源:CriteriaVisitor.java

示例22: testParseFidFilter

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testParseFidFilter() throws GeomajasException {
	Filter f1 = filterService.parseFilter("IN( 1 )");
	Filter f2 = filterService.parseFilter("[email protected] = 1");
	Assert.assertTrue(f1 instanceof Id);
	Assert.assertTrue(f2 instanceof PropertyIsEqualTo);
	PropertyIsEqualTo piet = (PropertyIsEqualTo)f2;
	Assert.assertTrue(piet.getExpression1() instanceof PropertyName);
	Assert.assertEquals("a/@id",((PropertyName)piet.getExpression1()).getPropertyName());
	
}
 

开发者ID:geomajas,
项目名称:geomajas-project-server,
代码行数:12,
代码来源:FilterServiceTest.java

示例23: createFilter

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
/**
 * Creates the filter.
 *
 * @param rule the rule
 * @param fieldsElement the fields element
 * @param fieldDelimiterElement the field delimiter element
 * @param value the value
 */
private void createFilter(Rule rule, JsonElement fieldsElement,
    JsonElement fieldDelimiterElement, String value)
{
    if(fieldsElement == null) return;

    if(value == null)
    {
        rule.setElseFilter(true);
    }
    else
    {
        List<String> fieldList = new ArrayList<String>();

        JsonArray fieldArray = fieldsElement.getAsJsonArray();

        for(int fieldIndex = 0; fieldIndex < fieldArray.size(); fieldIndex ++)
        {
            JsonElement jsonFieldElement = fieldArray.get(fieldIndex);
            if(jsonFieldElement != null)
            {
                JsonObject fieldObj = jsonFieldElement.getAsJsonObject();
                fieldList.add(fieldObj.get("name").getAsString());
            }
        }

        String[] values = null;

        if(fieldDelimiterElement != null)
        {
            values = value.split(fieldDelimiterElement.getAsString());
        }
        else
        {
            values = new String[1];
            values[0] = value;
        }

        List<Filter> filterList = new ArrayList<Filter>();

        int index = 0;
        while(index < values.length)
        {
            Expression fieldExpression = filterFactory.property(fieldList.get(index));
            Expression valueExpression = filterFactory.literal(values[index]);

            PropertyIsEqualTo filter = filterFactory.equals(fieldExpression, valueExpression);

            filterList.add(filter);
            index ++;
        }

        Filter completeFilter = null;

        if(filterList.size() > 1)
        {
            completeFilter = filterFactory.and(filterList);
        }
        else if(filterList.size() == 1)
        {
            completeFilter = filterList.get(0);
        }

        rule.setFilter(completeFilter);
    }
}
 

开发者ID:robward-scisys,
项目名称:sldeditor,
代码行数:74,
代码来源:UniqueValueRenderer.java

示例24: visit

点赞 2

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Override
public Object visit(PropertyIsEqualTo piet, 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

示例25: testNativeBooleanQuery

点赞 1

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testNativeBooleanQuery() throws Exception {
    init();
    Map<String, String> vparams = new HashMap<String, String>();
    Map<String,Object> query = ImmutableMap.of("bool", ImmutableMap.of("must", 
            ImmutableMap.of("term", ImmutableMap.of("security_ss", "WPA")),
            "must_not", ImmutableMap.of("term", ImmutableMap.of("modem_b", true))));
    vparams.put("q", mapper.writeValueAsString(query));
    Hints hints = new Hints(Hints.VIRTUAL_TABLE_PARAMETERS, vparams);
    Query q = new Query(featureSource.getSchema().getTypeName());
    q.setHints(hints);
    FilterFactory ff = dataStore.getFilterFactory();
    PropertyIsEqualTo filter = ff.equals(ff.property("speed_is"), ff.literal("300"));
    q.setFilter(filter);
    ContentFeatureCollection features = featureSource.getFeatures(q);
    assertEquals(2, features.size());
    SimpleFeatureIterator fsi = features.features();
    assertTrue(fsi.hasNext());
    assertEquals(fsi.next().getAttribute("modem_b"), false);
    assertTrue(fsi.hasNext());
    assertEquals(fsi.next().getAttribute("modem_b"), false);
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:23,
代码来源:ElasticViewParametersFilterIT.java

示例26: visit

点赞 1

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
/**
 * Write the FilterBuilder for this kind of filter
 * 
 * @param filter the filter to visit
 * @param extraData extra data (unused by this method)
 * 
 */
public Object visit(PropertyIsEqualTo filter, Object extraData) {
    visitBinaryComparisonOperator((BinaryComparisonOperator)filter, "=");
    return extraData;
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:12,
代码来源:FilterToElastic.java

示例27: testNativeTermQuery

点赞 1

import org.opengis.filter.PropertyIsEqualTo; //导入依赖的package包/类
@Test
public void testNativeTermQuery() throws Exception {
    init("not-active");
    Map<String, String> vparams = new HashMap<String, String>();
    Map<String,Object> query = ImmutableMap.of("term", ImmutableMap.of("security_ss", "WPA"));
    vparams.put("q", mapper.writeValueAsString(query));
    Hints hints = new Hints(Hints.VIRTUAL_TABLE_PARAMETERS, vparams);
    Query q = new Query(featureSource.getSchema().getTypeName());
    q.setHints(hints);
    FilterFactory ff = dataStore.getFilterFactory();
    PropertyIsEqualTo filter = ff.equals(ff.property("speed_is"), ff.literal("300"));
    q.setFilter(filter);
    ContentFeatureCollection features = featureSource.getFeatures(q);
    assertEquals(1, features.size());
    SimpleFeatureIterator fsi = features.features();
    assertTrue(fsi.hasNext());
    assertEquals(fsi.next().getID(), "active.12");
}
 

开发者ID:ngageoint,
项目名称:elasticgeo,
代码行数:19,
代码来源:ElasticViewParametersFilterIT.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)