org.opengis.filter.temporal.Before Java Examples

The following examples show how to use org.opengis.filter.temporal.Before. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExtractTimeFilterVisitor.java    From geowave with Apache License 2.0 6 votes vote down vote up
@Override
public Object visit(final Before before, final Object data) {
  final TemporalConstraints leftResult = btime(before.getExpression1().accept(this, data));
  final TemporalConstraints rightResult = btime(before.getExpression2().accept(this, data));

  if (leftResult.isEmpty() || rightResult.isEmpty()) {
    return new TemporalConstraints();
  }

  // property before value
  if (leftResult instanceof ParameterTimeConstraint) {
    return new ParameterTimeConstraint(
        new TemporalRange(
            TemporalRange.START_TIME,
            rightResult.getMinOr(TemporalRange.END_TIME, -1)),
        leftResult.getName());
  } else if (rightResult instanceof ParameterTimeConstraint) {
    return new ParameterTimeConstraint(
        new TemporalRange(
            leftResult.getMaxOr(TemporalRange.START_TIME, 1),
            TemporalRange.END_TIME),
        rightResult.getName());
  }
  // property after property
  return new TemporalConstraints();
}
 
Example #2
Source File: ElasticCapabilities.java    From elasticgeo with GNU General Public License v3.0 5 votes vote down vote up
public ElasticCapabilities() {
    super(new ElasticFilterCapabilities());

    addAll(LOGICAL_OPENGIS);
    addAll(SIMPLE_COMPARISONS_OPENGIS);
    addType(PropertyIsNull.class);
    addType(PropertyIsBetween.class);
    addType(Id.class);
    addType(IncludeFilter.class);
    addType(ExcludeFilter.class);
    addType(PropertyIsLike.class);

    // spatial filters
    addType(BBOX.class);
    addType(Contains.class);
    //addType(Crosses.class);
    addType(Disjoint.class);
    //addType(Equals.class);
    addType(Intersects.class);
    //addType(Overlaps.class);
    //addType(Touches.class);
    addType(Within.class);
    addType(DWithin.class);
    addType(Beyond.class);

    //temporal filters
    addType(After.class);
    addType(Before.class);
    addType(Begins.class);
    addType(BegunBy.class);
    addType(During.class);
    addType(Ends.class);
    addType(EndedBy.class);
    addType(TContains.class);
    addType(TEquals.class);
}
 
Example #3
Source File: PropertyIgnoringFilterVisitor.java    From geowave with Apache License 2.0 5 votes vote down vote up
@Override
public Object visit(final Before before, final Object extraData) {
  if (!usesProperty(before)) {
    return Filter.INCLUDE;
  }
  return super.visit(before, extraData);
}
 
Example #4
Source File: PropertyIgnoringFilterVisitor.java    From geowave with Apache License 2.0 5 votes vote down vote up
@Override
public Object visit(final Before before, final Object extraData) {
  if (!usesProperty(before)) {
    return Filter.INCLUDE;
  }
  return super.visit(before, extraData);
}
 
Example #5
Source File: CriteriaVisitor.java    From geomajas-project-server with GNU Affero General Public License v3.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public Object visit(Before before, Object extraData) {
	String propertyName = getPropertyName(before.getExpression1());
	String finalName = parsePropertyName(propertyName, before);
	Object literal = getLiteralValue(before.getExpression2());
	if (literal instanceof Date) {
		return Restrictions.lt(finalName, literal);
	} else {
		throw new UnsupportedOperationException("visit(Object userData)");
	}
}
 
Example #6
Source File: FilterToElastic.java    From elasticgeo with GNU General Public License v3.0 4 votes vote down vote up
public Object visit(Before before, Object extraData) {
    return visitBinaryTemporalOperator(before, extraData);
}