Permalink
Browse files

[OGR] Correctly extract BBOX from a Intersects() filter. Complementar…

…y fix to f53fd78
  • Loading branch information...
rouault committed Jun 19, 2017
1 parent 1df03be commit aae74ff2abed3f2f8fe1f76c9b4bbccf15023dc1
Showing with 13 additions and 1 deletion.
  1. +13 −1 mapogr.cpp
View
@@ -3268,14 +3268,15 @@ static msExprNode* BuildExprTree(tokenListNodeObjPtr node,
{
if( node->next && node->next->token == '(' )
{
int node_token = node->token;
msExprNode* subExpr = BuildExprTree(node->next->next, &node,
nParenthesisLevel + 1);
if( subExpr == NULL )
{
goto fail;
}
msExprNode* newNode = new msExprNode;
newNode->m_nToken = node->token;
newNode->m_nToken = node_token;
if( subExpr->m_nToken == 0 )
{
newNode->m_aoChildren = subExpr->m_aoChildren;
@@ -3393,6 +3394,8 @@ static msExprNode* BuildExprTree(tokenListNodeObjPtr node,
/**********************************************************************
* msOGRExtractTopSpatialFilter()
*
* Recognize expressions like "Intersects([shape], wkt) == TRUE [AND ....]"
**********************************************************************/
static int msOGRExtractTopSpatialFilter( msOGRFileInfo *info,
const msExprNode* expr,
@@ -3401,6 +3404,15 @@ static int msOGRExtractTopSpatialFilter( msOGRFileInfo *info,
if( expr == NULL )
return MS_FALSE;
if( expr->m_nToken == MS_TOKEN_COMPARISON_EQ &&
expr->m_aoChildren.size() == 2 &&
expr->m_aoChildren[1]->m_nToken == MS_TOKEN_LITERAL_BOOLEAN &&
expr->m_aoChildren[1]->m_dfVal == 1.0 )
{
return msOGRExtractTopSpatialFilter(info, expr->m_aoChildren[0],
pSpatialFilterNode);
}
if( expr->m_nToken == MS_TOKEN_COMPARISON_INTERSECTS &&
expr->m_aoChildren.size() == 2 &&
expr->m_aoChildren[1]->m_nToken == MS_TOKEN_LITERAL_SHAPE )

0 comments on commit aae74ff

Please sign in to comment.