[mapserver-commits] r10932 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Thu Feb 3 06:56:40 EST 2011


Author: assefa
Date: 2011-02-03 03:56:40 -0800 (Thu, 03 Feb 2011)
New Revision: 10932

Modified:
   trunk/mapserver/mapogcfilter.c
Log:
remove unused code (#3613)

Modified: trunk/mapserver/mapogcfilter.c
===================================================================
--- trunk/mapserver/mapogcfilter.c	2011-02-02 22:13:15 UTC (rev 10931)
+++ trunk/mapserver/mapogcfilter.c	2011-02-03 11:56:40 UTC (rev 10932)
@@ -211,307 +211,7 @@
     return nStatus;
 }
     
-/************************************************************************/
-/*                        FLTGetQueryResultsForNode                     */
-/*                                                                      */
-/*      Return an array of shape id's selected after the filter has     */
-/*      been applied.                                                   */
-/*      Assuming here that the node is not a logical node but           */
-/*      spatial or comparaison.                                         */
-/************************************************************************/
-int FLTGetQueryResultsForNode(FilterEncodingNode *psNode, mapObj *map, 
-                              int iLayerIndex, int **ppanResults, int *pnResults,
-                              int bOnlySpatialFilter)
-{
-    char *szExpression = NULL;
-    int bIsBBoxFilter =0,  i=0;
-    char *szEPSG = NULL;
-    rectObj sQueryRect = map->extent;
-    layerObj *lp = NULL;
-    projectionObj sProjTmp;
-    int bPointQuery = 0, bShapeQuery=0;
-    shapeObj *psQueryShape = NULL;
-    double dfDistance = -1;
-    double dfCurrentTolerance = 0;
-    int nUnit = -1;
-    int bUseGeos = 0;
-    int geos_operator = -1;
-    shapeObj *psTmpShape = NULL;
-    int *panResults=NULL;
-    int status = MS_SUCCESS;
 
-    if (!psNode || !map || iLayerIndex < 0 ||
-        iLayerIndex > map->numlayers-1)
-      return status;
-  
-    lp = GET_LAYER(map, iLayerIndex);
-
-    if (!bOnlySpatialFilter)
-      szExpression = FLTGetMapserverExpression(psNode, lp);
-
-    bIsBBoxFilter = FLTIsBBoxFilter(psNode);
-    bUseGeos = 1;
-    if (strcasecmp(psNode->pszValue, "BBOX") == 0)
-      bUseGeos = 0;
-    else
-      geos_operator = FLTGetGeosOperator(psNode->pszValue);
-
-    if (bIsBBoxFilter)
-      szEPSG = FLTGetBBOX(psNode, &sQueryRect);
-    else if ((bPointQuery = FLTIsPointFilter(psNode)))
-    {
-        psQueryShape = FLTGetShape(psNode, &dfDistance, &nUnit);
-    }
-    else if (FLTIsLineFilter(psNode) || FLTIsPolygonFilter(psNode))
-    {
-        bShapeQuery = 1;
-        psQueryShape = FLTGetShape(psNode, &dfDistance, &nUnit);
-        
-            
-    }
-
-    if (!szExpression && !szEPSG && !bIsBBoxFilter 
-        && !bPointQuery && !bShapeQuery && (bOnlySpatialFilter == MS_FALSE))
-      return status;
-
-
-    if (szExpression)
-    {
-        for(i=0;i<lp->numclasses;i++) 
-        {
-            if (lp->class[i] != NULL) {
-                lp->class[i]->layer=NULL;
-                if ( freeClass(lp->class[i]) == MS_SUCCESS ) {
-                    msFree(lp->class[i]);
-                    lp->class[i] = NULL;
-                }
-            }
-        }
-        lp->numclasses = 0;
-        if (msGrowLayerClasses(lp) == NULL)
-            return MS_FAILURE;
-       	initClass(lp->class[0]);
-
-        lp->class[0]->type = lp->type;
-        lp->numclasses = 1;
-        msLoadExpressionString(&lp->class[0]->expression, 
-                               szExpression);
-
-        if (!lp->class[0]->template)
-          lp->class[0]->template = msStrdup("ttt.html");
-/* -------------------------------------------------------------------- */
-/*      Need to free the template so the all shapes's will not end      */
-/*      up being queried. The query is dependent on the class           */
-/*      expression.                                                     */
-/* -------------------------------------------------------------------- */
-        if (lp->template)
-        {
-            free(lp->template);
-            lp->template = NULL;
-        }
-    }
-    else if (!bOnlySpatialFilter)
-    {
-        /* if there are no expression (so no template set in the classes, */
-        /* make sure that the layer is queryable by setting the template  */
-        /* parameter */
-        if (!lp->template)
-          lp->template = msStrdup("ttt.html");
-    }
-/* -------------------------------------------------------------------- */
-/*      Use the epsg code to reproject the values from the QueryRect    */
-/*      to the map projection.                                          */
-/*      The srs should be a string like                                 */
-/*      srsName="http://www.opengis.net/gml/srs/epsg.xml#4326".         */
-/*      We will just extract the value after the # and assume that      */
-/*      It corresponds to the epsg code on the system. This syntax      */
-/*      is the one descibed in the GML specification.                   */
-/*                                                                      */
-/*       There is also several servers requesting the box with the      */
-/*      srsName using the following syntax : <Box                       */
-/*      srsName="EPSG:42304">. So we also support this syntax.          */
-/*                                                                      */
-/* -------------------------------------------------------------------- */
-    if(szEPSG && map->projection.numargs > 0)
-    {
-        if (FLTParseEpsgString(szEPSG, &sProjTmp))
-        {
-            if( msProjectRect(&sProjTmp, &map->projection, &sQueryRect)
-                != MS_SUCCESS )
-                return MS_FAILURE;
-        }
-        else
-            return MS_FAILURE;
-    }
-
-
-    if (szExpression || bIsBBoxFilter || (bOnlySpatialFilter && !bIsBBoxFilter && !bPointQuery && !bShapeQuery)) {
-      map->query.type = MS_QUERY_BY_RECT;
-      map->query.mode = MS_QUERY_MULTIPLE;
-      map->query.layer = lp->index;
-      map->query.rect = sQueryRect;
-      status = msQueryByRect(map);
-    } else if (bPointQuery && psQueryShape && psQueryShape->numlines > 0
-             && psQueryShape->line[0].numpoints > 0) /* && dfDistance >=0) */
-    {
-        if (psNode->pszSRS &&  map->projection.numargs > 0 )
-        {
-            if( !FLTParseEpsgString(psNode->pszSRS, &sProjTmp) )
-                return MS_FAILURE;
-
-            status = msProjectShape(&sProjTmp, &map->projection, psQueryShape);
-            if( status != MS_SUCCESS )
-                return status;
-        }
-
-        if (bUseGeos)
-        {
-            if ((strcasecmp(psNode->pszValue, "DWithin") == 0 ||
-                 strcasecmp(psNode->pszValue, "Beyond") == 0 ) &&
-                dfDistance > 0)
-            {
-                if (nUnit >=0 && nUnit != map->units)
-                  dfDistance *= msInchesPerUnit(nUnit,0)/msInchesPerUnit(map->units,0);
-
-                psTmpShape = msGEOSBuffer(psQueryShape, dfDistance);
-                if (psTmpShape)
-                {
-                    map->query.type = MS_QUERY_BY_OPERATOR;
-                    map->query.mode = MS_QUERY_MULTIPLE;
-                    map->query.layer = lp->index;
-                    map->query.shape = psTmpShape;
-                    map->query.op = geos_operator;
-                    status = msQueryByOperator(map);
-                }
-            }
-            else 
-            {
-              map->query.type = MS_QUERY_BY_OPERATOR;
-              map->query.mode = MS_QUERY_MULTIPLE;
-              map->query.layer = lp->index;
-              map->query.shape = (shapeObj *) malloc(sizeof(shapeObj));
-              msInitShape(map->query.shape);
-              msCopyShape(psQueryShape, map->query.shape);
-              map->query.op = geos_operator;
-              status = msQueryByOperator(map);
-            }
-        } 
-        else
-        {
-            /*Set the tolerance to the distance value or 0 is invalid
-              set the the unit if unit is valid.
-              Bug 1342 for details*/
-            lp->tolerance = 0;
-            if (dfDistance > 0)
-            {
-                lp->tolerance = dfDistance;
-                if (nUnit >=0)
-                  lp->toleranceunits = nUnit;
-            }
-
-            map->query.type = MS_QUERY_BY_POINT;
-            map->query.mode = MS_QUERY_MULTIPLE;
-            map->query.layer = lp->index;
-            map->query.point = psQueryShape->line[0].point[0]; 
-            status = msQueryByPoint(map);
-        }
-    }
-    else if (bShapeQuery && psQueryShape && psQueryShape->numlines > 0
-             && psQueryShape->line[0].numpoints > 0)
-    {
-        /*reproject shape if epsg was set*/
-        if (psNode->pszSRS &&  map->projection.numargs > 0 )
-        {
-            if( !FLTParseEpsgString(psNode->pszSRS, &sProjTmp) )
-                return MS_FAILURE;
-
-            status = msProjectShape(&sProjTmp, &map->projection, psQueryShape);
-            if( status != MS_SUCCESS )
-                return status;
-        }
-
-        if (bUseGeos)
-        {
-            if ((strcasecmp(psNode->pszValue, "DWithin") == 0 ||
-                 strcasecmp(psNode->pszValue, "Beyond") == 0 ) &&
-                dfDistance > 0)
-            {
-/* -------------------------------------------------------------------- */
-/*      if units is set, covert value from unit to map unit.            */
-/* -------------------------------------------------------------------- */
-                if (nUnit >=0 && nUnit != map->units)
-                  dfDistance *= msInchesPerUnit(nUnit,0)/msInchesPerUnit(map->units,0);
-
-                psTmpShape = msGEOSBuffer(psQueryShape, dfDistance);
-                if (psTmpShape)
-                {
-                    map->query.type = MS_QUERY_BY_OPERATOR;
-                    map->query.mode = MS_QUERY_MULTIPLE;
-                    map->query.layer = lp->index;
-                    map->query.shape = psTmpShape;
-                    map->query.op = geos_operator;
-                    status = msQueryByOperator(map);
-                }
-            } 
-            else
-            {
-              map->query.type = MS_QUERY_BY_OPERATOR;
-              map->query.mode = MS_QUERY_MULTIPLE;
-              map->query.layer = lp->index;
-              map->query.shape = (shapeObj *) malloc(sizeof(shapeObj));
-              msInitShape(map->query.shape);
-              msCopyShape(psQueryShape, map->query.shape);
-              map->query.op = geos_operator;
-              status = msQueryByOperator(map);
-            }
-        }
-        else
-        {
-            /* disable any tolerance value already set for the layer (Bug 768)
-               Set the tolerance to the distance value or 0 is invalid
-               set the the unit if unit is valid.
-               Bug 1342 for details */
-
-            dfCurrentTolerance = lp->tolerance;
-            lp->tolerance = 0;
-            if (dfDistance > 0)
-            {
-                lp->tolerance = dfDistance;
-                if (nUnit >=0)
-                  lp->toleranceunits = nUnit;
-            }
-            map->query.type = MS_QUERY_BY_SHAPE;
-            map->query.mode = MS_QUERY_MULTIPLE;
-            map->query.layer = lp->index;
-            map->query.shape = (shapeObj *) malloc(sizeof(shapeObj));
-            msInitShape(map->query.shape);
-            msCopyShape(psQueryShape, map->query.shape);
-            status = msQueryByShape(map);
-
-            lp->tolerance = dfCurrentTolerance;
-        }
-    }
-
-    if (szExpression)
-      free(szExpression);
-
-    if (lp && lp->resultcache && lp->resultcache->numresults > 0)
-    {
-        panResults = (int *)malloc(sizeof(int)*lp->resultcache->numresults);
-        for (i=0; i<lp->resultcache->numresults; i++)
-          panResults[i] = lp->resultcache->results[i].shapeindex;
-
-        qsort(panResults, lp->resultcache->numresults, 
-              sizeof(int), compare_ints);
-
-        *pnResults = lp->resultcache->numresults;
-        *ppanResults = panResults;
-        
-    }
-
-    return status;
-
-}
  
 int FLTGML2Shape_XMLNode(CPLXMLNode *psNode, shapeObj *psShp)
 {
@@ -560,391 +260,7 @@
 }
 
 
-
-static int addResult(resultCacheObj *cache, int classindex, int shapeindex, int tileindex)
-{
-  int i;
-
-  if(cache->numresults == cache->cachesize) { /* just add it to the end */
-    if(cache->cachesize == 0)
-      cache->results = (resultCacheMemberObj *) malloc(sizeof(resultCacheMemberObj)*MS_RESULTCACHEINCREMENT);
-    else
-      cache->results = (resultCacheMemberObj *) realloc(cache->results, sizeof(resultCacheMemberObj)*(cache->cachesize+MS_RESULTCACHEINCREMENT));
-    if(!cache->results) {
-      msSetError(MS_MEMERR, "Realloc() error.", "addResult()");
-      return(MS_FAILURE);
-    }   
-    cache->cachesize += MS_RESULTCACHEINCREMENT;
-  }
-
-  i = cache->numresults;
-
-  cache->results[i].classindex = classindex;
-  cache->results[i].tileindex = tileindex;
-  cache->results[i].shapeindex = shapeindex;
-  cache->numresults++;
-
-  return(MS_SUCCESS);
-}
- 
-
-
 /************************************************************************/
-/*                         FLTAddToLayerResultCache                     */
-/*                                                                      */
-/*      Utility function to add shaped to the layer result              */
-/*      cache. This function is used with the WFS GetFeature            */
-/*      interface and the cache will be used later on to output the     */
-/*      result into gml (the only important thing here is the shape     */
-/*      id).                                                            */
-/************************************************************************/
-void FLTAddToLayerResultCache(int *anValues, int nSize, mapObj *map, 
-                              int iLayerIndex)
-{
-    layerObj *psLayer = NULL;
-    int i = 0, status = MS_FALSE;
-    shapeObj shape;
-    int nClassIndex = -1;
-    char        annotate=MS_TRUE;
-
-    if (!anValues || nSize <= 0 || !map || iLayerIndex < 0 ||
-        iLayerIndex > map->numlayers-1)
-      return;
-
-    psLayer = (GET_LAYER(map, iLayerIndex));
-    if (psLayer->resultcache)
-    {
-        if (psLayer->resultcache->results)
-          free (psLayer->resultcache->results);
-        free(psLayer->resultcache);
-    }
-
-    psLayer->resultcache = (resultCacheObj *)malloc(sizeof(resultCacheObj));
-
-    initResultCache(psLayer->resultcache); 
-    /*this will force the queries to retrive the shapes using 
-     their unique id #3305*/
-    psLayer->resultcache->usegetshape = MS_TRUE;
-
-    status = msLayerOpen(psLayer);
-    if (status != MS_SUCCESS) 
-      return;
-    
-    annotate = msEvalContext(map, psLayer, psLayer->labelrequires);
-    if(map->scaledenom > 0) 
-    {
-        if((psLayer->labelmaxscaledenom != -1) && (map->scaledenom >= psLayer->labelmaxscaledenom)) 
-          annotate = MS_FALSE;
-        if((psLayer->labelminscaledenom != -1) && (map->scaledenom < psLayer->labelminscaledenom)) 
-          annotate = MS_FALSE;
-    }
-    status = msLayerWhichItems(psLayer, MS_TRUE, NULL);
-    if (status != MS_SUCCESS) 
-      return;
-
-    for (i=0; i<nSize; i++)
-    {
-        msInitShape(&shape);
-        status = msLayerGetShape(psLayer, &shape, -1, anValues[i]);
-
-        if (status != MS_SUCCESS)
-          nClassIndex = -1;
-        else
-          nClassIndex = msShapeGetClass(psLayer, &shape, map->scaledenom, NULL, 0);
-        
-        addResult(psLayer->resultcache, nClassIndex, anValues[i], shape.tileindex);
-
-#ifdef USE_PROJ
-      if(psLayer->project && msProjectionsDiffer(&(psLayer->projection), 
-                                                 &(map->projection)))
-	msProjectShape(&(psLayer->projection), &(map->projection), &shape);
-#endif
-
-        if(psLayer->resultcache->numresults == 1)
-          psLayer->resultcache->bounds = shape.bounds;
-        else
-          msMergeRect(&(psLayer->resultcache->bounds), &shape.bounds);
-
-        msFreeShape(&shape);
-    }
-
-    /*
-      At this point a msQuery was called successfully and the layer is still open.
-      No need to reopen and close it. These changes are related to RFC #52 Bug 3069.
-      msLayerClose(psLayer);
-    */
-}
-
-/************************************************************************/
-/*                               FLTIsInArray                           */
-/*                                                                      */
-/*      Verify if a certain value is inside an ordered array.           */
-/************************************************************************/
-int FLTIsInArray(int *panArray, int nSize, int nValue)
-{
-    int i = 0;
-    if (panArray && nSize > 0)
-    {
-        for (i=0; i<nSize; i++)
-        {
-            if (panArray[i] == nValue)
-              return MS_TRUE;
-            if (panArray[i] > nValue)
-              return MS_FALSE;
-        }
-    }
-
-    return MS_FALSE;
-}
-
-
-
-
-/************************************************************************/
-/*                               FLTArraysNot                           */
-/*                                                                      */
-/*      Return the list of all shape id's in a layer that are not in    */
-/*      the array.                                                      */
-/************************************************************************/
-int FLTArraysNot(int *panArray, int nSize, mapObj *map,
-                  int iLayerIndex, int **ppanResults, int *pnResult)
-{
-    layerObj *psLayer = NULL;
-    int *panResults = NULL;
-    int *panTmp = NULL;
-    int i = 0, iResult = 0;
-    
-    if (!map || iLayerIndex < 0 || iLayerIndex > map->numlayers-1)
-      return MS_SUCCESS;
-
-     psLayer = (GET_LAYER(map, iLayerIndex));
-     if (psLayer->template == NULL)
-       psLayer->template = msStrdup("ttt.html");
-
-     map->query.type = MS_QUERY_BY_RECT;
-     map->query.mode = MS_QUERY_MULTIPLE;
-     map->query.layer = psLayer->index;
-     map->query.rect = map->extent;
-     msQueryByRect(map);
-
-     free(psLayer->template);
-     psLayer->template = NULL;
-
-     if (!psLayer->resultcache || psLayer->resultcache->numresults <= 0)
-       return MS_SUCCESS;
-
-     panResults = (int *)malloc(sizeof(int)*psLayer->resultcache->numresults);
-     
-     panTmp = (int *)malloc(sizeof(int)*psLayer->resultcache->numresults);
-     for (i=0; i<psLayer->resultcache->numresults; i++)
-       panTmp[i] = psLayer->resultcache->results[i].shapeindex;
-     qsort(panTmp, psLayer->resultcache->numresults, 
-           sizeof(int), compare_ints);
-     
-     
-     iResult = 0;
-      for (i=0; i<psLayer->resultcache->numresults; i++)
-      {
-          if (!FLTIsInArray(panArray, nSize, panTmp[i]) || 
-              panArray == NULL)
-            panResults[iResult++] = 
-              psLayer->resultcache->results[i].shapeindex;
-      }
-
-      free(panTmp);
-
-      if (iResult > 0)
-      {
-          panResults = (int *)realloc(panResults, sizeof(int)*iResult);
-          qsort(panResults, iResult, sizeof(int), compare_ints);
-          *pnResult = iResult;
-
-          *ppanResults = panResults;
-      }
-
-      return MS_SUCCESS;
-}
- 
-/************************************************************************/
-/*                               FLTArraysOr                            */
-/*                                                                      */
-/*      Utility function to do an OR on 2 arrays.                       */
-/************************************************************************/
-int FLTArraysOr(int *aFirstArray, int nSizeFirst, 
-                 int *aSecondArray, int nSizeSecond,
-                 int **ppanResults, int *pnResult)
-{
-    int nResultSize = 0;
-    int *panResults = 0;
-    int iResult = 0;
-    int i, j;
-    
-    if (aFirstArray == NULL && aSecondArray == NULL)
-      return MS_SUCCESS;
-
-    if (aFirstArray == NULL || aSecondArray == NULL)
-    {
-        if (aFirstArray && nSizeFirst > 0)
-        {
-            panResults = (int *)malloc(sizeof(int)*nSizeFirst);
-            for (i=0; i<nSizeFirst; i++)
-              panResults[i] = aFirstArray[i];
-            if (pnResult)
-              *pnResult = nSizeFirst;
-            if (ppanResults)
-              *ppanResults = panResults;
-            return MS_SUCCESS;
-        }
-        else if (aSecondArray && nSizeSecond)
-        {
-            panResults = (int *)malloc(sizeof(int)*nSizeSecond);
-            for (i=0; i<nSizeSecond; i++)
-              panResults[i] = aSecondArray[i];
-            if (pnResult)
-              *pnResult = nSizeSecond;
-            if (ppanResults)
-              *ppanResults = panResults;
-            return MS_SUCCESS;
-        }
-    }
-            
-    if (aFirstArray && aSecondArray && nSizeFirst > 0 && 
-        nSizeSecond > 0)
-    {
-        nResultSize = nSizeFirst + nSizeSecond;
-
-        panResults = (int *)malloc(sizeof(int)*nResultSize);
-        iResult= 0;
-
-        if (nSizeFirst < nSizeSecond)
-        {
-            for (i=0; i<nSizeFirst; i++)
-              panResults[iResult++] = aFirstArray[i];
-
-            for (i=0; i<nSizeSecond; i++)
-            {
-                for (j=0; j<nSizeFirst; j++)
-                {
-                    if (aSecondArray[i] ==  aFirstArray[j])
-                      break;
-                    if (aSecondArray[i] < aFirstArray[j])
-                    {
-                        panResults[iResult++] = aSecondArray[i];
-                        break;
-                    }
-                }
-                if (j == nSizeFirst)
-                    panResults[iResult++] = aSecondArray[i];
-            }
-        }
-        else
-        {       
-            for (i=0; i<nSizeSecond; i++)
-              panResults[iResult++] = aSecondArray[i];
-
-            for (i=0; i<nSizeFirst; i++)
-            {
-                for (j=0; j<nSizeSecond; j++)
-                {
-                    if (aFirstArray[i] ==  aSecondArray[j])
-                      break;
-                    if (aFirstArray[i] < aSecondArray[j])
-                    {
-                        panResults[iResult++] = aFirstArray[i];
-                        break;
-                    }
-                }
-                if (j == nSizeSecond)
-                    panResults[iResult++] = aFirstArray[i];
-            }
-        }
-          
-        if (iResult > 0)
-        {
-            panResults = (int *)realloc(panResults, sizeof(int)*iResult);
-            qsort(panResults, iResult, sizeof(int), compare_ints);
-            *pnResult = iResult;
-            *ppanResults = panResults;
-        }
-
-    }
-
-    return MS_SUCCESS;
-}
-
-/************************************************************************/
-/*                               FLTArraysAnd                           */
-/*                                                                      */
-/*      Utility function to do an AND on 2 arrays.                      */
-/************************************************************************/
-int FLTArraysAnd(int *aFirstArray, int nSizeFirst, 
-                  int *aSecondArray, int nSizeSecond,
-                  int **ppanResults, int *pnResult)
-{
-    int *panResults = NULL;
-    int nResultSize =0;
-    int iResult = 0;
-    int i, j;
-
-    /* assuming arrays are sorted. */
-    if (aFirstArray && aSecondArray && nSizeFirst > 0 && 
-        nSizeSecond > 0)
-    {
-        if (nSizeFirst < nSizeSecond)
-          nResultSize = nSizeFirst;
-        else
-          nResultSize = nSizeSecond;
- 
-        panResults = (int *)malloc(sizeof(int)*nResultSize);
-        iResult= 0;
-
-        if (nSizeFirst > nSizeSecond)
-        {
-            for (i=0; i<nSizeFirst; i++)
-            {
-                for (j=0; j<nSizeSecond; j++)
-                {
-                    if (aFirstArray[i] == aSecondArray[j])
-                    {
-                        panResults[iResult++] = aFirstArray[i];
-                        break;
-                    }
-                    /* if (aFirstArray[i] < aSecondArray[j]) */
-                    /* break; */
-                }
-            }
-        }
-        else
-        {
-             for (i=0; i<nSizeSecond; i++)
-             {
-                 for (j=0; j<nSizeFirst; j++)
-                 {
-                     if (aSecondArray[i] == aFirstArray[j])
-                     {
-                         panResults[iResult++] = aSecondArray[i];
-                         break;
-                     }
-                     /* if (aSecondArray[i] < aFirstArray[j]) */
-                     /* break; */
-                }
-            }
-        }
-        
-        if (iResult > 0)
-        {
-            panResults = (int *)realloc(panResults, sizeof(int)*iResult);
-            qsort(panResults, iResult, sizeof(int), compare_ints);
-            *pnResult = iResult;
-            *ppanResults = panResults;
-        }
-
-    }
-
-    return MS_SUCCESS;
-}
-
-/************************************************************************/
 /*                        FLTIsSimpleFilterNoSpatial                    */
 /*                                                                      */
 /*      Filter encoding with only attribute queries                     */
