Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AND and OR for multiple arguments #836

Closed
wants to merge 1 commit into from

Conversation

ahocevar
Copy link
Member

No description provided.

@ahocevar
Copy link
Member Author

Closing, as discussed in the hangout. Instead, we create a function in filter encoding that detects constructs like (foo && (bar && (baz && bam))) and turns them into a filter with multiple ANDs.

@ahocevar ahocevar closed this Jun 27, 2013
@ahocevar ahocevar deleted the multi-and-or branch June 27, 2013 15:41
@tschaub
Copy link
Member

tschaub commented Jun 27, 2013

Also note that in the meantime, we can focus on reading/writing FE without round-tripping exactly.

So this ol.expr.parse('foo && bar && baz && bam') produces a tree that roughly looks like this:

{
  type: ol.expr.Logical
  left: {
    type: ol.expr.Logical,
    left: {
      type: ol.expr.Logical,
      left: {
        type: ol.expr.Identifier,
        name: 'foo'
      },
      operator: '&&',
      right: {
        type: ol.expr.Identifier,
        name: 'bar'      
      }
    },
    operator: '&&',
    right: {
      type: ol.expr.Identifier,
      name: 'baz'    
    }
  },
  operator: '&&',
  right: {
    type: ol.expr.Identifier,
    name: 'bam'
  }
}

If you serialize this blindly, you'll create nested filter:And elements with two children each instead of one filter:And element with four children. The logic is the same. And when you are deserializing, and you encounter filter:And you create one ol.expr.Logical for the first pair of children as left/right, another ol.expr.Logical with left created above and right the next child, and so forth.

Yes, this results in more verbose FE than necessary. But I don't think the parser should block on getting the round-tripped doc.

afabiani pushed a commit to geosolutions-it/openlayers that referenced this pull request May 22, 2017
No .olTileReplacing class for singleTile layers. r=@bartvde
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants