本文整理汇总了Java中org.opengis.filter.Id类的典型用法代码示例。如果您正苦于以下问题:Java Id类的具体用法?Java Id怎么用?Java Id使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Id类属于org.opengis.filter包,在下文中一共展示了Id类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createFilterTest
import org.opengis.filter.Id; //导入依赖的package包/类
@Test
@DirtiesContext // @todo need to check why this is necessary, otherwise next test fails? (GetVectorTileCommandTest)
// probably cause by directly using the command service which has an injected security context
public void createFilterTest() throws Exception {
SearchFeatureRequest request = new SearchFeatureRequest();
request.setLayerId(LAYER_ID);
request.setCrs("EPSG:4326");
SearchCriterion searchCriterion = new SearchCriterion();
Filter filter;
// needs to be FidFilter when equals test on id
searchCriterion.setAttributeName(ID_ATTRIBUTE);
searchCriterion.setOperator("=");
searchCriterion.setValue("'1'");
request.setCriteria(new SearchCriterion[] {searchCriterion});
filter = searchFeatureCommand.createFilter(request, LAYER_ID);
Assert.assertTrue(filter instanceof Id);
// but *not* when other test
searchCriterion.setAttributeName(ID_ATTRIBUTE);
searchCriterion.setOperator("like");
searchCriterion.setValue("'%a%'");
request.setCriteria(new SearchCriterion[] {searchCriterion});
filter = searchFeatureCommand.createFilter(request, LAYER_ID);
Assert.assertFalse(filter instanceof Id);
}
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:27,代码来源:SearchFeatureCommandTest.java
示例2: createFilterCapabilities
import org.opengis.filter.Id; //导入依赖的package包/类
/**
* Sets the capabilities of this filter.
*
* @return FilterCapabilities for this Filter
*/
protected FilterCapabilities createFilterCapabilities() {
FilterCapabilities capabilities = new FilterCapabilities();
capabilities.addAll(FilterCapabilities.LOGICAL_OPENGIS);
capabilities.addAll(FilterCapabilities.SIMPLE_COMPARISONS_OPENGIS);
capabilities.addType(PropertyIsNull.class);
capabilities.addType(PropertyIsBetween.class);
capabilities.addType(Id.class);
capabilities.addType(IncludeFilter.class);
capabilities.addType(ExcludeFilter.class);
capabilities.addType(PropertyIsLike.class);
// spatial filters
capabilities.addType(BBOX.class);
capabilities.addType(Contains.class);
//capabilities.addType(Crosses.class);
capabilities.addType(Disjoint.class);
//capabilities.addType(Equals.class);
capabilities.addType(Intersects.class);
//capabilities.addType(Overlaps.class);
//capabilities.addType(Touches.class);
capabilities.addType(Within.class);
capabilities.addType(DWithin.class);
capabilities.addType(Beyond.class);
//temporal filters
capabilities.addType(After.class);
capabilities.addType(Before.class);
capabilities.addType(Begins.class);
capabilities.addType(BegunBy.class);
capabilities.addType(During.class);
capabilities.addType(Ends.class);
capabilities.addType(EndedBy.class);
capabilities.addType(TContains.class);
capabilities.addType(TEquals.class);
return capabilities;
}
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:44,代码来源:FilterToElastic.java
示例3: visit
import org.opengis.filter.Id; //导入依赖的package包/类
/**
* Encodes an Id filter
*
* @param filter the
*
*/
public Object visit(Id filter, Object extraData) {
final List<String> idList = new ArrayList<>();
for (final Identifier id : filter.getIdentifiers()) {
idList.add(id.toString());
}
ids = idList;
queryBuilder = ImmutableMap.of("ids", ImmutableMap.of("values", ids));
return extraData;
}
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:18,代码来源:FilterToElastic.java
示例4: testId
import org.opengis.filter.Id; //导入依赖的package包/类
@Test
public void testId() {
final Id filter = ff.id(ff.featureId("id"));
Map<String,Object> expected = ImmutableMap.of("ids", ImmutableMap.of("values", ImmutableList.of("id")));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:10,代码来源:ElasticFilterTest.java
示例5: testGetFeaturesWithIdFilter
import org.opengis.filter.Id; //导入依赖的package包/类
@Test
public void testGetFeaturesWithIdFilter() throws Exception {
init();
FilterFactory ff = dataStore.getFilterFactory();
Id id = ff.id(new HashSet<FeatureId>(Arrays.asList(ff.featureId("01"),
ff.featureId("07"))));
SimpleFeatureCollection features = featureSource.getFeatures(id);
assertEquals(2, features.size());
}
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:10,代码来源:ElasticFeatureFilterIT.java
示例6: visit
import org.opengis.filter.Id; //导入依赖的package包/类
@Override
public Object visit(
final Id filter,
final Object data ) {
return new ExtractGeometryFilterVisitorResult(
infinity(),
null);
}
开发者ID:locationtech,项目名称:geowave,代码行数:9,代码来源:ExtractGeometryFilterVisitor.java
示例7: tesFid
import org.opengis.filter.Id; //导入依赖的package包/类
@Test
public void tesFid() {
final FilterFactoryImpl factory = new FilterFactoryImpl();
final Id f = factory.id(new FeatureIdImpl(
"123-abc"));
final String ss = ECQL.toCQL(f);
System.out.println(ss);
assertTrue(ss.contains("'123-abc'"));
}
开发者ID:locationtech,项目名称:geowave,代码行数:11,代码来源:FilterToCQLToolTest.java
示例8: visit
import org.opengis.filter.Id; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public Object visit(Id filter, Object userData) {
String idName;
try {
idName = featureModel.getEntityMetadata().getIdentifierPropertyName();
} catch (LayerException e) {
log.warn("Cannot read idName, defaulting to 'id'", e);
idName = HIBERNATE_ID;
}
Collection<?> c = (Collection<?>) castLiteral(filter.getIdentifiers(), idName);
return Restrictions.in(idName, c);
}
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:14,代码来源:CriteriaVisitor.java
示例9: testParseFidFilter
import org.opengis.filter.Id; //导入依赖的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
示例10: testPopulateFieldString
import org.opengis.filter.Id; //导入依赖的package包/类
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.FieldConfigBase#populateField(java.lang.String)}.
*/
@Test
public void testPopulateFieldString() {
FieldIdEnum expectedFieldId = FieldIdEnum.NAME;
String expectedLabel = "test label";
TestFieldConfigBase field = new TestFieldConfigBase(
new FieldConfigCommonData(String.class, expectedFieldId, expectedLabel, false));
field.populateField("");
field.setTestValue(expectedFieldId, "");
field.populateField(42);
field.setTestValue(expectedFieldId, 42);
assertEquals(0, field.getIntValue());
field.populateField(3.142);
field.setTestValue(expectedFieldId, 3.142);
assertTrue(Math.abs(field.getDoubleValue()) < 0.0001);
field.populateField(new Date());
field.populateField((ReferencedEnvelope) null);
field.setTestValue(expectedFieldId, (ReferencedEnvelope) null);
field.populateField((Id) null);
field.populateField((TimePeriod) null);
field.populateField((ProcessFunction) null);
assertNull(field.getProcessFunction());
field.populateField(true);
field.setTestValue(expectedFieldId, true);
assertEquals(false, field.getBooleanValue());
field.populateField((ColorMap) null);
field.setTestValue(expectedFieldId, (ColorMap) null);
assertNull(field.getColourMap());
field.populateField((List<FeatureTypeConstraint>) null);
field.setTestValue(expectedFieldId, (List<FeatureTypeConstraint>) null);
assertNull(field.getFeatureTypeConstraint());
field.populateField((Font) null);
assertNull(field.getFont());
field.setTestValue(expectedFieldId, (Expression) null);
assertNull(field.getEnumValue());
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:50,代码来源:FieldConfigBaseTest.java
示例11: visit
import org.opengis.filter.Id; //导入依赖的package包/类
@Override
public Object visit(Id id, 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
示例12: visit
import org.opengis.filter.Id; //导入依赖的package包/类
@Override
public Object visit(
final Id filter,
final Object data ) {
return new TemporalConstraints();
}
开发者ID:locationtech,项目名称:geowave,代码行数:7,代码来源:ExtractTimeFilterVisitor.java
示例13: visit
import org.opengis.filter.Id; //导入依赖的package包/类
@Override
public Object visit(
final Id filter,
final Object data ) {
return new PropertyConstraintSet();
}
开发者ID:locationtech,项目名称:geowave,代码行数:7,代码来源:PropertyFilterVisitor.java
示例14: populateField
import org.opengis.filter.Id; //导入依赖的package包/类
/**
* Populate field.
*
* @param value the value
*/
public void populateField(Id value);
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:7,代码来源:FieldConfigValuePopulateInterface.java
示例15: populateField
import org.opengis.filter.Id; //导入依赖的package包/类
/**
* Populate string field, overridden if necessary.
*
* @param value the value
*/
@Override
public void populateField(Id value) {
// Do nothing
}
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:10,代码来源:FieldConfigPopulate.java
注:本文中的org.opengis.filter.Id类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论