@@ -1221,53 +537,7 @@
 }
 
 
-/************************************************************************/
-/*                            FLTGetQueryResults                        */
-/*                                                                      */
-/*      Return an arry of shpe id's after a filetr node was applied     */
-/*      on a layer.                                                     */
-/************************************************************************/
-int FLTGetQueryResults(FilterEncodingNode *psNode, mapObj *map, 
-                       int iLayerIndex,  int **ppanResults, int *pnResults,
-                       int bOnlySpatialFilter)
-{
-    int *panLeftResults=NULL, *panRightResults=NULL;
-    int nLeftResult=0, nRightResult=0;
-    int status = MS_SUCCESS;
 
-    if (psNode->eType == FILTER_NODE_TYPE_LOGICAL)
-    {
-        if (psNode->psLeftNode)
-          status = FLTGetQueryResults(psNode->psLeftNode, map, 
-                                      iLayerIndex, &panLeftResults, &nLeftResult,
-                                      bOnlySpatialFilter);
-
-        if (psNode->psRightNode)
-          status = FLTGetQueryResults(psNode->psRightNode, map,
-                                      iLayerIndex, &panRightResults, &nRightResult,
-                                      bOnlySpatialFilter);
-
-        if (psNode->pszValue && strcasecmp(psNode->pszValue, "AND") == 0)
-          FLTArraysAnd(panLeftResults, nLeftResult, 
-                       panRightResults, nRightResult, ppanResults, pnResults);
-        else if (psNode->pszValue && strcasecmp(psNode->pszValue, "OR") == 0)
-          FLTArraysOr(panLeftResults, nLeftResult, 
-                      panRightResults, nRightResult, ppanResults, pnResults);
-
-        else if (psNode->pszValue && strcasecmp(psNode->pszValue, "NOT") == 0)
-          FLTArraysNot(panLeftResults, nLeftResult, map, iLayerIndex, ppanResults, 
-                       pnResults);
-    }
-    else
-    {
-        status = FLTGetQueryResultsForNode(psNode, map, iLayerIndex, 
-                                           ppanResults, pnResults , bOnlySpatialFilter);
-    }
-
-    return status;
-}
-
-
 /************************************************************************/
 /*                          FLTApplyFilterToLayer                       */
 /*                                                                      */



More information about the mapserver-commits mailing list