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

svn at osgeo.org svn at osgeo.org
Fri Aug 26 07:22:50 EDT 2011


Author: tbonfort
Date: 2011-08-26 04:22:50 -0700 (Fri, 26 Aug 2011)
New Revision: 12403

Modified:
   trunk/mapserver/mapcache/geocache.xml
   trunk/mapserver/mapcache/include/geocache.h
   trunk/mapserver/mapcache/src/configuration.c
   trunk/mapserver/mapcache/src/mod_geocache.c
   trunk/mapserver/mapcache/src/service_wms.c
Log:
remove obsolete debugging check. fix compiler warnings.
thomas.bonfort | 2011-07-08 11:54:54 +0200 (Fri, 08 Jul 2011)

Modified: trunk/mapserver/mapcache/geocache.xml
===================================================================
--- trunk/mapserver/mapcache/geocache.xml	2011-08-26 11:22:43 UTC (rev 12402)
+++ trunk/mapserver/mapcache/geocache.xml	2011-08-26 11:22:50 UTC (rev 12403)
@@ -125,6 +125,25 @@
          </grid>
    --> 
 
+   <!-- french grids -->
+   <grid name="FXX">
+      <extent>-357823.2365 6037008.6939 1313632.3628 7230727.3772</extent>
+      <srs>EPSG:2154</srs>
+      <srsalias>EPSG:310024802</srsalias>
+      <srsalias>IGNF:GEOPORTALFXX</srsalias>
+      <resolutions>2048 1024 512 256 128 64 32 16 8 4 2 1 0.5 0.25 0.125 0.0625</resolutions>
+      <units>m</units>
+      <size>256 256</size>
+   </grid>
+   <grid name="Miller">
+      <extent>-20037504 -10018752 20037504 10018752</extent>
+      <srs>EPSG:310642901</srs>
+      <srsalias>IGNF:MILLER</srsalias>
+      <resolutions>39135.75 19567.875 9783.9375 4891.96875 2445.984375</resolutions>
+      <units>m</units>
+      <size>256 256</size>
+   </grid>
+
    <!--
         a cache is where tiles are stored once they have been rendered
         the only "type" available right now is "disk"
@@ -467,6 +486,8 @@
       <source>osm</source>
       <cache>disk</cache>
       <format>PNG</format>
+      <grid>FXX</grid>
+      <grid>Miller</grid>
       <grid>WGS84</grid>
       <grid>g</grid>
       <metatile>5 5</metatile>
@@ -503,7 +524,7 @@
    <service type="wms" enabled="true">
       <forwarding_rule name="foo rule">
             <http>
-               <url>http://localhost/cgi-bin/mapserv?map=/gro1/mapserver-utils/osm.map</url>
+               <url>http://localhost/</url>
             </http>
       </forwarding_rule>
    </service>
@@ -545,5 +566,6 @@
         this location should be writable by the apache user
    -->
    <lock_dir>/tmp</lock_dir>
+   <pathinfo_hack/>
 
 </geocache>

Modified: trunk/mapserver/mapcache/include/geocache.h
===================================================================
--- trunk/mapserver/mapcache/include/geocache.h	2011-08-26 11:22:43 UTC (rev 12402)
+++ trunk/mapserver/mapcache/include/geocache.h	2011-08-26 11:22:50 UTC (rev 12403)
@@ -823,6 +823,8 @@
     apr_table_t *metadata;
 
     const char *lockdir;
