[mapserver-commits] r9902 - tags/rel-5-6-1/mapserver
svn at osgeo.org
svn at osgeo.org
Thu Feb 25 11:36:49 EST 2010
Author: dmorissette
Date: 2010-02-25 11:36:47 -0500 (Thu, 25 Feb 2010)
New Revision: 9902
Modified:
tags/rel-5-6-1/mapserver/HISTORY.TXT
tags/rel-5-6-1/mapserver/mapdraw.c
tags/rel-5-6-1/mapserver/mapfile.c
tags/rel-5-6-1/mapserver/mapgml.c
tags/rel-5-6-1/mapserver/mapogcfilter.c
tags/rel-5-6-1/mapserver/mapows.h
tags/rel-5-6-1/mapserver/mappostgis.c
tags/rel-5-6-1/mapserver/mapquery.c
tags/rel-5-6-1/mapserver/mapserver.h
tags/rel-5-6-1/mapserver/mapwfs.c
Log:
Revert r9877 and r9878 which were made here (tags/rel-5-6-1) instead of branch-5-6
Modified: tags/rel-5-6-1/mapserver/HISTORY.TXT
===================================================================
--- tags/rel-5-6-1/mapserver/HISTORY.TXT 2010-02-24 23:08:55 UTC (rev 9901)
+++ tags/rel-5-6-1/mapserver/HISTORY.TXT 2010-02-25 16:36:47 UTC (rev 9902)
@@ -11,14 +11,7 @@
For a complete change history, please see the Subversion log comments.
-Current Version
----------------
-- Correct one pass query problems and OGC filter query (#3305)
-
-- Correct QueryByOperator (#3346)
-
-
Version 5.6.1 (2010-01-08):
---------------------------
Modified: tags/rel-5-6-1/mapserver/mapdraw.c
===================================================================
--- tags/rel-5-6-1/mapserver/mapdraw.c 2010-02-24 23:08:55 UTC (rev 9901)
+++ tags/rel-5-6-1/mapserver/mapdraw.c 2010-02-25 16:36:47 UTC (rev 9902)
@@ -1212,10 +1212,7 @@
msInitShape(&shape);
for(i=0; i<layer->resultcache->numresults; i++) {
- if(layer->resultcache->usegetshape)
- status = msLayerGetShape(layer, &shape, layer->resultcache->results[i].tileindex, layer->resultcache->results[i].shapeindex);
- else
- status = msLayerResultsGetShape(layer, &shape, layer->resultcache->results[i].tileindex, layer->resultcache->results[i].shapeindex);
+ status = msLayerResultsGetShape(layer, &shape, layer->resultcache->results[i].tileindex, layer->resultcache->results[i].shapeindex);
if(status != MS_SUCCESS) {
msFree(colorbuffer);
msFree(mindistancebuffer);
Modified: tags/rel-5-6-1/mapserver/mapfile.c
===================================================================
--- tags/rel-5-6-1/mapserver/mapfile.c 2010-02-24 23:08:55 UTC (rev 9901)
+++ tags/rel-5-6-1/mapserver/mapfile.c 2010-02-25 16:36:47 UTC (rev 9902)
@@ -5616,14 +5616,3 @@
}
}
-void initResultCache(resultCacheObj *resultcache)
-{
- if (resultcache)
- {
- resultcache->results = NULL;
- resultcache->numresults = 0;
- resultcache->cachesize = 0;
- resultcache->bounds.minx = resultcache->bounds.miny = resultcache->bounds.maxx = resultcache->bounds.maxy = -1;
- resultcache->usegetshape = MS_FALSE;
- }
-}
Modified: tags/rel-5-6-1/mapserver/mapgml.c
===================================================================
--- tags/rel-5-6-1/mapserver/mapgml.c 2010-02-24 23:08:55 UTC (rev 9901)
+++ tags/rel-5-6-1/mapserver/mapgml.c 2010-02-25 16:36:47 UTC (rev 9902)
@@ -1413,11 +1413,8 @@
** msGMLWriteWFSQuery()
**
** Similar to msGMLWriteQuery() but tuned for use with WFS 1.0.0
-** bUseGetShape is used when the query passed through a commplex filter
-** encoding #3305
*/
-int msGMLWriteWFSQuery(mapObj *map, FILE *stream, int maxfeatures, char *default_namespace_prefix,
- int outputformat, int bUseGetShape)
+int msGMLWriteWFSQuery(mapObj *map, FILE *stream, int maxfeatures, char *default_namespace_prefix, int outputformat)
{
#ifdef USE_WFS_SVR
int status;
@@ -1513,11 +1510,7 @@
}
for(j=0; j<lp->resultcache->numresults; j++) {
- if (bUseGetShape)
- status = msLayerGetShape(lp, &shape, lp->resultcache->results[j].tileindex, lp->resultcache->results[j].shapeindex);
- else
- status = msLayerResultsGetShape(lp, &shape, lp->resultcache->results[j].tileindex, lp->resultcache->results[j].shapeindex);
-
+ status = msLayerResultsGetShape(lp, &shape, lp->resultcache->results[j].tileindex, lp->resultcache->results[j].shapeindex);
if(status != MS_SUCCESS)
return(status);
Modified: tags/rel-5-6-1/mapserver/mapogcfilter.c
===================================================================
--- tags/rel-5-6-1/mapserver/mapogcfilter.c 2010-02-24 23:08:55 UTC (rev 9901)
+++ tags/rel-5-6-1/mapserver/mapogcfilter.c 2010-02-25 16:36:47 UTC (rev 9902)
@@ -633,11 +633,14 @@
}
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;
+ psLayer->resultcache->results = NULL;
+ psLayer->resultcache->numresults = 0;
+ psLayer->resultcache->cachesize = 0;
+ psLayer->resultcache->bounds.minx = -1;
+ psLayer->resultcache->bounds.miny = -1;
+ psLayer->resultcache->bounds.maxx = -1;
+ psLayer->resultcache->bounds.maxy = -1;
status = msLayerOpen(psLayer);
@@ -659,8 +662,7 @@
for (i=0; i<nSize; i++)
{
msInitShape(&shape);
- /*status = msLayerResultsGetShape(psLayer, &shape, -1, anValues[i]);*/
- status = msLayerGetShape(psLayer, &shape, -1, anValues[i]);
+ status = msLayerResultsGetShape(psLayer, &shape, -1, anValues[i]);
if (status != MS_SUCCESS)
nClassIndex = -1;
Modified: tags/rel-5-6-1/mapserver/mapows.h
===================================================================
--- tags/rel-5-6-1/mapserver/mapows.h 2010-02-24 23:08:55 UTC (rev 9901)
+++ tags/rel-5-6-1/mapserver/mapows.h 2010-02-25 16:36:47 UTC (rev 9902)
@@ -399,8 +399,7 @@
#ifdef USE_WFS_SVR
-MS_DLL_EXPORT int msGMLWriteWFSQuery(mapObj *map, FILE *stream, int maxfeatures, char *wfs_namespace,
- int outputformat, int bUseGetShape);
+MS_DLL_EXPORT int msGMLWriteWFSQuery(mapObj *map, FILE *stream, int maxfeatures, char *wfs_namespace, int outputformat);
#endif
Modified: tags/rel-5-6-1/mapserver/mappostgis.c
===================================================================
--- tags/rel-5-6-1/mapserver/mappostgis.c 2010-02-24 23:08:55 UTC (rev 9901)
+++ tags/rel-5-6-1/mapserver/mappostgis.c 2010-02-25 16:36:47 UTC (rev 9902)
@@ -1295,7 +1295,7 @@
}
-int msPostGISReadShape(layerObj *layer, shapeObj *shape) {
+int msPostGISReadShape(layerObj *layer, shapeObj *shape, int random) {
char *wkbstr = NULL;
unsigned char *wkb = NULL;
@@ -1393,21 +1393,26 @@
}
}
- /* t is the geometry, t+1 is the uid */
- tmp = PQgetvalue(layerinfo->pgresult, layerinfo->rownum, t + 1);
- if( tmp ) {
- uid = strtol( tmp, NULL, 10 );
+ if( random ) {
+ /* t is the geometry, t+1 is the uid */
+ tmp = PQgetvalue(layerinfo->pgresult, layerinfo->rownum, t + 1);
+ if( tmp ) {
+ uid = strtol( tmp, NULL, 10 );
+ }
+ else {
+ uid = 0;
+ }
+ if( layer->debug > 4 ) {
+ msDebug("msPostGISReadShape: Setting shape->index = %d\n", uid);
+ }
+ shape->index = uid;
+ } else {
+ if( layer->debug > 4 ) {
+ msDebug("msPostGISReadShape: Setting shape->index = %d\n", layerinfo->rownum);
+ }
+ shape->index = layerinfo->rownum;
}
- else {
- uid = 0;
- }
- if( layer->debug > 4 ) {
- msDebug("msPostGISReadShape: Setting shape->index = %d\n", uid);
- msDebug("msPostGISReadShape: Setting shape->tileindex = %d\n", layerinfo->rownum);
- }
- shape->index = uid;
- shape->tileindex = layerinfo->rownum;
-
+
if( layer->debug > 2 ) {
msDebug("msPostGISReadShape: [index] %d\n", shape->index);
}
@@ -1772,7 +1777,7 @@
if (layerinfo->rownum < PQntuples(layerinfo->pgresult)) {
int rv;
/* Retrieve this shape, cursor access mode. */
- rv = msPostGISReadShape(layer, shape);
+ rv = msPostGISReadShape(layer, shape, 0);
if( shape->type != MS_SHAPE_NULL ) {
(layerinfo->rownum)++; /* move to next shape */
return MS_SUCCESS;
@@ -1814,14 +1819,9 @@
assert(layer->layerinfo != NULL);
if (layer->debug) {
- msDebug("msPostGISLayerResultsGetShape called for record = %i\n", record);
+ msDebug("msPostGISLayerGetShape called for record = %i\n", record);
}
- if( tile < 0 ) {
- msDebug("msPostGISLayerResultsGetShape called for record = %i\n", record);
- return msPostGISLayerResultsGetShape(layer, shape, tile, record);
- }
-
layerinfo = (msPostGISLayerInfo*) layer->layerinfo;
/* Check the validity of the open result. */
@@ -1844,21 +1844,21 @@
}
/* Check the validity of the requested record number. */
- if( tile >= PQntuples(pgresult) ) {
- msDebug("msPostGISLayerResultsGetShape got request for (%d) but only has %d tuples.\n", tile, PQntuples(pgresult));
+ if( record >= PQntuples(pgresult) ) {
+ msDebug("msPostGISLayerResultsGetShape got record request (%d) but only has %d tuples.\n", record, PQntuples(pgresult));
msSetError( MS_MISCERR,
"Got request larger than result set.",
"msPostGISLayerResultsGetShape()");
return MS_FAILURE;
}
- layerinfo->rownum = tile; /* Only return one result. */
+ layerinfo->rownum = record; /* Only return one result. */
/* We don't know the shape type until we read the geometry. */
shape->type = MS_SHAPE_NULL;
/* Return the shape, cursor access mode. */
- result = msPostGISReadShape(layer, shape);
+ result = msPostGISReadShape(layer, shape, 0);
return (shape->type == MS_SHAPE_NULL) ? MS_FAILURE : MS_SUCCESS;
#else
@@ -1945,7 +1945,7 @@
if (num_tuples > 0) {
/* Get shape in random access mode. */
- result = msPostGISReadShape(layer, shape);
+ result = msPostGISReadShape(layer, shape, 1);
}
return (shape->type == MS_SHAPE_NULL) ? MS_FAILURE : ( (num_tuples > 0) ? MS_SUCCESS : MS_DONE );
Modified: tags/rel-5-6-1/mapserver/mapquery.c
===================================================================
--- tags/rel-5-6-1/mapserver/mapquery.c 2010-02-24 23:08:55 UTC (rev 9901)
+++ tags/rel-5-6-1/mapserver/mapquery.c 2010-02-25 16:36:47 UTC (rev 9902)
@@ -362,7 +362,9 @@
if(map->query.clear_resultcache || lp->resultcache == NULL) {
lp->resultcache = (resultCacheObj *)malloc(sizeof(resultCacheObj)); /* allocate and initialize the result cache */
- initResultCache( lp->resultcache);
+ lp->resultcache->results = NULL;
+ lp->resultcache->numresults = lp->resultcache->cachesize = 0;
+ lp->resultcache->bounds.minx = lp->resultcache->bounds.miny = lp->resultcache->bounds.maxx = lp->resultcache->bounds.maxy = -1;
}
msInitShape(&shape);
@@ -519,7 +521,9 @@
}
lp->resultcache = (resultCacheObj *)malloc(sizeof(resultCacheObj)); /* allocate and initialize the result cache */
- initResultCache( lp->resultcache);
+ lp->resultcache->results = NULL;
+ lp->resultcache->numresults = lp->resultcache->cachesize = 0;
+ lp->resultcache->bounds.minx = lp->resultcache->bounds.miny = lp->resultcache->bounds.maxx = lp->resultcache->bounds.maxy = -1;
nclasses = 0;
classgroup = NULL;
@@ -670,7 +674,9 @@
}
lp->resultcache = (resultCacheObj *)malloc(sizeof(resultCacheObj)); /* allocate and initialize the result cache */
- initResultCache( lp->resultcache);
+ lp->resultcache->results = NULL;
+ lp->resultcache->numresults = lp->resultcache->cachesize = 0;
+ lp->resultcache->bounds.minx = lp->resultcache->bounds.miny = lp->resultcache->bounds.maxx = lp->resultcache->bounds.maxy = -1;
nclasses = 0;
classgroup = NULL;
@@ -902,7 +908,9 @@
if(i == 0) {
lp->resultcache = (resultCacheObj *)malloc(sizeof(resultCacheObj)); /* allocate and initialize the result cache */
- initResultCache( lp->resultcache);
+ lp->resultcache->results = NULL;
+ lp->resultcache->numresults = lp->resultcache->cachesize = 0;
+ lp->resultcache->bounds.minx = lp->resultcache->bounds.miny = lp->resultcache->bounds.maxx = lp->resultcache->bounds.maxy = -1;
}
nclasses = 0;
@@ -1158,7 +1166,9 @@
}
lp->resultcache = (resultCacheObj *)malloc(sizeof(resultCacheObj)); /* allocate and initialize the result cache */
- initResultCache( lp->resultcache);
+ lp->resultcache->results = NULL;
+ lp->resultcache->numresults = lp->resultcache->cachesize = 0;
+ lp->resultcache->bounds.minx = lp->resultcache->bounds.miny = lp->resultcache->bounds.maxx = lp->resultcache->bounds.maxy = -1;
nclasses = 0;
classgroup = NULL;
@@ -1347,7 +1357,9 @@
}
lp->resultcache = (resultCacheObj *)malloc(sizeof(resultCacheObj)); /* allocate and initialize the result cache */
- initResultCache( lp->resultcache);
+ lp->resultcache->results = NULL;
+ lp->resultcache->numresults = lp->resultcache->cachesize = 0;
+ lp->resultcache->bounds.minx = lp->resultcache->bounds.miny = lp->resultcache->bounds.maxx = lp->resultcache->bounds.maxy = -1;
nclasses = 0;
classgroup = NULL;
@@ -1516,8 +1528,11 @@
if(status != MS_SUCCESS) return(MS_FAILURE);
/* identify target shapes */
- searchrect = qshape->bounds;
-
+ searchrect.minx = map->extent.minx;
+ searchrect.miny = map->extent.miny;
+ searchrect.maxx = map->extent.maxx;
+ searchrect.maxy = map->extent.maxy;
+
#ifdef USE_PROJ
if(lp->project && msProjectionsDiffer(&(lp->projection), &(map->projection)))
msProjectRect(&(map->projection), &(lp->projection), &searchrect); /* project the searchrect to source coords */
@@ -1534,7 +1549,9 @@
}
lp->resultcache = (resultCacheObj *)malloc(sizeof(resultCacheObj)); /* allocate and initialize the result cache */
- initResultCache( lp->resultcache);
+ lp->resultcache->results = NULL;
+ lp->resultcache->numresults = lp->resultcache->cachesize = 0;
+ lp->resultcache->bounds.minx = lp->resultcache->bounds.miny = lp->resultcache->bounds.maxx = lp->resultcache->bounds.maxy = -1;
classgroup = NULL;
if (lp->classgroup && lp->numclasses > 0)
Modified: tags/rel-5-6-1/mapserver/mapserver.h
===================================================================
--- tags/rel-5-6-1/mapserver/mapserver.h 2010-02-24 23:08:55 UTC (rev 9901)
+++ tags/rel-5-6-1/mapserver/mapserver.h 2010-02-25 16:36:47 UTC (rev 9902)
@@ -997,9 +997,6 @@
%mutable;
#endif /* SWIG */
- /*used to force the result retreiving to use getshape instead of msLayerResultGetShape #3305*/
- int usegetshape;
-
} resultCacheObj;
@@ -1602,7 +1599,6 @@
MS_DLL_EXPORT void initGrid( graticuleObj *pGraticule );
MS_DLL_EXPORT void initWeb(webObj *web);
MS_DLL_EXPORT void freeWeb(webObj *web);
-MS_DLL_EXPORT void initResultCache(resultCacheObj *resultcache);
MS_DLL_EXPORT featureListNodeObjPtr insertFeatureList(featureListNodeObjPtr *list, shapeObj *shape);
MS_DLL_EXPORT void freeFeatureList(featureListNodeObjPtr list);
Modified: tags/rel-5-6-1/mapserver/mapwfs.c
===================================================================
--- tags/rel-5-6-1/mapserver/mapwfs.c 2010-02-24 23:08:55 UTC (rev 9901)
+++ tags/rel-5-6-1/mapserver/mapwfs.c 2010-02-25 16:36:47 UTC (rev 9902)
@@ -1025,13 +1025,9 @@
char **papszPropertyName = NULL;
int nPropertyNames = 0;
- /*use msLayerGetShape instead of msLayerResultsGetShape of complex filter #3305*/
- int bUseGetShape = MS_FALSE;
-
/* Default filter is map extents */
bbox = map->extent;
-
/* Read CGI parameters */
/* */
/* __TODO__ Need to support XML encoded requests */
@@ -1457,9 +1453,6 @@
return msWFSException(map, "mapserv", "NoApplicableCode", paramsObj->pszVersion);
}
}
-
- if (bUseGetShape == MS_FALSE)
- bUseGetShape = (!FLTIsSimpleFilter(psNode));
FLTFreeFilterEncodingNode( psNode );
psNode = NULL;
@@ -1555,9 +1548,6 @@
return msWFSException(map, "mapserv", "NoApplicableCode", paramsObj->pszVersion);
}
- if (bUseGetShape == MS_FALSE)
- bUseGetShape = (!FLTIsSimpleFilter(psNode));
-
FLTFreeFilterEncodingNode( psNode );
psNode = NULL;
break;
@@ -1814,7 +1804,7 @@
/* handle case of maxfeatures = 0 */
if(maxfeatures != 0 && iResultTypeHits == 0)
- msGMLWriteWFSQuery(map, stdout, maxfeatures, pszNameSpace, outputformat,bUseGetShape);
+ msGMLWriteWFSQuery(map, stdout, maxfeatures, pszNameSpace, outputformat);
if (((iNumberOfFeatures==0) || (maxfeatures == 0)) && iResultTypeHits == 0) {
msIO_printf(" <gml:boundedBy>\n");
More information about the mapserver-commits
mailing list