[mapserver-commits] r12355 - in trunk/mapserver/mapcache: include src

svn at osgeo.org svn at osgeo.org
Fri Aug 26 07:19:15 EDT 2011


Author: tbonfort
Date: 2011-08-26 04:19:14 -0700 (Fri, 26 Aug 2011)
New Revision: 12355

Modified:
   trunk/mapserver/mapcache/include/geocache.h
   trunk/mapserver/mapcache/src/grid.c
   trunk/mapserver/mapcache/src/service_wms.c
Log:
be more verbose in wrong provided service
thomas.bonfort | 2011-04-27 12:53:42 +0200 (Wed, 27 Apr 2011)

Modified: trunk/mapserver/mapcache/include/geocache.h
===================================================================
--- trunk/mapserver/mapcache/include/geocache.h	2011-08-26 11:19:10 UTC (rev 12354)
+++ trunk/mapserver/mapcache/include/geocache.h	2011-08-26 11:19:14 UTC (rev 12355)
@@ -975,13 +975,6 @@
 #endif
 
 /**
- * \brief check if the given bbox is aligned to the boundary of one of the grid's tiles
- * @return GEOCACHE_SUCCESS if it aligns
- * @return GEOCACHE_FAILURE if not
- */
-int geocache_grid_is_bbox_aligned(geocache_context *ctx, geocache_grid *grid, double *bbox);
-
-/**
  * compute x,y,z value given a bbox.
  * will return GEOCACHE_FAILURE
  * if the bbox does not correspond to the tileset's configuration

Modified: trunk/mapserver/mapcache/src/grid.c
===================================================================
--- trunk/mapserver/mapcache/src/grid.c	2011-08-26 11:19:10 UTC (rev 12354)
+++ trunk/mapserver/mapcache/src/grid.c	2011-08-26 11:19:14 UTC (rev 12355)
@@ -114,19 +114,6 @@
    }
 }
 
-int geocache_grid_is_bbox_aligned(geocache_context *ctx, geocache_grid *grid, double *bbox) {
-   double res = geocache_grid_get_resolution(bbox,grid->tile_sx,grid->tile_sy);
-   int z;
-   if(GEOCACHE_SUCCESS != geocache_grid_get_level(ctx, grid, &res, &z))
-      return GEOCACHE_FAILURE;
-
-   if (fmod(fabs(bbox[0]-grid->extent[0])/res,grid->tile_sx)<1 && 
-         fmod(fabs(bbox[1]-grid->extent[1])/res,grid->tile_sy)<1)
-      return GEOCACHE_SUCCESS;
-   else
-      return GEOCACHE_FAILURE;
-}
-
 /*
  * update the tile by setting it's x,y,z value given a bbox.
  * will return GEOCACHE_TILESET_WRONG_RESOLUTION or GEOCACHE_TILESET_WRONG_EXTENT

Modified: trunk/mapserver/mapcache/src/service_wms.c
===================================================================
--- trunk/mapserver/mapcache/src/service_wms.c	2011-08-26 11:19:10 UTC (rev 12354)
+++ trunk/mapserver/mapcache/src/service_wms.c	2011-08-26 11:19:14 UTC (rev 12355)
@@ -372,8 +372,9 @@
             }
 
             /* verify we align on the tileset's grid */ 
+            int tmpx,tmpy,tmpz;
             if(grid_link->grid->tile_sx != width || grid_link->grid->tile_sy != height ||
-                  geocache_grid_is_bbox_aligned(ctx, grid_link->grid, bbox) != GEOCACHE_SUCCESS) {
+                  geocache_grid_get_cell(ctx, grid_link->grid, bbox, &tmpx,&tmpy,&tmpz) != GEOCACHE_SUCCESS) {
                type = GEOCACHE_REQUEST_GET_MAP;
             }
          }



More information about the mapserver-commits mailing list