+
+    int pathinfo_hack;
 };
 
 /**

Modified: trunk/mapserver/mapcache/src/configuration.c
===================================================================
--- trunk/mapserver/mapcache/src/configuration.c	2011-08-26 11:22:43 UTC (rev 12402)
+++ trunk/mapserver/mapcache/src/configuration.c	2011-08-26 11:22:50 UTC (rev 12403)
@@ -1124,6 +1124,11 @@
    }
    apr_dir_close(lockdir);
 
+   if((node = ezxml_child(doc,"pathinfo_hack")) != NULL) {
+      config->pathinfo_hack = 1;
+   } else {
+      config->pathinfo_hack = 0;
+   }
 
 cleanup:
    ezxml_free(doc);

Modified: trunk/mapserver/mapcache/src/mod_geocache.c
===================================================================
--- trunk/mapserver/mapcache/src/mod_geocache.c	2011-08-26 11:22:43 UTC (rev 12402)
+++ trunk/mapserver/mapcache/src/mod_geocache.c	2011-08-26 11:22:50 UTC (rev 12403)
@@ -27,6 +27,7 @@
 #include <http_log.h>
 #include "geocache.h"
 #include <unistd.h>
+#include <stdlib.h>
 
 #ifdef AP_NEED_SET_MUTEX_PERMS
 #include "unixd.h"
@@ -258,9 +259,6 @@
    geocache_cfg *config = NULL;
    geocache_request *request = NULL;
 
-   geocache_context_apache_request *apache_ctx = apache_request_context_create(r); 
-   geocache_context *global_ctx = (geocache_context*)apache_ctx;
-   int ret;
 
    if (!r->handler || strcmp(r->handler, "geocache")) {
       return DECLINED;
@@ -269,12 +267,20 @@
       return HTTP_METHOD_NOT_ALLOWED;
    }
    
+   geocache_context_apache_request *apache_ctx = apache_request_context_create(r); 
+   geocache_context *global_ctx = (geocache_context*)apache_ctx;
+   int ret;
    
+   
 
    params = geocache_http_parse_param_string(global_ctx, r->args);
    config = ap_get_module_config(r->per_dir_config, &geocache_module);
+   char *path_info = r->path_info;
+   if(config->pathinfo_hack) {
+      path_info = r->uri;
+   }
 
-   geocache_service_dispatch_request(global_ctx,&request,r->path_info,params,config);
+   geocache_service_dispatch_request(global_ctx,&request,path_info,params,config);
    if(GC_HAS_ERROR(global_ctx)) {
       return report_error(apache_ctx);
    }
@@ -293,13 +299,13 @@
        * remove the path_info from the end of the url (we want the url of the base of the service)
        * TODO: is there an apache api to access this ?
        */
-      if(*(original->path_info)) {
-         char *end = strstr(url,original->path_info);
+      if(*(path_info)) {
+         char *end = strstr(url,path_info);
          if(end) {
             *end = '\0';
          }
       }
-      request->service->create_capabilities_response(global_ctx,req_caps,url,original->path_info,config);
+      request->service->create_capabilities_response(global_ctx,req_caps,url,path_info,config);
       if(GC_HAS_ERROR(global_ctx)) {
          return report_error(apache_ctx);
       }

Modified: trunk/mapserver/mapcache/src/service_wms.c
===================================================================
--- trunk/mapserver/mapcache/src/service_wms.c	2011-08-26 11:22:43 UTC (rev 12402)
+++ trunk/mapserver/mapcache/src/service_wms.c	2011-08-26 11:22:50 UTC (rev 12403)
@@ -472,7 +472,16 @@
             geocache_grid_link *grid_link = NULL;
             for(i=0;i<tileset->grid_links->nelts;i++){
                grid_link = APR_ARRAY_IDX(tileset->grid_links,i,geocache_grid_link*);
-               if(strcasecmp(grid_link->grid->srs,srs)) continue;
+               if(strcasecmp(grid_link->grid->srs,srs)) {
+                  /* look if the grid has some srs aliases */
+                  int s;
+                  for(s=0;s<grid_link->grid->srs_aliases->nelts;s++) {
+                     char *srsalias = APR_ARRAY_IDX(grid_link->grid->srs_aliases,s,char*);
+                     if(!strcasecmp(srsalias,srs)) break;
+                  }
+                  if(s==grid_link->grid->srs_aliases->nelts)
+                     continue; /* no srs alias matches the requested srs */
+               }
                break;
             }
             apr_table_t *dimtable = NULL;



More information about the mapserver-commits mailing list